This commit is contained in:
MihailRis 2025-06-10 22:50:04 +03:00
parent d030fbc3d5
commit 11283f9a33

View File

@ -5,7 +5,6 @@ uniform sampler2DShadow u_shadows[2];
uniform mat4 u_shadowsMatrix[2];
uniform int u_shadowsRes;
uniform bool u_blurShadows;
float calc_shadow() {
float shadow = 1.0;
@ -22,9 +21,9 @@ float calc_shadow() {
shadow = 0.0;
// TODO: optimize
if (dot(a_realnormal, u_sunDir) < 0.0) {
if (u_blurShadows || true) {
if (a_distance > 64) {
if (a_distance > 128) {
for (int y = -1; y <= 1; y++) {
for (int x = -1; x <= 1; x++) {
shadow += texture(
@ -49,13 +48,6 @@ float calc_shadow() {
}
shadow /= 25;
}
} else {
if (a_distance > 32.0) {
shadow = texture(u_shadows[1], wprojCoords.xyz);
} else {
shadow = texture(u_shadows[0], projCoords.xyz);
}
}
shadow = shadow * 0.5 + 0.5;
} else {
shadow = 0.5;