1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Minor changes

This commit is contained in:
Gefüllte Taubenbrust 2024-08-18 16:11:30 +02:00
parent e6752008e0
commit e5afca89f7
8 changed files with 50 additions and 2 deletions

View file

@ -137,10 +137,15 @@ void main(void)
float bottomPlaneIntersect = clamp((cloudHeight - cameraPosition.y) / viewVec.y, 0., 4. * fogDistance);
float topPlaneIntersect = clamp((cloudHeight + cloudThickness - cameraPosition.y) / viewVec.y, 0., 4. * fogDistance);
#if (VOLUMETRICS_UNDERSAMPLING <= 1)
bottomPlaneIntersect = min(depth, bottomPlaneIntersect);
topPlaneIntersect = min(depth, topPlaneIntersect);
#else
if ((bottomPlaneIntersect > depth + 5.0) != (topPlaneIntersect > depth + 5.0)) {
bottomPlaneIntersect = min(depth, bottomPlaneIntersect);
topPlaneIntersect = min(depth, topPlaneIntersect);
}
#endif
float startDepth = min(bottomPlaneIntersect, topPlaneIntersect);
float endDepth = max(bottomPlaneIntersect, topPlaneIntersect);