add snow coverage to tea material

This commit is contained in:
2026-06-07 18:01:47 +02:00
parent b602e3b521
commit 5c807d7b69
11 changed files with 52 additions and 39 deletions

View File

@@ -33,7 +33,8 @@ uniform vec4 variance_color : source_color = vec4(0.3, 0.5, 0.2, 1.0); // Colore
uniform float variance_intensity : hint_range(0.0, 1.0) = 0.4; // Quanto si vedono le chiazze
uniform vec4 snow_color : source_color = vec4(0.85, 0.9, 0.95, 1.0);
uniform float snow_visibility : hint_range(0.0, 1.0) = 1.0;
uniform float snow_visibility : hint_range(0.0, 3.0) = 1.0;
uniform float snow_coverage : hint_range(0.05, 1.0) = 0.35;
// --- CONTROLLO GRADIENTE E RANDOM ---
uniform float height_min = 0.0;
@@ -135,8 +136,10 @@ void fragment() {
float snow_amount = smoothstep(0.0, 1.0, get_snow_progress());
float top_mask = 1.0 - shifted_uv.y;
float snow_mask = smoothstep(0.65, 1.0, top_mask) * snow_amount * snow_visibility;
float snow_start = 1.0 - clamp(snow_coverage, 0.05, 1.0);
float snow_mask = smoothstep(snow_start, 1.0, top_mask) * snow_amount * snow_visibility;
snow_mask *= step(0.01, snow_amount);
snow_mask = clamp(snow_mask, 0.0, 1.0);
vec3 dark_snow = snow_color.rgb * (1.0 - shadow_intensity);
vec3 shaded_snow = mix(dark_snow, snow_color.rgb, v_shade_factor);