Hey there,
I have been researching a while now and learned more about the workings of SRP (especially URP) as well as shader dev. My goal is to eventually create a custom terrain shader which is compatible with the unity terrain system (not necessarily with Shader Graph), but I’d like to start by customizing the provided Terrain/Lit shader.
So the terrain shader only supports 4 terrain layers to be height blended and, as I’ve understood it, more than 4 terrain layers (e.g. 8) are handled by having a Pass to render each set of 4 terrain layers, which are then blended together. Is this process controlled only by the shader or internally in some scripts? If I would use my own terrain shader, or lets say just add a fifth terrain layer support to the Terrain/Lit shader, would it work or is there something controlled by the unity terrain system internally?
In general, I was able to dig a bit through the shader code (https://github.com/Unity-Technologies/Graphics/tree/master/com.unity.render-pipelines.universal/Shaders/Terrain) and understand some stuff. Also this post Shaderlab "Dependency" property? (2013) has a helpfull attempt of explaining terrain shader workings.
However are there any resources (or plans for documentation) about how everything works together?
Some tips or hints to places are much appreciated!
Cheers
Lucas