Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

vfx_init.wgsl

Bindings

sim_params

#
@group(0)
@binding(0)
var<uniform> sim_params: SimParams

particle_buffer

#
@group(1)
@binding(0)
var<storage, read_write> particle_buffer: ParticleBuffer

indirect_buffer

#
@group(1)
@binding(1)
var<storage, read_write> indirect_buffer: IndirectBuffer

parent_particle_buffer

#

Shader defs requirments:

🟢 READ_PARENT_PARTICLE

@group(1)
@binding(2)
var<storage, read> parent_particle_buffer: ParentParticleBuffer

spawners

#
@group(2)
@binding(0)
var<storage, read> spawners: array<Spawner>

prefix_sum

#
@group(2)
@binding(1)
var<storage, read> prefix_sum: array<u32>

batch_info

#
@group(2)
@binding(2)
var<storage, read> batch_info: BatchInfo

effect_metadatas

#
@group(3)
@binding(0)
var<storage, read_write> effect_metadatas: array<EffectMetadata>

child_info_buffer

#

Shader defs requirments:

🟢 CONSUME_GPU_SPAWN_EVENTS

@group(3)
@binding(1)
var<storage, read> child_info_buffer: ChildInfoBuffer

event_buffer

#

Shader defs requirments:

🟢 CONSUME_GPU_SPAWN_EVENTS

@group(3)
@binding(2)
var<storage, read> event_buffer: EventBuffer

Structures

Particle

#
struct Particle {
particles: array<Particle> ,
}

ParentParticle

#
struct ParentParticle {
particles: array<ParentParticle> , 🟢 READ_PARENT_PARTICLE
}

EffectLocation

#

Location of an effect in a slab.

struct EffectLocation {
effect_index: u32 ,
base_particle: u32 ,
update_index: u32 ,
}

Functions

find_location_from_particle

#

Requirements: - var batch_info : BatchInfo - var prefix_sum : array

fn find_location_from_particle (
slab_particle_index: u32
) -> EffectLocation

main

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(64)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn main (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)