WorldSkyEnvironment ​
Inherits: WorldEnvironment
Preloaded stylized sky shader
Variables ​
SkyConfig | current_sky_config | |
EnvironmentConfig | current_environment_config | |
WeatherLook | weather_look | WeatherLook.new() |
SunConfig | sun_path | |
ShaderMaterial | sky_material | |
bool | day_night_cycle | true |
float | transition_duration | 3.0 |
Dictionary | current_params | {} |
ChronoManager | chrono_manager |
Methods ​
void | set_day_night_cycle( enabled: bool ) |
void | set_sun_path( path: SunConfig ) |
void | apply_sky_config( config: SkyConfig, blend_seconds: float = 0.0 ) |
void | update_sky_environment( current_time: float ) |
Dictionary | calculate_sky_parameters( current_time: float ) |
void | apply_params( params: Dictionary ) |
void | apply_environment_config( config: EnvironmentConfig, blend_seconds: float = 0.0 ) |
void | set_weather_look( config: WeatherConfig, seconds: float, intensity: float = 1.0 ) |
bool | is_weather_blending() |
bool | is_blending() |
Signals ​
environment_applied( config: EnvironmentConfig ) ​
Sent every time the environment is shown, and at every step of a blend: the sun shines by the Sun Light of the environment that is shown
sun_dimmed( brightness: float ) ​
Sent when the weather changes how bright the sun is (1 = as the look says): the sun of the game follows
Constants ​
constSKY =SkyLook.SKY_SHADER- Preloaded stylized sky shader
Variable descriptions ​
SkyConfig current_sky_config ​
The sky that is shown now (while one sky blends into another: the blend)
EnvironmentConfig current_environment_config ​
The environment (sky, light, fog) that is shown now (while one environment blends into another: the blend).
WeatherLook weather_look = WeatherLook.new() ​
The weather laid on the look (see WeatherLook): what is shown now, and the blend it is in. Neutral = the look as it is
SunConfig sun_path ​
The sun of the world (when it rises and sets): the sky changes at those hours. Set by the game host
ShaderMaterial sky_material ​
The material of the sky when it is a shader (null for a sky of another kind, a procedural sky for example).
bool day_night_cycle = true ​
Day/night cycle control (set by SkyConfig)
float transition_duration = 3.0 ​
Parameters for smooth interpolation
Dictionary current_params = ​
The sky settings that are applied now.
ChronoManager chrono_manager ​
The manager of time and timers.
Method descriptions ​
void set_day_night_cycle( enabled: bool ) ​
Enable or disable day/night cycle (typically called from external system)
void set_sun_path( path: SunConfig ) ​
The sun of the world is another one (or a new world): the sky follows its hours from now on
void apply_sky_config( config: SkyConfig, blend_seconds: float = 0.0 ) ​
Apply a SkyConfig to reconfigure the sky
void update_sky_environment( current_time: float ) ​
Initial setup - directly updates sky without interpolation
Dictionary calculate_sky_parameters( current_time: float ) ​
Calculate sky parameters based on time of day (the colours, the clouds and the stars of the stylized sky, by the sun's hours)
void apply_params( params: Dictionary ) ​
Sets the parameters of the sky from a dictionary: parameter name -> value, as the driver of the sky makes them (hour_params)
void apply_environment_config( config: EnvironmentConfig, blend_seconds: float = 0.0 ) ​
Apply an EnvironmentConfig to reconfigure environment settings. With blend_seconds above 0 the environment changes into it over that time (fog, light, sun, colour grade, camera, wind), starting from the look shown now, even if it is in the middle of another change
void set_weather_look( config: WeatherConfig, seconds: float, intensity: float = 1.0 ) ​
The weather changes (null = clear): the sky, the fog, the sun and the ambient light move to its modifiers over seconds, starting from what is shown now, even in the middle of another change. 0 = at once
bool is_weather_blending() ​
Is a weather fading in or out?
bool is_blending() ​
Is a look changing into another now?