Global Values Node


I’m not sure if something like this exists, otherwise it would be a nice (and imho) not too complex addition.

I currently experiment with OSL, which prevents me to use GPU rendering. So it would be nice if I had a node which offers global values, e.g. quality level, OSL enabled, … This node would be handy to make ‘branched’ shaders like ‘if OSL is enabled, use the OSL node, otherwise use diffuse shader’ or ‘if quality level is > 2 use diffuse/glossy, otherwise just use the diffuse branch’. This would allow faster previews.

If something like this is already possible, please tell me how. Otherwise, please let me know if you find this feature useful and where I can add a feature request :slight_smile:

Thanks, hob-B1T

OSL is enable in the render panel and as I know of not in the nodes editor!
so keep it enable all the time as a user preference and then nodes can be anything you want !

happy cl

I know this setting, but I would like to see it as input in the node system. If I switch from CPU to GPU rendering, all materials using OSL are rendered with ?a default shader? … I would like to switch to a different node setup dynamically, based on this switch.

In addition another switch would be very useful, which could be used to switch between a simple/fast and complex/slow node path. So I can tweak lighting with fast preview without manually change materials.

But I think about writing a python script to handle those things :slight_smile:

well there are the custom nodes that might be able to do that
but never work with it

so may be ask in python forum for an example for doing this

happy bl

Ok, thanx, I will forward this to the python section.
But independent to the question how to access this information, lets take a look to the node setup which I imagine: If ‘OSL’ is 0, the standard brick node is used, otherwise the brick OSL script. If ‘Quality’ is 0, the Glossy BSDF has no effect, as ‘Fac’ of last Mix Shader will be 0, so the Diffuse BSDF is used only. Does Cycles recognize the fact that in this case, the Glossy pass can be ignored and skips any calculations ? Same would be with ‘OSL’ = 0. The OSL script has no need to be calculated. Is Cycles intelligent enough to skip the path, as the result has no effect on the material output ?