diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2016-09-29 00:35:53 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2016-10-01 14:37:03 +0300 |
commit | 40eedd5df9083ce54c38c6307946488a1fa8aae0 (patch) | |
tree | e3060fcab4e8ead3d6ec6c9254fddf5cf0b35aec /intern/cycles/render/constant_fold.h | |
parent | 95fa303efd0b6e2963af423e601bb2869ac82520 (diff) |
Cycles: implement partial constant folding for exponentiation.
This is also an important mathematical operation that can be folded
if it is known that one argument is a certain constant. For colors
the operation is provided as a Gamma node.
The SVM Gamma node needs a small fix to make it follow the 0 ^ 0 == 1
rule, same as the Power node, or the Gamma node itself in OSL mode.
Reviewers: #cycles
Differential Revision: https://developer.blender.org/D2263
Diffstat (limited to 'intern/cycles/render/constant_fold.h')
-rw-r--r-- | intern/cycles/render/constant_fold.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/intern/cycles/render/constant_fold.h b/intern/cycles/render/constant_fold.h index 2b31c2a5887..7962698319f 100644 --- a/intern/cycles/render/constant_fold.h +++ b/intern/cycles/render/constant_fold.h @@ -43,6 +43,7 @@ public: void make_constant_clamp(float value, bool clamp) const; void make_constant_clamp(float3 value, bool clamp) const; void make_zero() const; + void make_one() const; /* Bypass node, relinking to another output socket. */ void bypass(ShaderOutput *output) const; |