Skip to content

Commit

Permalink
Minor changes to cloud lighting to help blending
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Jul 20, 2023
1 parent fa594b4 commit a2da746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/resources/assets/minecraft/shaders/core/clouds.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

uniform mat4 ProjMat;
uniform vec4 ColorModulator;
uniform vec4 FogColor;
uniform float FogStart;
uniform float FogEnd;

Expand All @@ -22,7 +23,7 @@ void main() {

float width = FogEnd - FogStart;
float newWidth = width * 4.0;
float fade = linear_fog_fade(vertexDistance, FogStart, FogStart + newWidth);
fragColor = vec4(color.rgb, color.a * fade);
float fade = linear_fog_fade(vertexDistance, FogStart, FogStart + newWidth) * FogColor.a;
fragColor = vec4(mix(FogColor.rgb, color.rgb, 0.7), clamp(color.a * fade, 0.0, 1.0));
}

3 changes: 2 additions & 1 deletion src/main/resources/assets/minecraft/shaders/core/clouds.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
{ "name": "ProjMat", "type": "matrix4x4", "count": 16, "values": [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ] },
{ "name": "ColorModulator", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] },
{ "name": "FogStart", "type": "float", "count": 1, "values": [ 0.0 ] },
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] }
{ "name": "FogEnd", "type": "float", "count": 1, "values": [ 1.0 ] },
{ "name": "FogColor", "type": "float", "count": 4, "values": [ 1.0, 1.0, 1.0, 1.0 ] }
]
}

0 comments on commit a2da746

Please sign in to comment.