Reduce fog and suppress weather indoors

This commit is contained in:
Alexander Sellite 2026-09-01 17:30:18 -04:00
parent 6029eb29b8
commit 134ece4a10
6 changed files with 105 additions and 10 deletions

View file

@ -115,6 +115,7 @@ var _weather_to: WorldWeatherService.Weather = (
)
var _weather_transition: float = 1.0
var _light_performance_profile: bool = false
var _local_home_interior_active: bool = false
func setup(
@ -185,6 +186,28 @@ func apply_weather_immediately(
_apply_time(_time_service.get_time_hours())
func set_local_home_interior_active(active: bool) -> void:
if _local_home_interior_active == active:
return
_local_home_interior_active = active
if _rain != null:
_rain.visible = not active
_rain.process_mode = (
Node.PROCESS_MODE_DISABLED if active else Node.PROCESS_MODE_INHERIT
)
if _rain_collision != null:
_rain_collision.visible = not active
_rain_collision.process_mode = (
Node.PROCESS_MODE_DISABLED if active else Node.PROCESS_MODE_INHERIT
)
if _storm_clouds != null:
_storm_clouds.process_mode = (
Node.PROCESS_MODE_DISABLED if active else Node.PROCESS_MODE_INHERIT
)
if _time_service != null:
_apply_time(_time_service.get_time_hours())
func _prepare_runtime_environment() -> bool:
if (
_time_service == null
@ -700,6 +723,8 @@ func _weather_value(
rainy: float,
foggy: float,
) -> float:
if _local_home_interior_active:
return sunny
return lerpf(
_weather_state_value(_weather_from, sunny, cloudy, rainy, foggy),
_weather_state_value(_weather_to, sunny, cloudy, rainy, foggy),