It should be possible to incorporate stuff from custom ".cginc" includes in code blocks.
turbulence(p, octaves)
while still keeping the rapid prototyping of Shader Forge.Answer
It would be even more awesome if someday in the future Shader Forge could also be used to create the .cginc file. For example, creating a file with the custom lighting that would be used instead of Phong, Blinn-Phong, etc. in future shaders. And it would be awesome if a group of nodes could be saved so they could be re-used. (I am assuming the group would be stored as a .cginc file.)
my Addition to that topic would be the following possible solution:
A node that reads a ".cginc" file and presents a dropdown to import a specific function. The node should generate the input vars from the function definition and the rest can act like the code-node!?
I also would like to have this. There are some cases where this would be great:
1) If you have multiple shaders that use a large amount of the exact same code.
2) If you need to import a lot of code from one of Unity's builtin .cginc files
3) You want to split up your shader into individually editable parts.
One thing that would be nice is if there was an option in "Lighting", next to "Custom Lighting", called "cginc". Selecting this mode would disable the Main node entirely., and instead your shader will simply be written to a cginc file. This would make it easier to create cginc files with shader forge. Basically it would simply save all your code nodes, and any of your global variables and stuff, to the cginc file, and it would not create a shader (no frag or vert functions).
This is now supported in Shader Forge 1.36 :)
Apologies for the delay on this one!
Customer support service by UserEcho
This is now supported in Shader Forge 1.36 :)
Apologies for the delay on this one!