- Home /
Unity Terrain - shader for custom post-splat?
Hi,
I've been looking into Unity terrain's built-in shaders and if I understand correctly terrain rendering is based on two shaders - FirstPass and AddPass. FirstPass is for 4 initial splat textures and if you use more textures - AddPass kicks in. That is all great, but I need to write a shader that would somehow be applied after FirstPass or AddPass (depending on texture count) and apply some textures on top of it. Editing FirstPass doesn't seem to be feasible as the desired effect has to be drawn on top of everything - so if I do something at the end of FirstPass shader, AddPass might kick in and overwrite it. If I only edit AddPass, then if the user only uses 4 or less textures, AddPass won't be used at all. If I edit both, the effect will add twice, which is also not good.
To sum up: any ideas how could I achieve this custom "post-splat" effect? My main problem is that I can't seem to find a way how to insert my own shader or pass after FirstPass and/or AddPass. Any feedback, ideas would be much appreciated!