Skip to content

Commit

Permalink
fix upstream/leo60228#4
Browse files Browse the repository at this point in the history
[Fog multiplier calculation was hardcoded to 1;
1 works for water, but not lava(2) or powdered snow(3)]
  • Loading branch information
Iristallite committed Feb 6, 2023
1 parent 890a3b9 commit 56afa8f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shaders/gbuffers_basic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main()
vec4 col = color;

//Calculate fog intensity in or out of water.
float fog = (isEyeInWater>0) ? 1.-exp(-gl_FogFragCoord * gl_Fog.density):
float fog = (isEyeInWater>0) ? isEyeInWater.-exp(-gl_FogFragCoord * gl_Fog.density):
clamp((gl_FogFragCoord-gl_Fog.start) * gl_Fog.scale, 0., 1.);

//Apply the fog.
Expand Down
2 changes: 1 addition & 1 deletion shaders/gbuffers_clouds.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main()
vec4 col = color * texture2D(texture,coord0);

//Calculate fog intensity in or out of water.
float fog = (isEyeInWater>0) ? 1.-exp(-gl_FogFragCoord * gl_Fog.density):
float fog = (isEyeInWater>0) ? isEyeInWater.-exp(-gl_FogFragCoord * gl_Fog.density):
clamp((gl_FogFragCoord-gl_Fog.start) * gl_Fog.scale, 0., 1.);

//Apply the fog.
Expand Down
2 changes: 1 addition & 1 deletion shaders/gbuffers_damagedblock.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main()
vec4 col = texture2D(texture,coord0);

//Calculate fog intensity in or out of water.
float fog = (isEyeInWater>0) ? 1.-exp(-gl_FogFragCoord * gl_Fog.density):
float fog = (isEyeInWater>0) ? isEyeInWater.-exp(-gl_FogFragCoord * gl_Fog.density):
clamp((gl_FogFragCoord-gl_Fog.start) * gl_Fog.scale, 0., 1.);

//Apply the fog.
Expand Down
2 changes: 1 addition & 1 deletion shaders/gbuffers_textured.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void main()
col.rgb = mix(col.rgb,entityColor.rgb,entityColor.a);

//Calculate fog intensity in or out of water.
float fog = (isEyeInWater>0) ? 1.-exp(-gl_FogFragCoord * gl_Fog.density):
float fog = (isEyeInWater>0) ? isEyeInWater.-exp(-gl_FogFragCoord * gl_Fog.density):
clamp((gl_FogFragCoord-gl_Fog.start) * gl_Fog.scale, 0., 1.);

//Apply the fog.
Expand Down

0 comments on commit 56afa8f

Please sign in to comment.