Page MenuHome

GLSL Lamp with OnlyShadow makes weird colors in object.
Closed, ResolvedPublic

Description

Now, I have nVidia, but I remember the same problem with an ATI.

Look at the screenshot or open the file.

Event Timeline

Mario Mey (mariomey) raised the priority of this task from to 90.
Mario Mey (mariomey) updated the task description. (Show Details)
Mario Mey (mariomey) edited a custom field.

With "Only Shadows" off.

Sorry, this is the screenshot with "Only Shadows" off.

“Only Shadow” is a rather advanced option, not sure whether we consider it supported or not with our current GLSL code?

Bastien Montagne (mont29) lowered the priority of this task from 90 to Normal.May 10 2014, 8:33 AM
Shinsuke Irie (irie) edited this Maniphest Task.May 30 2014, 10:21 AM
Shinsuke Irie (irie) changed the task status from Unknown Status to Resolved.May 30 2014, 10:22 AM

Closed by commit rB8008d9bdfd57.

Shinsuke Irie (irie) renamed this task from Lamp with OnlyShadow makes weird colors in object. to GLSL Lamp with OnlyShadow makes weird colors in object..May 30 2014, 10:23 AM

BTW, I noticed the only shadow lamp seems to be not working correctly in Blender Render.
If "Only Shadow" is enabled, disabling "Specular" option takes no effect.

@Sergey Sharybin (sergey) @Brecht Van Lommel (brecht), do you think it's an actual bug?

Here is a fix for the glitch:

diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index cc781c8..ebf88ef 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -1466,9 +1466,11 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
                                                shr->shad[1] -= shadfac[3]*shi->g*(1.0f-lashdw[1]);
                                                shr->shad[2] -= shadfac[3]*shi->b*(1.0f-lashdw[2]);
                                                
-                                               shr->spec[0] -= shadfac[3]*shi->specr*(1.0f-lashdw[0]);
-                                               shr->spec[1] -= shadfac[3]*shi->specg*(1.0f-lashdw[1]);
-                                               shr->spec[2] -= shadfac[3]*shi->specb*(1.0f-lashdw[2]);
+                                               if (!(lar->mode & LA_NO_SPEC)) {
+                                                       shr->spec[0] -= shadfac[3]*shi->specr*(1.0f-lashdw[0]);
+                                                       shr->spec[1] -= shadfac[3]*shi->specg*(1.0f-lashdw[1]);
+                                                       shr->spec[2] -= shadfac[3]*shi->specb*(1.0f-lashdw[2]);
+                                               }
                                                
                                                return;
                                        }