Skip to main content

Module kernels

Module kernels 

Source
Expand description

Built-in compute kernels as embedded GLSL source strings.

Each kernel is a fully implemented GLSL compute shader. The Rust side provides parameter structs and convenience methods to compile and dispatch each kernel through the dispatch module.

Kernels:

  1. particle_integrate — position += velocity * dt, apply forces, age, kill dead
  2. particle_emit — atomic counter for birth, initialize from emitter params
  3. force_field_sample — evaluate multiple force fields at particle positions
  4. math_function_gpu — Lorenz attractor, Mandelbrot iteration, Julia set
  5. fluid_diffuse — Jacobi iteration for diffusion
  6. histogram_equalize — compute histogram and equalize
  7. prefix_sum — Blelloch parallel prefix sum (scan)
  8. radix_sort — GPU radix sort
  9. frustum_cull — per-instance frustum culling
  10. skinning — bone matrix palette skinning

Structs§

FluidDiffuseParams
Parameters for the fluid diffusion kernel (Jacobi iteration).
ForceFieldDesc
Describes a force field for the force_field_sample kernel.
FrustumCullParams
Parameters for frustum culling.
HistogramParams
Parameters for histogram equalization.
KernelLibrary
Library of all built-in compute kernels, providing easy access to sources and parameter setup.
ParticleEmitParams
Parameters for the particle emission kernel.
ParticleIntegrateParams
Parameters for the particle integration kernel.
PrefixSumPlan
Plan for prefix sum (Blelloch algorithm).
RadixSortPlan
Plan for radix sort.
SkinningParams
Parameters for skeletal skinning.

Enums§

ForceFieldType
Types of force fields.
KernelId
Identifies a built-in kernel.
MathFunctionType
Math function types for the math_function_gpu kernel.

Constants§

KERNEL_FLUID_DIFFUSE
Fluid diffusion kernel using Jacobi iteration.
KERNEL_FORCE_FIELD_SAMPLE
Force field sampling kernel: evaluate multiple force fields at particle positions.
KERNEL_FRUSTUM_CULL
Frustum culling kernel: per-instance visibility testing.
KERNEL_HISTOGRAM_EQUALIZE
Histogram equalization kernel (two passes: histogram + equalize).
KERNEL_MATH_FUNCTION_GPU
Math function GPU kernel: Lorenz, Mandelbrot, Julia, Rossler, Aizawa.
KERNEL_PARTICLE_EMIT
Particle emission kernel: spawn new particles using atomic counter.
KERNEL_PARTICLE_INTEGRATE
Particle integration kernel: advance positions, apply forces, age, kill dead.
KERNEL_PREFIX_SUM
Blelloch parallel prefix sum (exclusive scan).
KERNEL_RADIX_SORT
GPU radix sort kernel.
KERNEL_SKINNING
Skeletal skinning kernel: apply bone matrix palette transforms.

Functions§

set_fluid_diffuse_uniforms
Set uniforms for the fluid diffusion kernel.
set_force_field_uniforms
Set uniforms for the force field sampling kernel.
set_frustum_cull_uniforms
Set uniforms for the frustum culling kernel.
set_histogram_uniforms
Set uniforms for the histogram equalization kernel.
set_math_function_uniforms
Set uniforms for the math function GPU kernel.
set_particle_emit_uniforms
Set uniforms for the particle emission kernel.
set_particle_integrate_uniforms
Set uniforms for the particle integration kernel.
set_prefix_sum_uniforms
Set uniforms for the prefix sum kernel.
set_radix_sort_uniforms
Set uniforms for the radix sort kernel.
set_skinning_uniforms
Set uniforms for the skinning kernel.