0

Can we have a bit more flexibility in Shader Forge?

Stanislav Morozov 8 years ago 0

Hello Joachim.

Let me describe little enhancement that arise from one little but quite annoying issue.

I have several shaders in my project and I do some specific calculations in the vertex routine to achieve 'curvature' effect of the landscape. I have to adjust vertex coords in each shader. Thus I have the same piece of code duplicated several times in different shaders in 'code' nodes. Every time I have to make some changes in that code I have to change it in several different places. I'd be happy to put the code in a .cginc and just include it and call it as a function, but obviously I can't.

It'd be really nice to have two additional nodes. Let's name them 'include' and 'call function'.

The 'include' node will just put additional #include in shader's CGPROGRAM.

The 'call function' node will be very similar to existing 'code' node in terms of having variable number of input arguments and ability to choose result type. However it'll have the function name instead of the actual cg code. So there'll be an ability to call an arbitrary function and use it as a node.

In my opinion that will make SF-made shaders more flexible and feature-rich.

Let me know if you'll decide to implement this enhancement.

Thank you in advance. SF rocks :)