Better snow cover

This commit is contained in:
Joshua Barretto
2022-05-15 15:34:36 +01:00
parent ecf97a53cd
commit cc295b483a
5 changed files with 37 additions and 16 deletions

View File

@ -192,7 +192,7 @@ void main() {
reflect_color *= f_light;
// Prevent the sky affecting light when underground
float not_underground = clamp((f_pos.z - f_alt) / 128.0 + 1.0, 0.0, 1.0);
float not_underground = clamp((f_pos.z - f_alt) / 32.0 + 1.0, 0.0, 1.0);
reflect_color *= not_underground;
// /*const */vec3 water_color = srgb_to_linear(vec3(0.2, 0.5, 1.0));
// /*const */vec3 water_color = srgb_to_linear(vec3(0.8, 0.9, 1.0));

View File

@ -51,7 +51,7 @@ void main() {
f_norm = v_norm;
f_col = vec4(vec3(inst_col) * (1.0 / 255.0) * v_col * (hash(inst_pos.xyxy) * 0.35 + 0.65), 1.0);
if ((inst_flags & FLAG_SNOW_COVERED) > 0u) {
if ((inst_flags & FLAG_SNOW_COVERED) > 0u && f_norm.z > 0.0) {
snow_cover = 1.0;
} else {
snow_cover = 0.0;