add rain to materials
This commit is contained in:
@@ -31,8 +31,8 @@ func _ready() -> void:
|
||||
|
||||
#set noise texture 2d to materials in special group
|
||||
ApplyWindNoiseToMaterials()
|
||||
#set snow shader to materials in special group
|
||||
ApplySnowShaderToMaterials()
|
||||
#set weather overlay (snow + rain) to materials in special group
|
||||
ApplyWeatherShaderToMaterials()
|
||||
|
||||
if day_night_controller == null:
|
||||
day_night_controller = DayNightController.new(
|
||||
@@ -67,18 +67,17 @@ func ApplyWindNoiseToMaterials():
|
||||
if node is GeometryInstance3D:
|
||||
node.material_override.set_shader_parameter("wind_noise", noise_tex)
|
||||
|
||||
func ApplySnowShaderToMaterials():
|
||||
var snow_shader = preload("res://core/daynight/snow_overlay.tres")
|
||||
func ApplyWeatherShaderToMaterials():
|
||||
var weather_shader = preload("res://core/daynight/weather_overlay.tres")
|
||||
|
||||
#apply to node and childs
|
||||
for node in get_tree().get_nodes_in_group("snow_materials"):
|
||||
for node in get_tree().get_nodes_in_group("weather_materials"):
|
||||
if node is GeometryInstance3D:
|
||||
node.material_overlay = snow_shader
|
||||
node.material_overlay = weather_shader
|
||||
else:
|
||||
for child in node.get_children():
|
||||
if child is GeometryInstance3D:
|
||||
child.material_overlay = snow_shader
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user