This commit is contained in:
Михаил Капелько committed 2026-10-18 06:30:32 +03:00
1 parent b6b03eda2f
commit 6b70219fef
1 file changed
+8 -2
+8 -2
View File
@@ -140,13 +140,19 @@ static const char *SR_MAIN_FS =
"\n"
"out vec4 finalColor;\n"
"\n"
"bool isPixelInShadowMap(vec3 proj)\n"
"{\n"
" return proj.x >= 0.0 && proj.x <= 1.0 &&\n"
" proj.y >= 0.0 && proj.y <= 1.0 &&\n"
" proj.z >= 0.0 && proj.z <= 1.0;\n"
"}\n"
"\n"
"float shadowFactor()\n"
"{\n"
" vec3 proj = vLightClip.xyz / vLightClip.w;\n"
" proj = proj * 0.5 + 0.5;\n"
"\n"
" if (proj.z > 1.0 || proj.z < 0.0) return 0.0;\n"
" if (proj.x < 0.0 || proj.x > 1.0 || proj.y < 0.0 || proj.y > 1.0) return 0.0;\n"
" if (!isPixelInShadowMap(proj)) return 0.0;\n"
"\n"
" int radius = int(u_shadowSoftness);\n"
" vec2 texel = 1.0 / vec2(textureSize(u_shadowMap, 0));\n"