Page 1 of 1

Terrain-Shader: more than 4 splats

PostPosted: Mon Apr 01, 2019 11:31 am
by Cyntherius
Hello

im looking for a way to use more then only four splats in the terrain node.
Is there a way to use these node twice in a single pass and the unity terrain engine can also use this shader?

http://wiki.amplify.pt/index.php?title=Unity_Products:Amplify_Shader_Editor/Terrain_Shaders

Re: Terrain-Shader: more than 4 splats

PostPosted: Wed Apr 03, 2019 9:17 am
by Amplify_Borba
Hey there, unfortunately that documentation wasn't updated after we added support for more than four splats, apologies for that!

When examining the sample, notice that we now have a SimpleTerrainAddPass, which is registered in the main shader ( SimpleTerrainFirstPass ) as a dependency, and while the main shader is responsible for mixing the first 4 splats, the SimpleTerrainAddPass is used to add any further pass, which depends on the SplatCount Tag set into the main shader.

Please note that Unity's terrain has a maximum of 3 shaders, in this case there's the Base, First Pass and Add Pass.

As a further example, the shader function we provide may only use 4 splats, so if you have 9 splats, you'll be using the First Pass and the Add Pass will be called twice ( 4 + 4 + 1 ).