1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Spacing fixes

This commit is contained in:
ShadowNinja 2021-12-01 18:54:12 -05:00 committed by rubenwardy
parent 88b21a72f1
commit 7993909fab
31 changed files with 82 additions and 83 deletions

View file

@ -557,6 +557,6 @@ void main(void)
- fogShadingParameter * length(eyeVec) / fogDistance, 0.0, 1.0);
col = mix(skyBgColor, col, clarity);
col = vec4(col.rgb, base.a);
gl_FragColor = col;
}

View file

@ -199,13 +199,13 @@ void main(void)
vec3 nNormal = normalize(vNormal);
cosLight = dot(nNormal, -v_LightDirection);
// Calculate normal offset scale based on the texel size adjusted for
// Calculate normal offset scale based on the texel size adjusted for
// curvature of the SM texture. This code must be change together with
// getPerspectiveFactor or any light-space transformation.
vec3 eyeToVertex = worldPosition - eyePosition + cameraOffset;
// Distance from the vertex to the player
float distanceToPlayer = length(eyeToVertex - v_LightDirection * dot(eyeToVertex, v_LightDirection)) / f_shadowfar;
// perspective factor estimation according to the
// perspective factor estimation according to the
float perspectiveFactor = distanceToPlayer * xyPerspectiveBias0 + xyPerspectiveBias1;
float texelSize = f_shadowfar * perspectiveFactor * perspectiveFactor /
(f_textureresolution * xyPerspectiveBias1 - perspectiveFactor * xyPerspectiveBias0);