vfx_common.wgsl
Import path
Constants
Structures
struct
Spawner
{
}
Append buffer populated during the Update pass of the previous frame by a parent effect, and read back by its child effect(s) during the Init pass of the next frame.
Info about a single child of a parent effect.
Buffer storing all the ChildInfo structs for several effects.
Indirect compute dispatch struct for GPU-driven passes. The layout of this struct is dictated by WGSL.
Draw indirect parameters for GPU-driven rendering, and additional effect data.
struct
EffectMetadata
{
}
instance_count:
atomic<u32>
,
alive_count:
atomic<u32>
,
dead_count:
atomic<u32>
,
max_spawn:
atomic<u32>
,
particle_counter:
atomic<u32>
,
Functions
Random floating-point number in [0:1]
Random floating-point number in [0:1]^2
Random floating-point number in [0:1]^3
Random floating-point number in [0:1]^4
Normal distribution computed using Box-Muller transform
fn
rand_normal_vec2
(
mean: vec2f
,
std_dev: vec2f
)
->
vec2f
fn
rand_normal_vec3
(
mean: vec3f
,
std_dev: vec3f
)
->
vec3f
fn
rand_normal_vec4
(
mean: vec4f
,
std_dev: vec4f
)
->
vec4f
A event emitted by another effect during its update pass, to trigger the spawning of one or more particle in this effect.