Files
autgame/menus/assets/shaders/tent_star_glow.gdshader
T

24 lines
857 B
Plaintext

shader_type canvas_item;
uniform float hover_strength : hint_range(0.0, 1.0) = 0.0;
uniform vec2 star_center = vec2(0.50, 0.13);
uniform float drift_strength : hint_range(0.0, 4.0) = 0.65;
uniform float drift_speed : hint_range(0.0, 2.0) = 0.20;
void vertex() {
float wave = sin(TIME * drift_speed + VERTEX.y * 0.012) * drift_strength;
VERTEX.x += wave * (UV.y * 0.7 + 0.3);
}
void fragment() {
vec4 color = texture(TEXTURE, UV);
// Maschera morbida limitata alla stella in cima al tendone, non al tendone.
vec2 aspect_uv = (UV - star_center) * vec2(1.0, 1.35);
float star_area = 1.0 - smoothstep(0.105, 0.185, length(aspect_uv));
float pulse = 0.88 + 0.12 * sin(TIME * 5.0);
vec3 gold_glow = vec3(1.0, 0.70, 0.14) * star_area * hover_strength * pulse;
color.rgb += gold_glow * color.a;
color.rgb = min(color.rgb, vec3(1.0));
COLOR = color;
}