show snow on grass

This commit is contained in:
2026-07-07 18:00:12 +02:00
parent 6da7021a58
commit 8ff14f3455
5 changed files with 58 additions and 18 deletions

View File

@@ -13,6 +13,8 @@ global uniform float global_snow_melt_speed = 0.1;
global uniform float global_snow_amount = 0.0;
global uniform vec4 global_snow_color;
global uniform float global_rain_intensity;
const float LEAVES_FULL_SNOW_START = 0.58;
const float LEAVES_FULL_SNOW_END = 0.86;
uniform sampler2D wind_noise : filter_linear_mipmap;
uniform bool billboard_enabled = true;
@@ -110,7 +112,7 @@ void fragment() {
float top_mask = 1.0 - shifted_uv.y;
float snow_mask = smoothstep(1.0 - snow_amount * 1.35, 1.08 - snow_amount * 1.35, top_mask) * snow_visibility;
snow_mask *= step(0.01, snow_amount);
float full_snow_mask = smoothstep(0.78, 1.0, snow_amount) * clamp(snow_visibility, 0.0, 1.0);
float full_snow_mask = smoothstep(LEAVES_FULL_SNOW_START, LEAVES_FULL_SNOW_END, snow_amount) * clamp(snow_visibility, 0.0, 1.0);
float final_snow_mask = max(snow_mask, full_snow_mask);
float snow_light = mix(0.82, 1.0, max(v_shade_factor, 0.35));