diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-28 16:18:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-28 16:18:12 +0400 |
commit | e12adeb8c98d0ef211aba2cb5c0e87ff775fe217 (patch) | |
tree | 3a4381971596645f55401490e19a3672b28745ec /intern/cycles/util | |
parent | ed61bfc9a6580360805a3daae1003df43a7f2c11 (diff) |
Fix #30551: cycles passes combining did not always give identical result combined
with antialiasing/defocus, now divide out color at the very end instead of for each
sample.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r-- | intern/cycles/util/util_math.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h index 0a1d8ff4555..51dbde3e28b 100644 --- a/intern/cycles/util/util_math.h +++ b/intern/cycles/util/util_math.h @@ -799,6 +799,19 @@ __device_inline void make_orthonormals(const float3 N, float3 *a, float3 *b) *b = cross(N, *a); } +/* Color division */ + +__device_inline float3 safe_divide_color(float3 a, float3 b) +{ + float x, y, z; + + x = (b.x != 0.0f)? a.x/b.x: 0.0f; + y = (b.y != 0.0f)? a.y/b.y: 0.0f; + z = (b.z != 0.0f)? a.z/b.z: 0.0f; + + return make_float3(x, y, z); +} + CCL_NAMESPACE_END #endif /* __UTIL_MATH_H__ */ |