I want to store some codes in a function that update some of my variable that can be called from main function,i turned on shaderdeveloopment in coonfiguration but it didnt give much information
float3 tex;
float rh=1;
float prh;
float th;
float pth;
float ri=0;
float hs;
float ph;
float uvd;
That sounds too hard for me,I just inlined the function manually,also my function is to update variable inside my custom node,can this do that?thanks for the information.
Sorry for necroposting, but…
Yes! You actually can declare multiple functions in a Custom Material Node!
I stumbled on this a few months ago looking for the same information.
For anyone that’s having trouble with this in 5.1, saying that the inner functions don’t have access to variables. You can pass in the variables like this: