VFXWeather ​
Inherits: VFXLoop < VFX < Node3D
Weather VFX - Continuous environmental effects like rain, snow, fog Supports shader global control for wind direction and intensity Designed to be attached to the camera for consistent visibility
Properties ​
float | intensity | 1.0: |
Variables ​
Vector3 | wind_direction | Vector3.ZERO : set = set_wind_direction |
float | wind_intensity | 0.0 : set = set_wind_intensity |
bool | has_set_shader_globals | false |
Methods ​
float | default_fade_in() |
float | default_fade_out() |
void | activate_vfx( selection: VFXSelection = null ) |
void | deactivate_vfx() |
void | set_intensity( value: float, seconds: float = 0.0 ) |
float | layer_ratio( intensity_value: float, start: float, full: float ) static |
bool | has_uniform( material: ShaderMaterial, uniform_name: String ) static |
void | set_wind_direction( new_direction: Vector3 ) |
void | set_wind_intensity( new_intensity: float ) |
void | transition_wind_direction( new_direction: Vector3, duration: float = 2.0 ) |
void | transition_wind_intensity( new_intensity: float, duration: float = 2.0 ) |
void | transition_wind( new_direction: Vector3, new_intensity: float, duration: float = 2.0 ) |
void | attach_to_camera( camera_controller: CameraController ) |
bool | is_attached_to_camera() |
CameraController | get_attached_camera() |
Dictionary | get_wind_data() |
void | set_wind_data( data: Dictionary ) |
Property descriptions ​
Weather
float intensity = 1.0: ​
How strong the weather is (0 to 1): design the effect at 1 (its heaviest) and lower this to thin it out. Move the slider in the editor to see the effect at that intensity. Every particle node of the effect has a range of intensity it comes in over, set as node metadata (Inspector > Metadata): intensity_start (below it the layer emits nothing, default 0) and intensity_full (from it the layer is at full strength, default 1). In between the layer emits that part of its particles (its amount ratio, raised to 1.5). A layer with no metadata follows the intensity from 0 to 1. A sub emitter (a splash, metadata weather_sub_emitter) is left alone: it follows the particles that make it. The weather system sets this at run time from the Weather config
Variable descriptions ​
Vector3 wind_direction = Vector3.ZERO : set = set_wind_direction ​
Wind direction (Vector3 normalized direction vector)
float wind_intensity = 0.0 : set = set_wind_intensity ​
Wind intensity (float 0.0 to 1.0)
bool has_set_shader_globals = false ​
Track if we've set the shader globals (for cleanup)
Method descriptions ​
float default_fade_in() ​
A weather comes and goes by its intensity (set_intensity over time), not by a fade
float default_fade_out() ​
A loop with an end animation fades out over that animation (both end together), without one over 0.35 s (from VFXLoop)
void activate_vfx( selection: VFXSelection = null ) ​
Weather VFX should NOT auto-cleanup (manual control for persistent weather)
void deactivate_vfx() ​
Override deactivation to clean up shader globals
void set_intensity( value: float, seconds: float = 0.0 ) ​
Sets how strong the weather is, at once or easing over seconds
float layer_ratio( intensity_value: float, start: float, full: float ) ​
How much of its particles a layer emits at an intensity: 0 below its start, 1 from its full, and in between the part of the way to full raised to 1.5 (a light weather looks light: half way is a third of the particles, not half)
bool has_uniform( material: ShaderMaterial, uniform_name: String ) ​
Does a shader material have a uniform of this name?
void set_wind_direction( new_direction: Vector3 ) ​
Set wind direction and update shader global
void set_wind_intensity( new_intensity: float ) ​
Set wind intensity and update shader global
void transition_wind_direction( new_direction: Vector3, duration: float = 2.0 ) ​
Smoothly transition to new wind direction over time
void transition_wind_intensity( new_intensity: float, duration: float = 2.0 ) ​
Smoothly transition to new wind intensity over time
void transition_wind( new_direction: Vector3, new_intensity: float, duration: float = 2.0 ) ​
Transition both wind properties simultaneously
void attach_to_camera( camera_controller: CameraController ) ​
Attach weather VFX to camera via RemoteTransform3D
bool is_attached_to_camera() ​
Check if weather is attached to camera
CameraController get_attached_camera() ​
Get the camera controller this weather is attached to
Dictionary get_wind_data() ​
Get current wind data as dictionary (useful for saving/loading)
void set_wind_data( data: Dictionary ) ​
Set wind data from dictionary (useful for saving/loading)