diff --git a/shaders/ogl46/mat_snow_windscreen.frag b/shaders/ogl46/mat_snow_windscreen.frag index bce56173d..d9624fa3d 100644 --- a/shaders/ogl46/mat_snow_windscreen.frag +++ b/shaders/ogl46/mat_snow_windscreen.frag @@ -280,9 +280,13 @@ void snLayer(vec2 span, float pixelUV, vec2 shift, uint salt, bool covers, inout vec2 local; if (false == snLocal(p, centre, size, vec2(1.0), rot, flip, aniso, local)) continue; + // thin wet icy snow lets some light (and the bent picture) through, a thick layer none + float deep = smoothstep(snow_cover * 3.0, snow_deep, q.x); int tile; + // the cover: slush while it's thin and wet; thick snow is packed snow however wet it is (the slush tile is translucent + // by itself, a glass covered with it never closes; the wet one is greyer by its tone) if (cover > 0.5) - tile = (wet > 0.35) ? 14 : 12 + int(kind * 2.0); // slush, packed snow + tile = ((wet > 0.35) && (deep < 0.5)) ? 14 : 12 + int(kind * 2.0); else if (wet > 0.2) tile = 8 + int(kind * 2.0); // wet lumps else if (size < 0.8) @@ -290,8 +294,6 @@ void snLayer(vec2 span, float pixelUV, vec2 shift, uint salt, bool covers, inout else tile = 10 + int(kind * 2.0); // clumps float thick = 1.0 - exp(-q.x / (snow_opaque * mix(1.0, 0.5, q.z))); - // thin wet icy snow lets some light (and the bent picture) through, a thick layer none - float deep = smoothstep(snow_cover * 3.0, snow_deep, q.x); float alpha = mix(mix(0.7, 0.9, thick), 1.0, deep); snSprite(local, min(tile, 14), alpha, snTone(q, random), rot, flip, snLod(pixelUV, size / max(perUV.x, perUV.y)), 1.0 - deep, acc); } diff --git a/shaders/ogl46/water_snow.comp b/shaders/ogl46/water_snow.comp index 251800ed1..313d67866 100644 --- a/shaders/ogl46/water_snow.comp +++ b/shaders/ogl46/water_snow.comp @@ -253,7 +253,8 @@ void main() float wet = state.y / (state.y + state.x * density + 1e-4); // the dry flakes bounce off a moving glass (powder is blown away), the wet ones (near zero) and those landing on wet snow or // water stay - float dry = (1.0 - smoothstep(0.1, 0.4, wet)) * (1.0 - smoothstep(-3.0, 0.0, water_up.w)); + // (only on a bare glass: a flake sticks to the snow already there) + float dry = (1.0 - smoothstep(0.1, 0.4, wet)) * (1.0 - smoothstep(-3.0, 0.0, water_up.w)) * (1.0 - smoothstep(0.05, 0.3, state.x)); float sticking = 1.0 - 0.4 * smoothstep(5.0, 25.0, speed) * dry; float landings = water_snow.x * SNOW_FALL_SHARE / max(water_air.w, 0.1) * facing * area * seconds * sticking; vec4 random = water_random(place, snow_slot, water_counts.x, 0x5e0du); diff --git a/shaders/vk14/mat_snow_windscreen.frag b/shaders/vk14/mat_snow_windscreen.frag index 648eed85f..3c72e913f 100644 --- a/shaders/vk14/mat_snow_windscreen.frag +++ b/shaders/vk14/mat_snow_windscreen.frag @@ -285,9 +285,13 @@ void snLayer(vec2 span, float pixelUV, vec2 shift, uint salt, bool covers, inout vec2 local; if (false == snLocal(p, centre, size, vec2(1.0), rot, flip, aniso, local)) continue; + // thin wet icy snow lets some light (and the bent picture) through, a thick layer none + float deep = smoothstep(snow_cover * 3.0, snow_deep, q.x); int tile; + // the cover: slush while it's thin and wet; thick snow is packed snow however wet it is (the slush tile is translucent + // by itself, a glass covered with it never closes; the wet one is greyer by its tone) if (cover > 0.5) - tile = (wet > 0.35) ? 14 : 12 + int(kind * 2.0); // slush, packed snow + tile = ((wet > 0.35) && (deep < 0.5)) ? 14 : 12 + int(kind * 2.0); else if (wet > 0.2) tile = 8 + int(kind * 2.0); // wet lumps else if (size < 0.8) @@ -295,8 +299,6 @@ void snLayer(vec2 span, float pixelUV, vec2 shift, uint salt, bool covers, inout else tile = 10 + int(kind * 2.0); // clumps float thick = 1.0 - exp(-q.x / (snow_opaque * mix(1.0, 0.5, q.z))); - // thin wet icy snow lets some light (and the bent picture) through, a thick layer none - float deep = smoothstep(snow_cover * 3.0, snow_deep, q.x); float alpha = mix(mix(0.7, 0.9, thick), 1.0, deep); snSprite(local, min(tile, 14), alpha, snTone(q, random), rot, flip, snLod(pixelUV, size / max(perUV.x, perUV.y)), 1.0 - deep, acc); } diff --git a/shaders/vk14/water_snow.comp b/shaders/vk14/water_snow.comp index fcafd5bc5..52345a264 100644 --- a/shaders/vk14/water_snow.comp +++ b/shaders/vk14/water_snow.comp @@ -256,7 +256,8 @@ void main() float wet = state.y / (state.y + state.x * density + 1e-4); // the dry flakes bounce off a moving glass (powder is blown away), the wet ones (near zero) and those landing on wet snow or // water stay - float dry = (1.0 - smoothstep(0.1, 0.4, wet)) * (1.0 - smoothstep(-3.0, 0.0, water_up.w)); + // (only on a bare glass: a flake sticks to the snow already there) + float dry = (1.0 - smoothstep(0.1, 0.4, wet)) * (1.0 - smoothstep(-3.0, 0.0, water_up.w)) * (1.0 - smoothstep(0.05, 0.3, state.x)); float sticking = 1.0 - 0.4 * smoothstep(5.0, 25.0, speed) * dry; float landings = water_snow.x * SNOW_FALL_SHARE / max(water_air.w, 0.1) * facing * area * seconds * sticking; vec4 random = water_random(place, snow_slot, water_counts.x, 0x5e0du);