diff --git a/src/renderers/WebGLShaders.js b/src/renderers/WebGLShaders.js index 91462037226a0bf3bbb803932eaa31740fa06fc5..37d71a89c9d46d06d953dc82e7cc5901f2d5c6a7 100644 --- a/src/renderers/WebGLShaders.js +++ b/src/renderers/WebGLShaders.js @@ -586,6 +586,10 @@ THREE.ShaderChunk = { "for ( float x = -1.25; x <= 1.25; x += 1.25 ) {", "vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );", + + // doesn't seem to produce any noticeable visual difference compared to simple "texture2D" lookup + //"vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );", + "float fDepth = unpackDepth( rgbaDepth );", "if ( fDepth < ( shadowCoord.z + shadowBias ) )",