Here is a picture of the shader: Imgur: The magic of the Internet I am just using sample textures and a random alpha channel I doodled up in 5 seconds. I am mainly concerned about the structure of the shader itself regarding performance.
I am only an amateur when it comes to the graph shader.
-Does anything stand out as something that might cause a problem? Maybe with too many render passes? I don’t know what causes too many render passes to happen, so that’s why I am asking.
-When it comes to terrain shaders, is there anything else I could explore to spice it up?
-How much does applying a normal/bump map to a texture drag performance down?
-I could expand this to include many different texture layers - how many texture layers would be too many?
Thanks so much for any feedback. I am REALLY excited to learn more about the shader graph. This is really cool.
I am not the expert, but I can tell you several things.
Sampling texture is not for free, it turns out to be more expansive than I expected initialy and adding more and more “layers” comes with cost. In general everyone tries to reduce number of sampled textures in shader and to achieve that, data is often packed into RGBA channels. Google “splatmap” - this is single texture with 4 masks, each for on layer, so instead of sampling 4 masks there is only one.
Normal map cost is the same as sampling any other texture plus applying normals in fragment stage (just a bit more expansive), but as you can predict adding more layers requires more normal maps. In reality more than 4 layers (actually 5) is harder and more expansive to make anyway, but 4 channels is most of the time enough.
If you take tool like polybrush, you can paint vertices of mesh (put masks into vertex color) and use it later in shader, but vertex color is not as accurate as dense texture and you would end up with gradient linear transitions between textures.
The same would happen with lower resolution splatmap and to get away with something better there is technique called “height blending”, you can see example here: http://untitledgam.es/2017/01/height-blending-shader/
Even though, it is a bit more advanced thing, so don’t start there.
Thanks for the response. It doesn’t surprise me that what I have done is probably not the most efficient way.
So, I have actually spent a lot of time trying to find good splatmap examples and I’m not sure I’m on the right track. I originally thought splatmaps were some shader graph node, but that doesn’t appear to be the case. I also have tried to look for documentation about it, but couldn’t find anything. I am assuming that this is more of a slang term people have assigned to the RGBA mapping thing you mentioned. I have seen what you described about the multiple channels each being a texture with a mask, but I can’t remember the video that had it. I will try to find it again. If anyone happens to have a link, would be much appreciated.