System Information
Win10, 8GB RAM, GTX 570
Blender Version
2.78c e92f235283
Short description of error
Related to 2c58e96685e8.
Cycles skips unnecessary mix (1 or 0 for Fac) and multiply node inputs of constant value (~1s render time: good):
However, when Fac or one of the multiply inputs is a variable, both inputs are calculated regardless if it should be skipped (~5s render time for identical result: bad):
In other words, despite the input value being 0 and the output being completely black, the render take the same time as it would with all the noise visible (~5s)
Noise stress-test (~5s):
Output (~5s):
Material was rendered on 10x10 plane at 50% 1080p, however it can drastically scale in performance decrease. Adding/fixing this optimization could drastically reduce render times depending on the complexity of a shader.



