Changed the handling of the ambient contribution of light to avoid lighting errors in the shadowed region outside a spointlight.
This commit is contained in:
@@ -55,8 +55,8 @@ StandardShadowMap::StandardShadowMap():
|
||||
"void main(void) \n"
|
||||
"{ \n"
|
||||
" vec4 colorAmbientEmissive = gl_FrontLightModelProduct.sceneColor; \n"
|
||||
" // Add ambient from Light of index = 0 \n"
|
||||
" colorAmbientEmissive += gl_FrontLightProduct[0].ambient; \n"
|
||||
// " // Add ambient from Light of index = 0 \n"
|
||||
// " colorAmbientEmissive += gl_FrontLightProduct[0].ambient; \n"
|
||||
" vec4 color = texture2D( baseTexture, gl_TexCoord[0].xy ); \n"
|
||||
" color *= mix( colorAmbientEmissive, gl_Color, DynamicShadow() ); \n"
|
||||
#if DISPLAY_SHADOW_TEXEL_TO_PIXEL_ERROR
|
||||
@@ -325,7 +325,7 @@ StandardShadowMap::StandardShadowMap():
|
||||
" gl_FrontColor = colorAmbientEmissive + \n"
|
||||
" diff * gl_FrontMaterial.diffuse; \n"
|
||||
" \n"
|
||||
" gl_FrontSecondaryColor = vec4(spec*gl_FrontMaterial.specular); \n"
|
||||
" gl_FrontSecondaryColor = vec4(spec*gl_FrontMaterial.specular); \n"
|
||||
" \n"
|
||||
" gl_BackColor = gl_FrontColor; \n"
|
||||
" gl_BackSecondaryColor = gl_FrontSecondaryColor; \n"
|
||||
|
||||
Reference in New Issue
Block a user