Page 1 of 1

Tesselation on terrain

PostPosted: Tue Oct 23, 2018 7:22 pm
by naitoookami
Been googling for a couple hours now trying to figure out how to add height maps to my terrain textures using tessellation. So far, no luck. The problem I keep running into is Unity saying it can't use terrain that relies on tangent geometry. Is there any way around this? I'd really like to be able to add this additional detail to my terrains.

As a side note. Is there absolutely any way possible of achieving more than 4 splats? I'd like to have some variations of my textures with the smoothness changed so I can paint wetness.

Re: Tesselation on terrain

PostPosted: Wed Oct 24, 2018 4:44 pm
by francois85
Hey naitoookami,

All the concerns you listed above Ive achieved in amplify Unity. I'm no expert, I've only been using amplify it for about 3 weeks.

I manage to get tessellation working but not on iOS build, it appears to be a Unity bug. I submitted a bug report to Unity and Im waiting on a reply. In the meantime I switched to macOS build which seems to work.

As for the splat mat I manage to get 8 maps working as a test using texture arrays. It's not a generic solution since I've enbeddit the information I need to bend into the mesh that is build at run time. I would recommend you look into the texture arrays as a start. amplify even provides a tool to create them.

Good tessellation tutorial

https://www.youtube.com/watch?v=TSi6OPRu9_U

Re: Tesselation on terrain

PostPosted: Thu Oct 25, 2018 2:30 pm
by Amplify_Borba
Hello! To add francois85's reply ( thanks! ), we provide two terrain samples that show how you can use Amplify Shader Editor with Unity Terrain - 'SimpleTerrain' and the 'SRP Lightweight Terrain', and also allow setting up more that 4 splats, simply select the terrain and add them through the inspector:

Image

You may use these samples as a starting point for your own effect, and you can also add Tessellation and offset it according to a heightmap:

Image

Do note, however, that we're currently investigating a few issues with tessellation and using over 4 splats, but we'll be sure to post any developments in this thread to keep you up to date on this matter.

Re: Tesselation on terrain

PostPosted: Thu Oct 25, 2018 5:27 pm
by naitoookami
Okay so tessellation started working. My issue was the UVs were wrong so the heightmap was just balooning the terrain. :lol:

I've got a new problem though, regarding the more than four splats aspect of my post. This is the result I get when I use over four splats.

Image

My shader is exactly as you posted except I multiplied the heightmaps within the shader function so I could use the UVs of the splats. The standard terrain shader handles the blending fine but here I get these squares. And when I add tessellation. This happens.

Image

UPDATE:
I went into the sample shaders and recompiled it, since my changes are within the function updating it added tessellation to the sample shader as well. This fixed the textures looking blocky but using tessellation and displacement still has that z-fighting issue. I'm rather noob when it comes to this stuff so I can only assume it could be an easy fix and I just don't know about it.

UPDATE 2:
I figured out I had to go into the addpass shader and mess with things in there but I don't really understand how it works. When I put the displacements in I get an error.

cannot map expression to vs_4_0 instruction set
Compiling Vertex program with DIRECTIONAL
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME

Re: Tesselation on terrain

PostPosted: Fri Oct 26, 2018 7:50 am
by Amplify_Borba
Thank you for your feedback, we really appreciate it.

However, as I've said in my previous post, we're currently investigating a few issues with tessellation and using over 4 splats. In any case, I will forward the information you shared to the developer and will let you know as soon as we have any developments regarding this issue, apologies for the inconvenience.

Re: Tesselation on terrain

PostPosted: Fri Oct 26, 2018 6:06 pm
by naitoookami
No need to apologize! You guys are the best and your support is unmatched. You guys make my purchase more and more worth it each day I experiment with the editor. Keep up the great work. Also thank you, Francois85, your resources did help me out and taught me a bit, thank you!