Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit e0c1f3f

Browse files
committed
shadows are more blue
1 parent cc164b9 commit e0c1f3f

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

assets/minecraft/shaders/include/light.glsl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ float getSun(sampler2D lightMap) {
2121
}
2222

2323
vec4 minecraft_sample_lightmap(sampler2D lightMap, ivec2 uv) {
24-
float sun = 1.0 - uv.y / 256.0 * getSun(lightMap);
24+
float sun = uv.y / 256.0 * getSun(lightMap);
25+
float torch = uv.x / 256.;
2526
vec4 light = texture(lightMap, clamp(uv / 256.0, vec2(0.8 / 16.0), vec2(15.5 / 16.0)));
26-
//x is torch, y is sun
27-
light *= mix(vec4(1.0), vec4(1.2, 0.9, 0.7, 1.0), uv.x / 256.0 * sun);
28-
light.rgb *= light.rgb/2. + 0.5;
27+
28+
//warmer blocklight
29+
light *= mix(vec4(1.0), vec4(1.7, 1.0, 0.4, 1.0), torch * (1.0-sun));
30+
31+
//darker shadows
32+
light *= mix(vec4(1.0), vec4(0.0, 0.1, 0.8, 1.0), max(1.0 - (torch + sun), 0.0));
33+
2934
return light;
3035
}

assets/minecraft/shaders/program/shading.fsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ void main() {
153153
fragColor.rgb *= ao;
154154

155155
// desaturate bright pixels for more realistic feel
156-
fragColor.rgb = mix(fragColor.rgb, vec3(length(fragColor.rgb)/sqrt(3.0)), luma(fragColor.rgb) * 0.3);
156+
fragColor.rgb = mix(fragColor.rgb, vec3(luma(fragColor.rgb)/sqrt(3.0)), luma(fragColor.rgb) * 0.3);
157157
}
158158
}

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ v++
22
2.5
33

44
Shaders:
5+
+Entities have overlays properly applied
56
+Water no longer disconnected at chunk borders
67
+Translucent blocks have fog properly applied
78
+Fog is cylindrical
89
+Cutout blocks have proper mipmapping alpha
10+
+Shadows are more blue
911

1012

1113

v++.zip

2.35 KB
Binary file not shown.

0 commit comments

Comments
 (0)