improve snow

This commit is contained in:
2026-06-06 18:35:50 +02:00
parent 326d32c946
commit 9579f26a63
23 changed files with 168 additions and 69 deletions

View File

@@ -7,6 +7,7 @@ global uniform float global_snow_melt_time = -1.0;
global uniform float global_snow_melt_speed = 0.1;
global uniform float global_snow_amount = 0.0;
global uniform vec4 global_snow_color = vec4(0.92, 0.96, 1.0, 1.0);
const float SNOW_VISUAL_RESPONSE = 0.55;
uniform float max_height : hint_range(0.02, 1.0) = 0.2;
uniform float half_width : hint_range(0.01, 20.0) = 1.0;
@@ -68,10 +69,14 @@ float get_snow_amount() {
return snow_amount;
}
float get_visual_snow_amount(float snow_amount) {
return pow(clamp(snow_amount, 0.0, 1.0), SNOW_VISUAL_RESPONSE);
}
void vertex() {
vec3 base_vertex = VERTEX;
vec3 world_pos = (MODEL_MATRIX * vec4(base_vertex, 1.0)).xyz;
float snow_amount = get_snow_amount();
float snow_amount = get_visual_snow_amount(get_snow_amount());
float noise_val = fbm(world_pos.xz * noise_scale);
float thickness = max_height * snow_amount * mix(
1.0 - noise_strength,