fix snow and exposure

This commit is contained in:
2026-06-30 17:04:40 +02:00
parent 952058b0e0
commit 8198f7df1f
13 changed files with 677 additions and 27 deletions

View File

@@ -139,10 +139,10 @@ func _apply_dynamic_environment_materials(node: Node) -> void:
if node.is_in_group("wind_node"):
_apply_wind_noise_to_node(node, NOISE_TEXTURE)
if node.is_in_group("weather_node"):
if node.is_in_group("weather_node") or node.is_in_group("weather_vegetables_node"):
_apply_weather_overlay_to_node(node, _get_weather_overlay_material(node))
if _should_clear_weather_overlay(node):
if _should_ignore_weather_overlay(node):
_clear_weather_overlay_from_node(node)
func ApplyWindNoiseToMaterials():
@@ -169,8 +169,7 @@ func ApplyWeatherShaderToMaterials():
_apply_weather_overlay_to_node(node, _get_weather_overlay_material(node))
for node in get_tree().get_nodes_in_group("weather_vegetables_node"):
if _should_clear_weather_overlay(node):
_clear_weather_overlay_from_node(node)
_apply_weather_overlay_to_node(node, _get_weather_overlay_material(node))
func _get_weather_overlay_material(node: Node) -> Material:
if not node.is_in_group("weather_overlay_no_noise"):
@@ -185,12 +184,12 @@ func _get_weather_overlay_material(node: Node) -> Material:
return weather_shader_no_noise
func _apply_weather_overlay_to_node(node: Node, material: Material) -> void:
if _should_clear_weather_overlay(node):
if _should_ignore_weather_overlay(node):
_clear_weather_overlay_from_node(node)
return
if node is GeometryInstance3D:
if _geometry_uses_alpha_texture(node):
if _should_clear_weather_overlay(node) or _geometry_uses_alpha_texture(node):
node.material_overlay = null
else:
node.material_overlay = material
@@ -230,8 +229,11 @@ func _shader_material_uses_alpha_texture(material: ShaderMaterial) -> bool:
return material.shader.code.find("alpha_texture") != -1
func _should_ignore_weather_overlay(node: Node) -> bool:
return node.is_in_group("weather_overlay_ignore")
func _should_clear_weather_overlay(node: Node) -> bool:
return node.is_in_group("weather_vegetables_node") or node.is_in_group("weather_overlay_ignore")
return node.is_in_group("weather_vegetables_node")
func select_day_time(normalized_time: float) -> void:
#set show_day_time_debug = true to show debug on screen