Update leenkx/Shaders/std/shadows.glsl

This commit is contained in:
2025-05-21 01:05:37 +00:00
parent 27b4ec42a8
commit bd5afc797d

View File

@ -236,12 +236,14 @@ vec3 PCFFakeCube(sampler2DShadow shadowMap, sampler2D shadowMapTransparent, cons
#endif #endif
result.x += texture(shadowMap, vec3(uvtiled, compare)); result.x += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(-1.0, 1.0) / smSize))); #ifdef _ShadowMapTransparent
pointLightTile = pointLightDataArray[lightIndex + newFaceIndex]; if (transparent == false) {
uvtiled = pointLightTile.z * uvtiled + pointLightTile.xy; vec4 shadowmap_transparent = texture(shadowMapTransparent, uvtiled);
#ifdef _FlipY if (shadowmap_transparent.a < compare)
uvtiled.y = 1.0 - uvtiled.y; // invert Y coordinates for direct3d coordinate system result *= shadowmap_transparent.rgb;
}
#endif #endif
result.x += texture(shadowMap, vec3(uvtiled, compare)); result.x += texture(shadowMap, vec3(uvtiled, compare));
uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(0.0, -1.0) / smSize))); uvtiled = transformOffsetedUV(faceIndex, newFaceIndex, vec2(uv + (vec2(0.0, -1.0) / smSize)));