Skip to content

Commit ef257c0

Browse files
committed
shadowmap_pars_fragment: reverted to 21 taps code.
1 parent 2a7db73 commit ef257c0

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,31 @@
213213

214214
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )
215215

216-
vec2 offset = vec2( - 1, 1 ) * shadowRadius * 2.0 * texelSize.y;
216+
vec3 offset = vec3( - 1, 0, 1 ) * shadowRadius * 2.0 * texelSize.y;
217217

218218
return (
219+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzz, texelSize.y ), dp ) +
220+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxz, texelSize.y ), dp ) +
221+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxz, texelSize.y ), dp ) +
222+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzz, texelSize.y ), dp ) +
223+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzx, texelSize.y ), dp ) +
224+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxx, texelSize.y ), dp ) +
225+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
226+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzx, texelSize.y ), dp ) +
227+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zzy, texelSize.y ), dp ) +
228+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zxy, texelSize.y ), dp ) +
229+
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
230+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
231+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xzy, texelSize.y ), dp ) +
232+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zyz, texelSize.y ), dp ) +
233+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyz, texelSize.y ), dp ) +
234+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.zyx, texelSize.y ), dp ) +
219235
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
236+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yzz, texelSize.y ), dp ) +
237+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxz, texelSize.y ), dp ) +
220238
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) +
221-
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
222-
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp )
223-
) * ( 1.0 / 4.0 );
239+
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yzx, texelSize.y ), dp )
240+
) * ( 1.0 / 21.0 );
224241

225242
#else // no percentage-closer filtering
226243

0 commit comments

Comments
 (0)