mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Fix missing shadows when sun tilt is zero
This commit is contained in:
@@ -146,7 +146,7 @@ void main(void)
|
||||
float pFactor = getPerspectiveFactor(getRelativePosition(m_ShadowViewProj * mWorld * inVertexPosition));
|
||||
if (f_normal_length > 0.0) {
|
||||
nNormal = normalize(vNormal);
|
||||
cosLight = dot(nNormal, -v_LightDirection);
|
||||
cosLight = max(1e-5, dot(nNormal, -v_LightDirection));
|
||||
float sinLight = pow(1 - pow(cosLight, 2.0), 0.5);
|
||||
normalOffsetScale = 0.1 * pFactor * pFactor * sinLight * min(f_shadowfar, 500.0) /
|
||||
xyPerspectiveBias1 / f_textureresolution;
|
||||
|
Reference in New Issue
Block a user