feat: animate tent anchor lights and curtain reverse on hover out

This commit is contained in:
enne2
2026-09-10 22:50:33 +02:00
parent 717a702fb2
commit 95ccfc4c92
8 changed files with 40 additions and 4 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 44 KiB

+28
View File
@@ -38,6 +38,18 @@ const vec3 bulbs[20] = vec3[20](
vec3(0.7773, 0.5613, 0.0) vec3(0.7773, 0.5613, 0.0)
); );
// 4 grandi luci sui punti di ancoraggio delle funi a terra lungo la balza:
// 0: Esterno Sinistro (131.3, 502.1) -> fase 4 (in fase con L9 in fondo a sinistra)
// 1: Palo/Fune SX Ingresso (306.5, 544.1) -> fase 0
// 2: Palo/Fune DX Ingresso (558.6, 550.7) -> fase 2
// 3: Esterno Destro (737.2, 499.3) -> fase 4 (in fase con la discesa a destra)
const vec3 anchor_bulbs[4] = vec3[4](
vec3(0.1492, 0.6695, 4.0),
vec3(0.3483, 0.7255, 0.0),
vec3(0.6348, 0.7342, 2.0),
vec3(0.8378, 0.6657, 4.0)
);
// Intensità nel ciclo di 6 frame della singola lampadina (d = frame dalla rampa), // Intensità nel ciclo di 6 frame della singola lampadina (d = frame dalla rampa),
// ricavata dalle aree misurate sui frame della GIF: ~25%, ~50%, pieno, pieno, 0, 0. // ricavata dalle aree misurate sui frame della GIF: ~25%, ~50%, pieno, pieno, 0, 0.
float chase_intensity(float d) { float chase_intensity(float d) {
@@ -96,6 +108,22 @@ void fragment() {
color.rgb += GOLD_HALO * (halo * ga * 0.7 * (1.0 - core)); color.rgb += GOLD_HALO * (halo * ga * 0.7 * (1.0 - core));
color.a = max(color.a, halo * ga * 0.5); color.a = max(color.a, halo * ga * 0.5);
} }
// 4 grandi luci sui punti di ancoraggio delle funi (intermittenti a inseguimento con ritmo proprio)
for (int j = 0; j < 4; j++) {
float d = mod(cycle - anchor_bulbs[j].z + 6.0, 6.0);
float intensity = chase_intensity(d);
if (intensity <= 0.0) {
continue;
}
float r = length(px - anchor_bulbs[j].xy * vec2(880.0, 750.0));
float core = 1.0 - smoothstep(4.0, 10.0, r);
float halo = exp(-r / 15.0);
float ga = clamp(intensity * garland_strength, 0.0, 1.0);
color.rgb = mix(color.rgb, GOLD_CORE, core * ga);
color.rgb += GOLD_HALO * (halo * ga * 0.8 * (1.0 - core));
color.a = max(color.a, halo * ga * 0.6);
}
} }
color.rgb = min(color.rgb, vec3(1.0)); color.rgb = min(color.rgb, vec3(1.0));
+12 -4
View File
@@ -63,13 +63,21 @@ func _build() -> void:
func _add_tent_button(texture: Texture2D, center: Vector2, has_lights := false) -> TextureButton: func _add_tent_button(texture: Texture2D, center: Vector2, has_lights := false) -> TextureButton:
var button := MenuUI.add_image_button(self, texture, center, Vector2(0.36, 0.59)) var button := MenuUI.add_image_button(self, texture, center, Vector2(0.36, 0.59))
var star_mat := MenuUI.tent_star_material() var mat := MenuUI.tent_material(0.0) if has_lights else MenuUI.tent_star_material()
button.material = star_mat button.material = mat
button.tooltip_text = "Apri questo percorso" button.tooltip_text = "Apri questo percorso"
# Glow stella su entrambi i tendoni al passaggio del mouse # Glow stella su entrambi i tendoni al passaggio del mouse
button.mouse_entered.connect(func(): star_mat.set_shader_parameter("hover_strength", 1.0)) button.mouse_entered.connect(func():
button.mouse_exited.connect(func(): star_mat.set_shader_parameter("hover_strength", 0.0)) mat.set_shader_parameter("hover_strength", 1.0)
if has_lights:
mat.set_shader_parameter("garland_strength", 1.0)
)
button.mouse_exited.connect(func():
mat.set_shader_parameter("hover_strength", 0.0)
if has_lights:
mat.set_shader_parameter("garland_strength", 0.0)
)
# Animazione apertura sipario e lucine in hover # Animazione apertura sipario e lucine in hover
if has_lights: if has_lights: