mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 15:31:49 +00:00
cleanup
This commit is contained in:
parent
d030fbc3d5
commit
11283f9a33
1 changed files with 21 additions and 29 deletions
|
|
@ -5,7 +5,6 @@ uniform sampler2DShadow u_shadows[2];
|
||||||
uniform mat4 u_shadowsMatrix[2];
|
uniform mat4 u_shadowsMatrix[2];
|
||||||
|
|
||||||
uniform int u_shadowsRes;
|
uniform int u_shadowsRes;
|
||||||
uniform bool u_blurShadows;
|
|
||||||
|
|
||||||
float calc_shadow() {
|
float calc_shadow() {
|
||||||
float shadow = 1.0;
|
float shadow = 1.0;
|
||||||
|
|
@ -22,9 +21,9 @@ float calc_shadow() {
|
||||||
|
|
||||||
shadow = 0.0;
|
shadow = 0.0;
|
||||||
|
|
||||||
|
// TODO: optimize
|
||||||
if (dot(a_realnormal, u_sunDir) < 0.0) {
|
if (dot(a_realnormal, u_sunDir) < 0.0) {
|
||||||
if (u_blurShadows || true) {
|
if (a_distance > 128) {
|
||||||
if (a_distance > 64) {
|
|
||||||
for (int y = -1; y <= 1; y++) {
|
for (int y = -1; y <= 1; y++) {
|
||||||
for (int x = -1; x <= 1; x++) {
|
for (int x = -1; x <= 1; x++) {
|
||||||
shadow += texture(
|
shadow += texture(
|
||||||
|
|
@ -49,13 +48,6 @@ float calc_shadow() {
|
||||||
}
|
}
|
||||||
shadow /= 25;
|
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;
|
shadow = shadow * 0.5 + 0.5;
|
||||||
} else {
|
} else {
|
||||||
shadow = 0.5;
|
shadow = 0.5;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue