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@gmail.com>2014-02-26 19:55:50 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-26 19:55:50 +0400
commit1dbd3ae6291349f044c6eaa9b87b8e686f476865 (patch)
treee2bd9345b55ddf89277d1eb6c37d136153649d45 /source/blender/render
parent4cfca0adfeeadccf0013aaeb8b34315b2d2a8e33 (diff)
Fix T38831: blender internal enabling shadow pass changes material node diffuse.
It would include/exclude shadow depending on the pass being disabled/enabled, but that should have no influence on the combined render result. Now it always includes shadow.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/extern/include/RE_shader_ext.h7
-rw-r--r--source/blender/render/intern/source/rayshade.c1
-rw-r--r--source/blender/render/intern/source/shadeinput.c4
-rw-r--r--source/blender/render/intern/source/shadeoutput.c8
-rw-r--r--source/blender/render/intern/source/strand.c4
-rw-r--r--source/blender/render/intern/source/volumetric.c1
6 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h
index 57e52a9316b..70e3edccb2c 100644
--- a/source/blender/render/extern/include/RE_shader_ext.h
+++ b/source/blender/render/extern/include/RE_shader_ext.h
@@ -50,9 +50,10 @@ typedef struct ShadeResult {
float col[4];
float alpha, mist, z;
float emit[3];
- float diff[3]; /* no ramps, shadow, etc */
- float spec[3];
- float shad[4]; /* shad[3] is shadow intensity */
+ float diff[3]; /* diffuse with no ramps, shadow, etc */
+ float diffshad[3]; /* diffuse with shadow */
+ float spec[3]; /* specular with shadow */
+ float shad[4]; /* shad[3] is shadow intensity */
float ao[3];
float env[3];
float indirect[3];
diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c
index 6807af0abc9..6dd2692f52e 100644
--- a/source/blender/render/intern/source/rayshade.c
+++ b/source/blender/render/intern/source/rayshade.c
@@ -563,6 +563,7 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
/* raytrace likes to separate the spec color */
sub_v3_v3v3(shr->diff, shr->combined, shr->spec);
+ copy_v3_v3(shr->diffshad, shr->diff);
}
}
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index bc9ba348c62..90e5def64f6 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -118,8 +118,10 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
madd_v3_v3fl(shr->combined, shr_t.combined, fac);
if (shi->passflag & SCE_PASS_SPEC)
madd_v3_v3fl(shr->spec, shr_t.spec, fac);
- if (shi->passflag & SCE_PASS_DIFFUSE)
+ if (shi->passflag & SCE_PASS_DIFFUSE) {
madd_v3_v3fl(shr->diff, shr_t.diff, fac);
+ madd_v3_v3fl(shr->diffshad, shr_t.diffshad, fac);
+ }
if (shi->passflag & SCE_PASS_SHADOW)
madd_v3_v3fl(shr->shad, shr_t.shad, fac);
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 6cb34a67f45..4f41f2729a1 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -937,6 +937,8 @@ void shade_color(ShadeInput *shi, ShadeResult *shr)
shr->diff[2] *= obcol[2];
if (shi->mode & MA_TRANSP) shr->alpha *= obcol[3];
}
+
+ copy_v3_v3(shr->diffshad, shr->diff);
}
/* ramp for at end of shade */
@@ -1874,9 +1876,11 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
}
if (shi->combinedflag & SCE_PASS_SHADOW)
- copy_v3_v3(shr->combined, shr->shad); /* note, no ';' ! */
+ copy_v3_v3(shr->diffshad, shr->shad); /* note, no ';' ! */
else
- copy_v3_v3(shr->combined, shr->diff);
+ copy_v3_v3(shr->diffshad, shr->diff);
+
+ copy_v3_v3(shr->combined, shr->diffshad);
/* calculate shadow pass, we use a multiplication mask */
/* if diff = 0,0,0 it doesn't matter what the shadow pass is, so leave it as is */
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index f2d4a7afd94..9a6a2b8ec9c 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -216,8 +216,10 @@ static void interpolate_shade_result(ShadeResult *shr1, ShadeResult *shr2, float
}
if (addpassflag & SCE_PASS_EMIT)
interpolate_vec3(shr1->emit, shr2->emit, t, negt, shr->emit);
- if (addpassflag & SCE_PASS_DIFFUSE)
+ if (addpassflag & SCE_PASS_DIFFUSE) {
interpolate_vec3(shr1->diff, shr2->diff, t, negt, shr->diff);
+ interpolate_vec3(shr1->diffshad, shr2->diffshad, t, negt, shr->diffshad);
+ }
if (addpassflag & SCE_PASS_SPEC)
interpolate_vec3(shr1->spec, shr2->spec, t, negt, shr->spec);
if (addpassflag & SCE_PASS_SHADOW)
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c
index 05d0eff311f..39950a1d417 100644
--- a/source/blender/render/intern/source/volumetric.c
+++ b/source/blender/render/intern/source/volumetric.c
@@ -748,6 +748,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in
shr->alpha = col[3];
copy_v3_v3(shr->diff, shr->combined);
+ copy_v3_v3(shr->diffshad, shr->diff);
}
/* Traces a shadow through the object,