pub enum ParticleStyle {
Dots {
radius: f64,
},
GlowDots {
radius: f64,
},
Sprites {
image: Handle<ImageAsset>,
size: f64,
align_to_velocity: bool,
},
Trails {
length: Duration,
width: f64,
},
Plexus {
radius: f64,
max_distance: f64,
},
Shape {
radius: f64,
shape: ParticleShape,
},
Bokeh {
radius: f64,
aperture: f32,
focus: f32,
shape: BokehShape,
ring: f32,
hardness: f32,
highlight: f32,
},
Configured {
style: Box<ParticleStyle>,
options: StyleOptions,
},
Custom(Arc<dyn Fn(&[Particle], &SceneContext<'_>) -> Result<Node, ValidationError> + Send + Sync>),
}Expand description
particle presentation. Built-ins share an instance protocol; custom callbacks run on CPU and return ordinary content or a validation error, never custom WGSL.
Variants§
Dots
Smooth analytic circles; radius multiplies particle.size.
GlowDots
Compact Gaussian halos with linear Plus compositing.
Sprites
Bilinear sprite instances, tinted by premultiplied particle color.
Fields
image: Handle<ImageAsset>Lazy immutable texture.
Trails
Eight actual historical segments per particle, not a velocity extrapolation.
Plexus
Analytic dots and bounded pairwise neighbor connections.
Shape
Texture-free analytic geometry.
Bokeh
Depth-aware, energy-compensated aperture. Depth is particle.custom[1].
Fields
shape: BokehShapeAperture silhouette.
Configured
A built-in or custom style with explicit batch options; see StyleOptions.
Fields
style: Box<ParticleStyle>Underlying built-in or custom style.
options: StyleOptionsBatch-level presentation policy.
Custom(Arc<dyn Fn(&[Particle], &SceneContext<'_>) -> Result<Node, ValidationError> + Send + Sync>)
CPU-only presentation callback.
Implementations§
Source§impl ParticleStyle
impl ParticleStyle
Sourcepub fn blend(self, blend: ParticleBlend) -> Self
pub fn blend(self, blend: ParticleBlend) -> Self
Selects compositing for the entire batch, not individual GPU invocations.
Sourcepub fn sheet(self, sheet: SpriteSheet) -> Self
pub fn sheet(self, sheet: SpriteSheet) -> Self
Adds animation or atlas UVs to Sprites.
Sourcepub fn trails(self, trails: TrailOptions) -> Self
pub fn trails(self, trails: TrailOptions) -> Self
Configures segment count, endpoint width/color and optional smoothing/ribbon.
Sourcepub fn stretch_by_speed(self, scale: f32, maximum: f32) -> Self
pub fn stretch_by_speed(self, scale: f32, maximum: f32) -> Self
Aligns and stretches geometry along the velocity, with a finite ceiling.