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:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-08-13 20:43:11 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-08-13 20:45:21 +0400
commitbe755f387336a0066baa0919b49e58ffc63607b1 (patch)
tree621d36f0c7577b150e4f825030677679a4be6a34 /source/blender
parentfc2b6a2b9d749c7a05c48ee2a423570eb3b9f3b6 (diff)
Fix T41408: Render layer pass bug, second attempt
Missed some passes in the previous commit. Now seems all the passes are covered, at least with my understanding of the things. There're some weird things going around with the refraction pass, but that is caused by some other issue in the code. Would rather call it a TODO for now.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/render/intern/source/shadeoutput.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 4c67a320dd0..5fdd615ed5d 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1706,9 +1706,19 @@ static void wrld_exposure_correct(float diff[3])
void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
{
+ /* Passes which might need to know material color.
+ *
+ * It seems to be faster to just calculate material color
+ * even if the pass doesn't really need it than tryign to
+ * figure out whether color is really needed or not.
+ */
+ const int color_passes =
+ SCE_PASS_COMBINED | SCE_PASS_RGBA | SCE_PASS_DIFFUSE | SCE_PASS_SPEC |
+ SCE_PASS_REFLECT | SCE_PASS_NORMAL | SCE_PASS_REFRACT | SCE_PASS_EMIT;
+
Material *ma= shi->mat;
int passflag= shi->passflag;
-
+
memset(shr, 0, sizeof(ShadeResult));
if (!(shi->mode & MA_TRANSP)) shi->alpha = 1.0f;
@@ -1723,7 +1733,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shi->refcol[0]= shi->refcol[1]= shi->refcol[2]= shi->refcol[3]= 0.0f;
/* material color itself */
- if (passflag & (SCE_PASS_COMBINED|SCE_PASS_RGBA|SCE_PASS_DIFFUSE|SCE_PASS_SPEC)) {
+ if (passflag & color_passes) {
if (ma->mode & (MA_FACETEXTURE)) {
shi->r= shi->vcol[0];
shi->g= shi->vcol[1];