test other scenes and fix
This commit is contained in:
@@ -67,14 +67,14 @@ func _ready() -> void:
|
||||
|
||||
func ApplyWindNoiseToMaterials():
|
||||
var noise_tex = preload("res://core/daynight/noise.tres")
|
||||
for node in get_tree().get_nodes_in_group("wind_materials"):
|
||||
for node in get_tree().get_nodes_in_group("wind_node"):
|
||||
if node is GeometryInstance3D:
|
||||
node.material_override.set_shader_parameter("wind_noise", noise_tex)
|
||||
|
||||
func ApplyWeatherShaderToMaterials():
|
||||
var weather_shader = preload("res://core/daynight/weather_overlay.tres")
|
||||
|
||||
for node in get_tree().get_nodes_in_group("weather_materials"):
|
||||
for node in get_tree().get_nodes_in_group("weather_node"):
|
||||
if node is GeometryInstance3D:
|
||||
node.material_overlay = weather_shader
|
||||
else:
|
||||
@@ -83,25 +83,25 @@ func ApplyWeatherShaderToMaterials():
|
||||
child.material_overlay = weather_shader
|
||||
|
||||
func select_day_time(normalized_time: float) -> void:
|
||||
# 0.0→0.25 = alba: day_time 1.0→2.0 (night colors → morning colors)
|
||||
# 0.25→0.5 = giorno: day_time 2.0→2.0 (stays morning/afternoon)
|
||||
# 0.5→0.75 = tramonto: day_time 2.0→3.0 (afternoon colors → night colors)
|
||||
# 0.75→1.0 = notte: day_time 3.0→3.0 (stays night)
|
||||
# At wrap 1.0→0.0: day_time stays 3.0, then fades back via alba
|
||||
# 0.0→0.25 = sunrise: day_time 1.0→2.0 (night colors → morning colors)
|
||||
# 0.25→0.5 = day: day_time 2.0→2.0 (stays morning/afternoon)
|
||||
# 0.5→0.75 = sunset: day_time 2.0→3.0 (afternoon colors → night colors)
|
||||
# 0.75→1.0 = night: day_time 3.0→3.0 (stays night)
|
||||
# At wrap 1.0→0.0: day_time stays 3.0, then fades back via sunrise
|
||||
|
||||
if normalized_time < 0.25:
|
||||
# Alba: notte → mattina
|
||||
#Sunrise: night → morning
|
||||
day_time = 3.0 - (normalized_time / 0.25) * 2.0 # 3.0 → 1.0
|
||||
elif normalized_time < 0.5:
|
||||
# Giorno pieno
|
||||
#Broad daylight
|
||||
var t: float = (normalized_time - 0.25) / 0.25
|
||||
day_time = 1.0 + t # 1.0 → 2.0
|
||||
elif normalized_time < 0.75:
|
||||
# Tramonto: pomeriggio → notte
|
||||
#Sunset: afternoon → night
|
||||
var t: float = (normalized_time - 0.5) / 0.25
|
||||
day_time = 2.0 + t # 2.0 → 3.0
|
||||
else:
|
||||
# Notte piena
|
||||
#Night
|
||||
day_time = 3.0
|
||||
|
||||
if weather_controller:
|
||||
|
||||
Reference in New Issue
Block a user