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>2012-09-28 17:41:34 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-09-28 17:41:34 +0400
commit71195b247e34432196242b764301043cbef3a162 (patch)
tree07b45b6bf1c6d2d817b666a352e1d391dc46cdc5 /intern/cycles/render/buffers.cpp
parent1d2e59ba1c7cc3f823ad6e3916ebee28b4a069b1 (diff)
Fix #32072: cycles shadow pass gave different results with/without emitting
materials present, even though it's only taking lamp shadows into account.
Diffstat (limited to 'intern/cycles/render/buffers.cpp')
-rw-r--r--intern/cycles/render/buffers.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp
index 51568f65323..6f8740b8a51 100644
--- a/intern/cycles/render/buffers.cpp
+++ b/intern/cycles/render/buffers.cpp
@@ -196,7 +196,18 @@ bool RenderBuffers::get_pass_rect(PassType type, float exposure, int sample, int
else if(components == 3) {
assert(pass.components == 4);
- if(pass.divide_type != PASS_NONE) {
+ /* RGBA */
+ if(type == PASS_SHADOW) {
+ for(int i = 0; i < size; i++, in += pass_stride, pixels += 3) {
+ float4 f = make_float4(in[0], in[1], in[2], in[3]);
+ float invw = (f.w > 0.0f)? 1.0f/f.w: 1.0f;
+
+ pixels[0] = f.x*invw;
+ pixels[1] = f.y*invw;
+ pixels[2] = f.z*invw;
+ }
+ }
+ else if(pass.divide_type != PASS_NONE) {
/* RGB lighting passes that need to divide out color */
pass_offset = 0;
foreach(Pass& color_pass, params.passes) {