Hello!
I needed a set of shaders that curve based on the distance from camera. Basically, I took some of the default HLSL shaders Unity provides and changed the code in the vertex shader to adjust the position of the vertices.
It works great, but I would like to know if there is a way to centralize the code in the vertex shader, as it is the same in all cases, and just pass that code throughout all shaders I need, because only the fragment shader is different.
This is because if I need to change anything in the vertex shader function, I need to change it in 6 different places.
Thank you!
↧