Skip to content

Commit

Permalink
Add smooth light-shadow transition at noon (#11430)
Browse files Browse the repository at this point in the history
Node faces with normals pointing East/West (+X/-X) will transition between light
and shadow at noon. This code makes the transition smooth.
  • Loading branch information
x2048 committed Jul 25, 2021
1 parent 5d27cc5 commit ff2d2a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/shaders/nodes_shader/opengl_fragment.glsl
Expand Up @@ -498,8 +498,8 @@ void main(void)

}

if (f_normal_length != 0 && cosLight < 0.0) {
shadow_int = clamp(1.0-nightRatio, 0.0, 1.0);
if (f_normal_length != 0 && cosLight < 0.035) {
shadow_int = max(shadow_int, min(clamp(1.0-nightRatio, 0.0, 1.0), 1 - clamp(cosLight, 0.0, 0.035)/0.035));
}

shadow_int = 1.0 - (shadow_int * f_adj_shadow_strength);
Expand Down

0 comments on commit ff2d2a6

Please sign in to comment.