mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
parent
2f4fff264f
commit
f6a7a99a74
1 changed files with 10 additions and 6 deletions
|
|
@ -25,6 +25,7 @@ float calc_shadow(
|
|||
projCoords.z -= 0.00001 / u_shadowsRes + bias;
|
||||
|
||||
float shadow = 0.0;
|
||||
if (dot(realnormal, u_sunDir) < 0.0) {
|
||||
// 3x3 kernel
|
||||
for (int y = -1; y <= 1; y++) {
|
||||
for (int x = -1; x <= 1; x++) {
|
||||
|
|
@ -33,6 +34,9 @@ float calc_shadow(
|
|||
}
|
||||
}
|
||||
shadow /= 9.0;
|
||||
} else {
|
||||
shadow = 0.0;
|
||||
}
|
||||
return shadow;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue