+6
Under review

Static Switch

vincent 11 років тому оновлено brum 8 років тому 10
Hi, is there a Static Switch node planned? (If you know the node from the UDK I'm sorry for the next explanation )It Is use full when you got something of a bigger shader and you don't want  to always use the whole functionality, lets say I have a hair shader and  for some characters I use a kind of wind simulation(Vertex movement)  It would let me switch it off or on in the material.
I don't even know if it is preferable. It would just save me the time to maintain 2 different shaders. Esspecially when there is a really big shader like an ocean shader with different wave types.

Відповідь

Відповідь
Planned
It's planned, but as a post-release update :)
Відповідь
Planned
It's planned, but as a post-release update :)
Hello, Is this feature still planned?
It would be great to have 'uber shader' and turn off functions that don't need to be calculated.
Under review
Unfortunately, no. It has too many implications that would require a *huge* rewrite of the shader compiler, I'm afraid :(
Sorry to hear that, but not a big deal, still a great tool :). cheers
Couldn't this still be implemented but just with a "hidden" Slider? I've been doing exactly that where I use a 0-1 Slider connected to a Lerp. I remap the output of the slider where 0-0.5 = 0 and 0.5-1 = 1 before going to the Lerp so it's effectively a boolean switch.

That gives the same result as the OT, but it still leaves all the calculations in the shader code, basically calculating the "other branch" for nothing.


I also like the feature of having compile-time switches to just disable certain shader features for different materials.

It is not possible to have multiple switch with the same variable like in U4?
I would like to use the same switch exposed to make different logics on the shader.


Is the static switch that remove the calculations of the disabled branch not planned any more?

Currently not I'm afraid, as mentioned above

Is there any chance/way to expose the "Blend mode" of a shader (from the shaderforge shader editor window) into the actual compiled shader? I feel it's kind of redundant having to create 3 versions of a particle the shader for additive/multiply/alphablended versions.