From d4cd51b43bb2ae695050b2d298bbbbc499164d04 Mon Sep 17 00:00:00 2001 From: Thorsten Renk Date: Mon, 17 Sep 2018 11:21:35 +0300 Subject: [PATCH] ALS: Improve snow rendering of procedural rock shader --- Shaders/rock-ALS.frag | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Shaders/rock-ALS.frag b/Shaders/rock-ALS.frag index ad2befdfa..170e1bbb5 100644 --- a/Shaders/rock-ALS.frag +++ b/Shaders/rock-ALS.frag @@ -378,8 +378,11 @@ texel = mix(texel, dust_color, clamp(0.5 * dust_cover_factor *dust_resistance + float snow_mix_factor = 0.0; if (msl_altitude +500.0 > snowlevel) { - snow_alpha = max(1.0,smoothstep(0.75, 0.85, abs(steepness)) +crack_factor); - snow_mix_factor = snow_texel.a* smoothstep(snowlevel, snowlevel+200.0, snow_alpha * msl_altitude+ (noise_2000m + 0.1 * noise_10m -0.55) *400.0); + + snow_alpha = smoothstep(0.65, 0.85, abs(steepness)); + snow_alpha += (1.0 - snow_alpha) * crack_factor; + + snow_mix_factor = snow_texel.a* smoothstep(snowlevel, snowlevel+200.0, snow_alpha * msl_altitude + (noise_2000m + 0.1 * noise_10m -0.55) *400.0); texel = mix(texel, snow_texel, snow_mix_factor); }