Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-07-09 03:31:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-07-09 03:31:45 +0400
commit3d847ed6e6e0a063d1676ad9c01bcc33b23b8ac4 (patch)
tree3f8f85537a97bd3d63ac6917f41cd1a645c61c6f /intern/cycles/render/buffers.cpp
parentb2b6d564431db71e1c9176ca541a0dd9e7f91168 (diff)
Fix #36064: cycles direct/indirect light passes with materials that have zero
RGB color components gave non-grey results when you might no expect it. What happens is that some of the color channels are zero in the direct light pass because their channel is zero in the color pass. The direct light pass is defined as lighting divided by the color pass, and we can't divide by zero. We do a division after all samples are added together to ensure that multiplication in the compositor gives the exact combined pass even with antialiasing, DoF, .. Found a simple tweak here, instead of setting such channels to zero it will set it to the average of other non-zero color channels, which makes the results look like the expected grey.
Diffstat (limited to 'intern/cycles/render/buffers.cpp')
-rw-r--r--intern/cycles/render/buffers.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index 572cfae45cd..b509134512b 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -223,7 +223,7 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int
float3 f = make_float3(in[0], in[1], in[2]);
float3 f_divide = make_float3(in_divide[0], in_divide[1], in_divide[2]);
- f = safe_divide_color(f*exposure, f_divide);
+ f = safe_divide_even_color(f*exposure, f_divide);
pixels[0] = f.x;
pixels[1] = f.y;