diff options
author | Thomas Dinges <blender@dingto.org> | 2015-12-22 15:53:13 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-12-22 15:53:13 +0300 |
commit | 377b52be2ea5fad2e4438415226ae062c04cf8d8 (patch) | |
tree | 75392da746c82d6f5635f6fd6746be51cd60d540 /intern/cycles/kernel/svm/svm_math_util.h | |
parent | ba82981a2fee5e11ef38ac8fe367cb255585235e (diff) |
Cycles: Constant fold for the Gamma Node.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_math_util.h')
-rw-r--r-- | intern/cycles/kernel/svm/svm_math_util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/kernel/svm/svm_math_util.h b/intern/cycles/kernel/svm/svm_math_util.h index 645cbd3fc73..3f7d18a02fe 100644 --- a/intern/cycles/kernel/svm/svm_math_util.h +++ b/intern/cycles/kernel/svm/svm_math_util.h @@ -166,5 +166,17 @@ ccl_device float3 svm_math_blackbody_color(float t) { return make_float3(4.70366907f, 0.0f, 0.0f); } +ccl_device_inline float3 svm_math_gamma_color(float3 color, float gamma) +{ + if(color.x > 0.0f) + color.x = powf(color.x, gamma); + if(color.y > 0.0f) + color.y = powf(color.y, gamma); + if(color.z > 0.0f) + color.z = powf(color.z, gamma); + + return color; +} + CCL_NAMESPACE_END |