add max distance for biome effects. make border fog cylindrical. Fix compile error on optifine.

This commit is contained in:
Xonk
2024-02-12 00:49:20 -05:00
parent 69dae189b1
commit b91c1f796f
9 changed files with 119 additions and 67 deletions

View File

@ -248,6 +248,7 @@ void main() {
vec3 np3 = normVec(p3);
float linearDistance = length(p3);
float linearDistance_cylinder = length(p3.xz);
float lightleakfix = clamp(pow(eyeBrightnessSmooth.y/240.,2) ,0.0,1.0);
float lightleakfixfast = clamp(eyeBrightness.y/240.,0.0,1.0);
@ -292,9 +293,9 @@ void main() {
#if defined BorderFog
#ifdef DISTANT_HORIZONS
float fog = 1.0 - pow(1.0-pow(1.0-min(max(1.0 - linearDistance / dhFarPlane,0.0)*3.0,1.0),2.0),2.0);
float fog = 1.0 - pow(1.0-pow(1.0-min(max(1.0 - linearDistance_cylinder / dhFarPlane,0.0)*3.0,1.0),2.0),2.0);
#else
float fog = 1.0 - pow(1.0-pow(1.0-min(max(1.0 - linearDistance / far,0.0)*5.0,1.0),2.0),2.0);
float fog = 1.0 - pow(1.0-pow(1.0-min(max(1.0 - linearDistance_cylinder / far,0.0)*5.0,1.0),2.0),2.0);
#endif
fog *= exp(-10.0 * pow(clamp(np3.y,0.0,1.0)*4.0,2.0));