feat: add witnessed knowledge and wind ambience
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
shader_type spatial;
|
||||
render_mode blend_mix, depth_draw_opaque, cull_back, diffuse_burley, specular_schlick_ggx;
|
||||
|
||||
uniform float wind_strength : hint_range(0.0, 0.5) = 0.08;
|
||||
uniform float wind_speed : hint_range(0.0, 5.0) = 0.6;
|
||||
uniform vec2 wind_direction = vec2(0.94, 0.34);
|
||||
uniform float wind_strength : hint_range(0.0, 0.2) = 0.07;
|
||||
uniform float wind_speed : hint_range(0.0, 2.0) = 0.55;
|
||||
uniform float gust_speed : hint_range(0.0, 1.0) = 0.12;
|
||||
uniform float gust_strength : hint_range(0.0, 0.8) = 0.35;
|
||||
uniform float flutter_strength : hint_range(0.0, 0.05) = 0.012;
|
||||
uniform float wind_phase : hint_range(0.0, 6.2832) = 0.0;
|
||||
uniform vec3 albedo : source_color = vec3(0.19, 0.38, 0.17);
|
||||
uniform float roughness : hint_range(0.0, 1.0) = 0.9;
|
||||
|
||||
@@ -11,11 +16,16 @@ void vertex() {
|
||||
float height_factor = clamp((VERTEX.y + half_height) / (half_height * 2.0), 0.0, 1.0);
|
||||
height_factor = height_factor * height_factor;
|
||||
|
||||
float sway_x = sin(VERTEX.x * 0.3 + TIME * wind_speed) * wind_strength * height_factor;
|
||||
float sway_z = cos(VERTEX.z * 0.3 + TIME * wind_speed * 0.7) * wind_strength * height_factor;
|
||||
vec2 direction = normalize(wind_direction);
|
||||
vec2 crosswind = vec2(-direction.y, direction.x);
|
||||
float world_phase = wind_phase + dot(MODEL_MATRIX[3].xz, vec2(0.07, 0.05));
|
||||
float gust_wave = 0.5 + 0.5 * sin(TIME * gust_speed + world_phase * 0.7);
|
||||
float gust = mix(1.0 - gust_strength, 1.0, gust_wave);
|
||||
float bend = sin(TIME * wind_speed + world_phase) * wind_strength * gust;
|
||||
float flutter = sin(TIME * 1.7 + world_phase * 1.9 + VERTEX.y * 2.0) * flutter_strength;
|
||||
|
||||
VERTEX.x += sway_x;
|
||||
VERTEX.z += sway_z;
|
||||
VERTEX.xz += direction * bend * height_factor;
|
||||
VERTEX.xz += crosswind * flutter * height_factor;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
shader_type spatial;
|
||||
render_mode blend_mix, depth_draw_never, cull_disabled, unshaded;
|
||||
|
||||
uniform vec4 tint : source_color = vec4(0.76, 0.91, 0.75, 0.2);
|
||||
uniform float progress : hint_range(0.0, 1.0) = 0.0;
|
||||
uniform float glow_strength : hint_range(0.0, 1.0) = 0.38;
|
||||
|
||||
void fragment() {
|
||||
float edge_softness = smoothstep(0.0, 0.24, UV.y) * smoothstep(0.0, 0.24, 1.0 - UV.y);
|
||||
float head = progress * 1.18 - 0.08;
|
||||
float tail = head - 0.52;
|
||||
float head_mask = 1.0 - smoothstep(head, head + 0.07, UV.x);
|
||||
float tail_mask = smoothstep(tail - 0.08, tail + 0.03, UV.x);
|
||||
float life_fade = smoothstep(0.0, 0.12, progress) * (1.0 - smoothstep(0.82, 1.0, progress));
|
||||
float brush_texture = 0.88 + 0.12 * sin(UV.x * 31.0 + UV.y * 5.0);
|
||||
float stroke_alpha = edge_softness * head_mask * tail_mask * life_fade * brush_texture;
|
||||
float glint = exp(-pow((UV.x - head) * 20.0, 2.0)) * edge_softness * life_fade;
|
||||
|
||||
ALBEDO = tint.rgb;
|
||||
EMISSION = tint.rgb * (glow_strength * stroke_alpha + glint * 0.28);
|
||||
ALPHA = tint.a * stroke_alpha;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bjj5oxdmfpgqf
|
||||
@@ -1,14 +0,0 @@
|
||||
shader_type spatial;
|
||||
render_mode blend_mix, depth_draw_never, cull_disabled, unshaded;
|
||||
|
||||
uniform float softness : hint_range(0.0, 1.0) = 0.45;
|
||||
uniform vec3 tint : source_color = vec3(0.95, 0.93, 0.88);
|
||||
|
||||
void fragment() {
|
||||
float edge_dist = abs(UV.y - 0.5) * 2.0;
|
||||
float alpha = 1.0 - smoothstep(0.0, 1.0, edge_dist);
|
||||
alpha *= smoothstep(0.0, 0.2, UV.x) * smoothstep(0.0, 0.2, 1.0 - UV.x);
|
||||
alpha *= softness * 0.1;
|
||||
ALBEDO = tint;
|
||||
ALPHA = alpha;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://b8dxberetmchf
|
||||
Reference in New Issue
Block a user