Skip to content

Commit

Permalink
Make edges of shadows a bit sharper (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
depressed-pho committed Dec 26, 2018
1 parent 1536c44 commit 166bd83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shaders/glsl/natural-mystic-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,16 @@ vec3 applyShadow(vec3 frag, float torchLevel, float sunLevel, float daylight, fl
const vec3 shadowColor = vec3(0.0);
const float minShadow = 0.0; // [0, 1]
const float maxShadow = 0.45; // [0, 1]
const float blur = 0.003; // The higher the more blur.
const float torchLightCutOff = 0.1; // [0, 1]

/* The less the sunlight level is, the darker the fragment will
* be. */
float density = mix(maxShadow, minShadow,
smoothstep(0.865, 0.875, sunLevel));
smoothstep(
0.870 - blur,
0.870 + blur,
sunLevel));

if (density > 0.0) {
/* The existence of torch light should negate the effect of
Expand Down

0 comments on commit 166bd83

Please sign in to comment.