Skip to content

Commit

Permalink
shadows are more blue
Browse files Browse the repository at this point in the history
  • Loading branch information
Godlander committed Dec 26, 2021
1 parent cc164b9 commit e0c1f3f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
13 changes: 9 additions & 4 deletions assets/minecraft/shaders/include/light.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ float getSun(sampler2D lightMap) {
}

vec4 minecraft_sample_lightmap(sampler2D lightMap, ivec2 uv) {
float sun = 1.0 - uv.y / 256.0 * getSun(lightMap);
float sun = uv.y / 256.0 * getSun(lightMap);
float torch = uv.x / 256.;
vec4 light = texture(lightMap, clamp(uv / 256.0, vec2(0.8 / 16.0), vec2(15.5 / 16.0)));
//x is torch, y is sun
light *= mix(vec4(1.0), vec4(1.2, 0.9, 0.7, 1.0), uv.x / 256.0 * sun);
light.rgb *= light.rgb/2. + 0.5;

//warmer blocklight
light *= mix(vec4(1.0), vec4(1.7, 1.0, 0.4, 1.0), torch * (1.0-sun));

//darker shadows
light *= mix(vec4(1.0), vec4(0.0, 0.1, 0.8, 1.0), max(1.0 - (torch + sun), 0.0));

return light;
}
2 changes: 1 addition & 1 deletion assets/minecraft/shaders/program/shading.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ void main() {
fragColor.rgb *= ao;

// desaturate bright pixels for more realistic feel
fragColor.rgb = mix(fragColor.rgb, vec3(length(fragColor.rgb)/sqrt(3.0)), luma(fragColor.rgb) * 0.3);
fragColor.rgb = mix(fragColor.rgb, vec3(luma(fragColor.rgb)/sqrt(3.0)), luma(fragColor.rgb) * 0.3);
}
}
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ v++
2.5

Shaders:
+Entities have overlays properly applied
+Water no longer disconnected at chunk borders
+Translucent blocks have fog properly applied
+Fog is cylindrical
+Cutout blocks have proper mipmapping alpha
+Shadows are more blue



Expand Down
Binary file modified v++.zip
Binary file not shown.

0 comments on commit e0c1f3f

Please sign in to comment.