simvx.graphics.renderer.particle_compute¶
GPU compute shader particle simulation.
Dispatches a compute shader to update particle positions, velocities, lifetimes, and visual properties entirely on the GPU — avoiding per-frame CPU-to-GPU uploads for particle data.
Module Contents¶
Classes¶
GPU-based particle simulation via Vulkan compute shader. |
Data¶
API¶
- simvx.graphics.renderer.particle_compute.__all__¶
[‘ParticleCompute’]
- class simvx.graphics.renderer.particle_compute.ParticleCompute(engine: Any)[source]¶
GPU-based particle simulation via Vulkan compute shader.
Creates a compute pipeline that updates particle state (position, velocity, colour, scale, lifetime) in an SSBO. The same SSBO can be bound by the graphics particle pass for zero-copy rendering.
Initialization
- setup(max_particles: int = 65536) None[source]¶
Create compute pipeline, SSBO, and descriptor set.
Args: max_particles: Maximum number of particles in the simulation buffer.
- dispatch(cmd: Any, dt: float, emitter_config: dict) None[source]¶
Dispatch the compute shader to simulate one step.
Args: cmd: Active command buffer (must be outside a render pass). dt: Delta time in seconds. emitter_config: Dict with emitter parameters: - emitter_pos: (x, y, z) - gravity: (x, y, z) - damping: float - initial_velocity: (x, y, z) - velocity_spread: float - start_colour: (r, g, b, a) - end_colour: (r, g, b, a) - start_scale: float - end_scale: float - emission_radius: float
- get_particle_ssbo() Any[source]¶
Return the particle SSBO buffer handle for use by the rendering pass.
- property max_particles: int¶
- property ready: bool¶