# graphics3d/toon/toonvfx (vanilla-engine 0.4.0)

> https://vanillapunch.com/docs/vanilla-engine/0.4.0/api/graphics3d/toon/toonvfx/

Base of toon 3D GPU effects. (ToonVfx of vanilla.js graphics3d/toon/toonvfx.js)
- Texture: a single atlas built in code on the first draw, without image files. The left half is a 16-cell smoke flipbook, the right half is ToonVfxSlot cells and eight rows of color ramps.
  Ramp colors are decided by the game. (set_ramps, each row is colors going from a white core to dark, an effect's ramp is the row number, -1 means color only without a ramp)
- Particles: GPU particles drawn with instancing. Written to the buffer once when emitted, and position, size and color are computed by the vertex shader from age. (Drag, gravity, stopping on the floor, streaks stretched along velocity, color ramps)
  When the cap (set_particle_capacity) is exceeded, the oldest emitted are overwritten first, and set_count_ratio multiplies the emitted count by a fraction. (Phones and the lite path)
- Effect meshes: fireballs (add_fireball), shockwave rings and floor glow (add_shockwave), floor decals (add_decal, queue_decal), smoke plumes (add_plume),
  solid-of-revolution beams (queue_beam), ribbons spread toward the camera (queue_ribbon) and lightning made by winding them down (queue_lightning), lightning that re-bends during its lifetime (add_lightning), and point glints at a spot (queue_glint).
- Rim: the rim of glow particles, the glow and rim of ribbons, and the rim of fireballs and shockwaves cover the edges with the rim color (set_rim_color) so they are visible on bright backgrounds too. (Default is additive light only)
- Brightness gain: set_look_gain(look, gain) multiplies brightness per look of particles and glints. (Default 1, for making flame streaks, light rays and embers several times brighter in linear in the HDR version)
- Age and key: emit_particles, add_fireball, add_shockwave, add_decal, add_plume, add_lightning, add_flash take the options age (seconds already elapsed, negative delays by that much) and
  key (event key, not emitted again if already emitted, forgotten by clear). Even if the scene re-emits events from state every frame they appear only once, and effects shown late start from that age.
  Shake (add_shake) uses Shaker's exponential decay (9 per second), so passing strength x exp(-9 x age) for a late-shown event gives the same result.
- Foot shadow: queue_blob_shadow is a round shade decal for that frame (ToonVfxDecalMode::Shade).
- Screen: the flash (add_flash) covers the current viewport (inside the scissor if one is set) with its color at the end of draw and then fades.
  Camera shake (add_shake) is computed with the engine Shaker, and the game adds the offset given by read_shake to the camera's right and up.
- Which effect to emit for which event with what values (the recipe) is up to the game. The engine only takes parameters.
- Floor: if the game reports the floor height with set_floor_height_reader, decals, shockwaves and smoke plumes are placed at that height, and is_grounded particles stop at that height. (0 if none)
- Clock: update(seconds) advances this base's clock. Items passed with queue are drawn once in that frame and then cleared.
- Drawing: call draw(gl, view, projection) after drawing the toon models. Depth test on, depth write off, blends with premultiplied alpha. Records the previous state (including program and vertex array) and restores it.
- Differences from the original: instead of an options object per effect, takes structs with default values (ToonParticleOptions and so on). Values that can be ranges are ToonVfxRange.
  Values that may be omitted in the original (undefined) are Option. The life and age of add_lightning are in ToonLightningOptions too.
  The original takes a number or string as the event key, but the Rust version takes u64. (The game converts string keys to numbers)

## ToonVfxRange (struct) (Clone, Copy, Debug, PartialEq, From<f64>)

Value range. (random between minimum and maximum, that value when they are equal)

Example: Filling particle values with a random speed and a fixed size

```rust
use vanilla::{ToonParticleOptions, ToonVfxRange};

let speed = ToonVfxRange::new(2.0, 5.0);
let size = ToonVfxRange::from(0.1);
assert_eq!(size.minimum, size.maximum);
let options = ToonParticleOptions { count: 40, speed, size, life: ToonVfxRange::new(0.4, 0.9), ..ToonParticleOptions::default() };
assert_eq!(options.speed.maximum, 5.0);
```

- `pub minimum: f64` (field, since 0.4.0): Minimum.
  - returns f64
- `pub maximum: f64` (field, since 0.4.0): Maximum.
  - returns f64
- `pub fn new(minimum: f64, maximum: f64) -> ToonVfxRange` (constructor, since 0.4.0): Constructor.
  - `minimum` f64: Minimum.
  - `maximum` f64: Maximum.
  - returns ToonVfxRange: New range.

## ToonParticleOptions (struct) (Clone, Copy, Debug, Default)

Particle emission options.

Example: Spark streaks bursting in a cone, ignored if fired again with the same key

```rust
use vanilla::{ToonParticleOptions, ToonVfx, ToonVfxLook, ToonVfxRange, ToonVfxShape};

fn emit_sparks(vfx: &mut ToonVfx) {
	let spark_options = ToonParticleOptions {
		count: 30,
		position: [0.0, 1.0, 0.0],
		shape: ToonVfxShape::Cone,
		direction: [0.0, 1.0, 0.0],
		spread: 0.4,
		speed: ToonVfxRange::new(3.0, 6.0),
		gravity: 9.0,
		drag: 1.5,
		size: ToonVfxRange::new(0.04, 0.08),
		size_end: ToonVfxRange::from(0.3),
		life: ToonVfxRange::new(0.5, 1.0),
		look: ToonVfxLook::Streak,
		stretch: 0.04,
		color: [1.0, 0.7, 0.3],
		is_grounded: true,
		age: 0.1,
		key: Some(12),
		..ToonParticleOptions::default()
	};
	vfx.emit_particles(&spark_options);
	vfx.emit_particles(&spark_options);
}
```

- `pub count: u32` (field, since 0.4.0): Emit count. (multiplied by the set_count_ratio factor)
  - returns u32
- `pub position: [f64; 3]` (field, since 0.4.0): Emit position.
  - returns [f64; 3]
- `pub shape: ToonVfxShape` (field, since 0.4.0): Emission shape.
  - returns ToonVfxShape
- `pub radius: f64` (field, since 0.4.0): Radius of the shape. (ignored for Point)
  - returns f64
- `pub direction: [f64; 3]` (field, since 0.4.0): Direction of the cone and line.
  - returns [f64; 3]
- `pub spread: f64` (field, since 0.4.0): Cone spread. (radians)
  - returns f64
- `pub length: f64` (field, since 0.4.0): Line length.
  - returns f64
- `pub is_upward: bool` (field, since 0.4.0): Whether to flip downward directions upward.
  - returns bool
- `pub is_inward: bool` (field, since 0.4.0): Whether to ignore velocity and be pulled into the emission point as the age runs out.
  - returns bool
- `pub speed: ToonVfxRange` (field, since 0.4.0): Initial speed. (in the emit direction)
  - returns ToonVfxRange
- `pub rise: ToonVfxRange` (field, since 0.4.0): Initial upward speed added.
  - returns ToonVfxRange
- `pub gravity: f64` (field, since 0.4.0): Downward pulling acceleration.
  - returns f64
- `pub drag: f64` (field, since 0.4.0): Drag. (speed decreases by exp(-drag x age))
  - returns f64
- `pub size: ToonVfxRange` (field, since 0.4.0): Initial size.
  - returns ToonVfxRange
- `pub size_end: ToonVfxRange` (field, since 0.4.0): End size. (multiplied by the start size)
  - returns ToonVfxRange
- `pub size_curve: f64` (field, since 0.4.0): Curve of the size from start to end. (power of the progress, 1 for linear)
  - returns f64
- `pub life: ToonVfxRange` (field, since 0.4.0): Lifetime in seconds.
  - returns ToonVfxRange
- `pub delay: ToonVfxRange` (field, since 0.4.0): Delay in seconds before appearing.
  - returns ToonVfxRange
- `pub color: [f64; 3]` (field, since 0.4.0): Color. ([r, g, b] in 0 ~ 1, multiplied by the ramp color if there is a ramp)
  - returns [f64; 3]
- `pub ramp: i32` (field, since 0.4.0): Ramp row. (none if -1)
  - returns i32
- `pub look: ToonVfxLook` (field, since 0.4.0): Particle look.
  - returns ToonVfxLook
- `pub stretch: f64` (field, since 0.4.0): Stretch multiplied by the screen-projected velocity in the Streak look.
  - returns f64
- `pub spin: ToonVfxRange` (field, since 0.4.0): Rotation angle per second. (radians, the Streak look follows the velocity direction so it does not rotate)
  - returns ToonVfxRange
- `pub floor: Option<f64>` (field, since 0.4.0): Floor height to stop at. (when None, is_grounded is checked)
  - returns Option<f64>
- `pub is_grounded: bool` (field, since 0.4.0): Whether to stop at the floor height of the emission point.
  - returns bool
- `pub brightness: f64` (field, since 0.4.0): Brightness multiplier. (the per-look set_look_gain multiplier is also applied)
  - returns f64
- `pub alpha: f64` (field, since 0.4.0): Opacity.
  - returns f64
- `pub fade_in: f64` (field, since 0.4.0): Fade-in fraction. (goes from faint to solid over this fraction of the age)
  - returns f64
- `pub rim: f64` (field, since 0.4.0): Rim of the light look. (0 is additive light only, 1 covers with the rim color, negative is a faintly covering halo)
  - returns f64
- `pub age: f64` (field, since 0.4.0): Seconds already elapsed. (if negative, delayed by that much)
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (not emitted if the key was already emitted)
  - returns Option<u64>

## ToonFireballOptions (struct) (Clone, Copy, Debug, Default)

Fireball options.

Example: A fireball that swells, cools and rises

```rust
use vanilla::{ToonFireballOptions, ToonVfx};

fn add_barrel_explosion(vfx: &mut ToonVfx) {
	vfx.set_ramps(&[vec!["#ffffff", "#ffe080", "#ff8020", "#801808", "#200804"]]);
	vfx.add_fireball(&ToonFireballOptions { position: [0.0, 1.0, 0.0], radius: 1.2, life: 1.5, ramp: 0, rise: 1.0, grow_seconds: 0.25, boil: 0.4, smoke_color: [0.2, 0.18, 0.16], key: Some(3), ..ToonFireballOptions::default() });
}
```

- `pub position: [f64; 3]` (field, since 0.4.0): Center.
  - returns [f64; 3]
- `pub radius: f64` (field, since 0.4.0): Fully expanded radius. (grows a further 1.25 times by the end)
  - returns f64
- `pub life: f64` (field, since 0.4.0): Lifetime in seconds.
  - returns f64
- `pub ramp: i32` (field, since 0.4.0): Ramp row of the fire.
  - returns i32
- `pub smoke_color: [f64; 3]` (field, since 0.4.0): Smoke color that covers it as it cools.
  - returns [f64; 3]
- `pub rise: f64` (field, since 0.4.0): Height it rises over its life.
  - returns f64
- `pub grow_seconds: f64` (field, since 0.4.0): Expansion time in seconds. (from 0.25 times the radius to 1 times)
  - returns f64
- `pub boil: f64` (field, since 0.4.0): How much the surface boils.
  - returns f64
- `pub rim: f64` (field, since 0.4.0): Cover look fraction. (0 is additive light only, 1 covers the body and paints the edge with the rim color)
  - returns f64
- `pub age: f64` (field, since 0.4.0): Seconds already elapsed. (if negative, delayed by that much)
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (not emitted if the key was already emitted)
  - returns Option<u64>

## ToonShockwaveOptions (struct) (Clone, Copy, Debug, Default)

Shockwave ring options.

Example: A shockwave band that spreads a little later and curls up

```rust
use vanilla::{ToonShockwaveOptions, ToonVfx};

fn add_shockwave(vfx: &mut ToonVfx) {
	vfx.add_shockwave(&ToonShockwaveOptions { x: 0.0, z: 0.0, start_radius: 0.2, end_radius: 4.0, width: 0.8, life: 0.7, ramp: 0, color: [1.0, 0.9, 0.7], lift: 0.4, delay: 0.05, rim: 0.5, ..ToonShockwaveOptions::default() });
}
```

- `pub x: f64` (field, since 0.4.0): Center position. (height is the ground height)
  - returns f64
- `pub z: f64` (field, since 0.4.0): z of the center position.
  - returns f64
- `pub start_radius: f64` (field, since 0.4.0): Start and end radius of the spread. (spreads fast, then slowly)
  - returns f64
- `pub end_radius: f64` (field, since 0.4.0): End radius of the spread.
  - returns f64
- `pub width: f64` (field, since 0.4.0): Band width. (thins to 0.55 times with age and does not exceed the radius)
  - returns f64
- `pub life: f64` (field, since 0.4.0): Lifetime in seconds. (counted after delay)
  - returns f64
- `pub ramp: i32` (field, since 0.4.0): Ramp row.
  - returns i32
- `pub color: [f64; 3]` (field, since 0.4.0): Color multiplied by the ramp color.
  - returns [f64; 3]
- `pub lift: f64` (field, since 0.4.0): Height the outer edge curls up.
  - returns f64
- `pub height: f64` (field, since 0.4.0): Height lifted above the floor.
  - returns f64
- `pub delay: f64` (field, since 0.4.0): Delay in seconds before it starts spreading.
  - returns f64
- `pub rim: f64` (field, since 0.4.0): Cover look fraction. (0 is additive light only, 1 covers the ring body with the rim color and the core with the color)
  - returns f64
- `pub age: f64` (field, since 0.4.0): Seconds already elapsed. (if negative, delayed by that much)
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (not emitted if the key was already emitted)
  - returns Option<u64>

## ToonDecalOptions (struct) (Clone, Copy, Debug, Default)

Floor decal options. (queue_decal uses heat instead of age)

Example: Soot that spreads and cools, and a flickering stain

```rust
use vanilla::{ToonDecalOptions, ToonVfx, ToonVfxDecalMode, ToonVfxSlot};

fn add_decals(vfx: &mut ToonVfx) {
	vfx.add_decal(&ToonDecalOptions { x: 0.0, z: 0.0, radius: 1.5, start_radius: Some(0.4), grow_seconds: 0.3, life: 10.0, heat_seconds: 2.0, slot: ToonVfxSlot::Scorch, mode: ToonVfxDecalMode::Scorch, ramp: 0, ..ToonDecalOptions::default() });
	vfx.add_decal(&ToonDecalOptions { x: 3.0, z: 0.0, radius: 0.8, life: 6.0, mode: ToonVfxDecalMode::Stain, tint: [0.2, 0.45, 0.1], alpha: 0.7, flicker: 0.25, ..ToonDecalOptions::default() });
}
```

- `pub x: f64` (field, since 0.4.0): Center position. (height is the ground height)
  - returns f64
- `pub z: f64` (field, since 0.4.0): z of the center position.
  - returns f64
- `pub radius: f64` (field, since 0.4.0): Radius. (the radius reached by spreading from start_radius over grow_seconds)
  - returns f64
- `pub start_radius: Option<f64>` (field, since 0.4.0): Radius it starts spreading from. (radius when None)
  - returns Option<f64>
- `pub grow_seconds: f64` (field, since 0.4.0): Spread time in seconds. (0 for radius from the start)
  - returns f64
- `pub life: f64` (field, since 0.4.0): Lifetime in seconds. (fades over the last 1 second)
  - returns f64
- `pub heat_seconds: f64` (field, since 0.4.0): Time in seconds for the heat to cool. (0 for no heat)
  - returns f64
- `pub slot: ToonVfxSlot` (field, since 0.4.0): Atlas slot to draw.
  - returns ToonVfxSlot
- `pub mode: ToonVfxDecalMode` (field, since 0.4.0): Decal mode.
  - returns ToonVfxDecalMode
- `pub ramp: i32` (field, since 0.4.0): Ramp row for heat, glow and ring. (Read by the Scorch, Glow and Ring modes)
  - returns i32
- `pub tint: [f64; 3]` (field, since 0.4.0): Color. (multiplied by the ramp color for glow and ring, Stain and Sheen are covered with this color)
  - returns [f64; 3]
- `pub alpha: f64` (field, since 0.4.0): Opacity.
  - returns f64
- `pub angle: Option<f64>` (field, since 0.4.0): Rotation. (when None, random for add_decal and 0 for queue_decal)
  - returns Option<f64>
- `pub ring: [f64; 4]` (field, since 0.4.0): (ring radius, ring width, noise fineness, flow speed) of the Ring mode. (fractions of the radius)
  - returns [f64; 4]
- `pub heat: f64` (field, since 0.4.0): Heat for queue_decal. (0 ~ 1)
  - returns f64
- `pub seed: Option<f64>` (field, since 0.4.0): Noise seed. (when None, random for add_decal and 0 for queue_decal)
  - returns Option<f64>
- `pub flicker: f64` (field, since 0.4.0): Flicker half period in seconds. (none at 0, fades every other half period)
  - returns f64
- `pub age: f64` (field, since 0.4.0): Seconds already elapsed. (read only by add_decal, if negative, delayed by that much)
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (read only by add_decal, not emitted if the key was already emitted)
  - returns Option<u64>

## ToonBlobShadowOptions (struct) (Clone, Copy, Debug, Default)

Foot shadow options. (shade fading roundly outward from alpha at the center)

Example: Submit a shadow under each character's feet every frame

```rust
use vanilla::{Matrix4, ToonBlobShadowOptions, ToonVfx, Vector3};

fn draw_blob_shadows(gl: &vanilla::GlContext, vfx: &mut ToonVfx) {
	let view_matrix = Matrix4::create_look_at(Vector3::create(0.0, 4.0, 6.0), Vector3::create(0.0, 0.0, 0.0), Vector3::create(0.0, 1.0, 0.0));
	let projection_matrix = Matrix4::create_perspective(std::f64::consts::FRAC_PI_4, 1.0, 0.1, 100.0);
	let character_positions = [[0.0, 0.0], [1.5, -0.5], [-1.0, 1.0]];
	for position in character_positions {
		vfx.queue_blob_shadow(&ToonBlobShadowOptions { x: position[0], z: position[1], radius: 0.5, ..ToonBlobShadowOptions::default() });
	}
	vfx.draw(gl, &view_matrix, &projection_matrix);
}
```

- `pub x: f64` (field, since 0.4.0): Center position. (height is the ground height)
  - returns f64
- `pub z: f64` (field, since 0.4.0): z of the center position.
  - returns f64
- `pub radius: f64` (field, since 0.4.0): Radius.
  - returns f64
- `pub alpha: f64` (field, since 0.4.0): Center opacity.
  - returns f64

## ToonPlumeOptions (struct) (Clone, Copy, Debug, Default)

Smoke plume options.

Example: A smoke column rising after a big explosion

```rust
use vanilla::{ToonPlumeOptions, ToonVfx};

fn add_blast_plume(vfx: &mut ToonVfx) {
	vfx.add_plume(&ToonPlumeOptions { x: 0.0, z: 0.0, height: 4.0, cap_radius: Some(1.6), stem_radius: Some(0.35), life: 5.0, ramp: 0, smoke_color: [0.3, 0.28, 0.26], key: Some(9), ..ToonPlumeOptions::default() });
}
```

- `pub x: f64` (field, since 0.4.0): Base position. (height is the ground height)
  - returns f64
- `pub z: f64` (field, since 0.4.0): z of the base position.
  - returns f64
- `pub height: f64` (field, since 0.4.0): Column height.
  - returns f64
- `pub cap_radius: Option<f64>` (field, since 0.4.0): Cap radius. (0.4 of the height when None)
  - returns Option<f64>
- `pub stem_radius: Option<f64>` (field, since 0.4.0): Stem radius. (0.1 of the height when None)
  - returns Option<f64>
- `pub life: f64` (field, since 0.4.0): Lifetime in seconds.
  - returns f64
- `pub ramp: i32` (field, since 0.4.0): Ramp row for the glowing underside of the cap.
  - returns i32
- `pub smoke_color: [f64; 3]` (field, since 0.4.0): Smoke color.
  - returns [f64; 3]
- `pub age: f64` (field, since 0.4.0): Seconds already elapsed. (if negative, delayed by that much)
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (not emitted if the key was already emitted)
  - returns Option<u64>

## ToonBeamOptions (struct) (Clone, Copy, Debug, Default)

Revolved beam options. (the grain flows from start toward end)

Example: A beam with two layers, a white core and a ramp shell

```rust
use vanilla::{Matrix4, ToonBeamOptions, ToonVfx, Vector3};

fn draw_beam(gl: &vanilla::GlContext, vfx: &mut ToonVfx) {
	let view_matrix = Matrix4::create_look_at(Vector3::create(4.0, 3.0, 4.0), Vector3::create(0.0, 1.0, -4.0), Vector3::create(0.0, 1.0, 0.0));
	let projection_matrix = Matrix4::create_perspective(std::f64::consts::FRAC_PI_4, 1.0, 0.1, 100.0);
	let start = [0.0, 1.0, 0.0];
	let end = [0.0, 1.0, -8.0];
	vfx.queue_beam(&ToonBeamOptions { start, end, radius: 0.12, is_core: true, alpha: 1.0, brightness: 1.5, ..ToonBeamOptions::default() });
	vfx.queue_beam(&ToonBeamOptions { start, end, radius: 0.3, alpha: 0.8, ramp: 0, wobble: 0.15, flow_speed: 6.0, grain_repeat: 0.6, seed: 2.0, ..ToonBeamOptions::default() });
	vfx.draw(gl, &view_matrix, &projection_matrix);
}
```

- `pub start: [f64; 3]` (field, since 0.4.0): Start and end of the axis.
  - returns [f64; 3]
- `pub end: [f64; 3]` (field, since 0.4.0): End of the axis.
  - returns [f64; 3]
- `pub radius: f64` (field, since 0.4.0): Radius.
  - returns f64
- `pub is_core: bool` (field, since 0.4.0): White light if core, otherwise the outer layer of the ramp.
  - returns bool
- `pub alpha: f64` (field, since 0.4.0): Opacity.
  - returns f64
- `pub brightness: f64` (field, since 0.4.0): Brightness multiplier.
  - returns f64
- `pub ramp: i32` (field, since 0.4.0): Ramp row of the outer sheath.
  - returns i32
- `pub wobble: f64` (field, since 0.4.0): Surface wobble amount. (multiplied by the radius)
  - returns f64
- `pub flow_speed: f64` (field, since 0.4.0): Flow speed of the grain.
  - returns f64
- `pub grain_repeat: f64` (field, since 0.4.0): Grain per unit of length.
  - returns f64
- `pub time: Option<f64>` (field, since 0.4.0): Time for the grain and wobble. (this system's clock when None)
  - returns Option<f64>
- `pub seed: f64` (field, since 0.4.0): Noise seed.
  - returns f64

## ToonRibbonOptions (struct) (Clone, Debug, Default)

Ribbon options. (a strip spreading a point sequence toward the camera)

Example: A swing trail as a blur ribbon and an additive light ribbon

```rust
use vanilla::{ToonRibbonOptions, ToonVfx};

fn queue_swing_trail(vfx: &mut ToonVfx) {
	let trail_points = vec![[-1.0, 1.0, 0.0], [-0.5, 1.3, -0.4], [0.0, 1.4, -0.6], [0.5, 1.3, -0.4], [1.0, 1.0, 0.0]];
	vfx.queue_ribbon(ToonRibbonOptions { points: trail_points.clone(), width: 0.25, taper: 1.0, alpha: 1.0, brightness: 1.2, glow: Some([0.4, 0.8, 1.0]), ..ToonRibbonOptions::default() });
	let flow = vfx.get_time() * 4.0;
	vfx.queue_ribbon(ToonRibbonOptions { points: trail_points, width: 0.1, color: [1.0, 0.9, 0.6], alpha: 0.8, grain_repeat: 2.0, flow: Some(flow), ..ToonRibbonOptions::default() });
}
```

- `pub points: Vec<[f64; 3]>` (field, since 0.4.0): Point list. (two or more)
  - returns Vec<[f64; 3]>
- `pub width: f64` (field, since 0.4.0): Width.
  - returns f64
- `pub taper: f64` (field, since 0.4.0): 0 is a uniform width, 1 makes both ends 0.
  - returns f64
- `pub color: [f64; 3]` (field, since 0.4.0): Color. ([r, g, b] in 0 ~ 1, multiplied by the ramp color if there is a ramp)
  - returns [f64; 3]
- `pub ramp: i32` (field, since 0.4.0): Ramp row. (-1 for color only)
  - returns i32
- `pub alpha: f64` (field, since 0.4.0): Opacity.
  - returns f64
- `pub brightness: f64` (field, since 0.4.0): Brightness multiplier.
  - returns f64
- `pub grain_repeat: f64` (field, since 0.4.0): Grain per unit of length.
  - returns f64
- `pub flow: Option<f64>` (field, since 0.4.0): Grain position. (this system's clock when None)
  - returns Option<f64>
- `pub glow: Option<[f64; 3]>` (field, since 0.4.0): Glow color. (when given, covers with a white core, that color around it and the rim color at the edges, additive light when None)
  - returns Option<[f64; 3]>
- `pub rim: f64` (field, since 0.4.0): Cover look fraction. (without a glow color, covers the body with the rim color and the core with the color, 0 is additive light only)
  - returns f64

## ToonLightningOptions (struct) (Clone, Copy, Debug, Default)

Lightning options. (several ribbons winding down around the axis)

Example: Three lightning bolts striking this frame, and lightning that lives 0.4 seconds while re-bending

```rust
use vanilla::{ToonLightningOptions, ToonVfx};

fn strike(vfx: &mut ToonVfx) {
	vfx.queue_lightning(&ToonLightningOptions { start: [0.0, 4.0, 0.0], end: [0.0, 0.0, 0.0], radius: 0.15, count: 3, width: 0.06, turns: 1.5, color: [0.8, 0.9, 1.0], alpha: 1.0, brightness: 1.5, seed: Some(7.0), ..ToonLightningOptions::default() });
	vfx.add_lightning(&ToonLightningOptions { start: [0.0, 4.0, 0.0], end: [0.5, 0.0, 0.2], life: 0.4, count: 2, width: 0.08, radius: 0.2, glow: Some([0.5, 0.7, 1.0]), key: Some(5), ..ToonLightningOptions::default() });
}
```

- `pub start: [f64; 3]` (field, since 0.4.0): Start and end of the axis.
  - returns [f64; 3]
- `pub end: [f64; 3]` (field, since 0.4.0): End of the axis.
  - returns [f64; 3]
- `pub radius: f64` (field, since 0.4.0): Winding radius.
  - returns f64
- `pub count: u32` (field, since 0.4.0): Number of ribbons wound along it.
  - returns u32
- `pub width: f64` (field, since 0.4.0): Ribbon width. (0.7 ~ 1.3 times per ribbon)
  - returns f64
- `pub turns: f64` (field, since 0.4.0): Winding turns.
  - returns f64
- `pub color: [f64; 3]` (field, since 0.4.0): Ribbon color. ([r, g, b] in 0 ~ 1, multiplied by the ramp color if there is a ramp)
  - returns [f64; 3]
- `pub ramp: i32` (field, since 0.4.0): Ramp row of the ribbons. (-1 for color only)
  - returns i32
- `pub alpha: f64` (field, since 0.4.0): Opacity of the ribbons.
  - returns f64
- `pub brightness: f64` (field, since 0.4.0): Brightness multiplier of the ribbons.
  - returns f64
- `pub time: Option<f64>` (field, since 0.4.0): Time of the kinks. (this system's clock when None, add_lightning always uses this system's clock)
  - returns Option<f64>
- `pub seed: Option<f64>` (field, since 0.4.0): Seed. (when None, 0 for queue_lightning and random for add_lightning)
  - returns Option<f64>
- `pub glow: Option<[f64; 3]>` (field, since 0.4.0): Glow color of the ribbons.
  - returns Option<[f64; 3]>
- `pub life: f64` (field, since 0.4.0): Life in seconds and age. (read only by add_lightning, if the age is negative it appears that much later)
  - returns f64
- `pub age: f64` (field, since 0.4.0): Age. (Read only by add_lightning, appears that much later if negative)
  - returns f64
- `pub rim: f64` (field, since 0.4.0): Cover look fraction of the ribbons.
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (read only by add_lightning, not emitted if the key was already emitted)
  - returns Option<u64>

## ToonGlintOptions (struct) (Clone, Copy, Debug, Default)

Glint options. (the same look as particles, in place without an age)

Example: Light rays twinkling over a gem every frame

```rust
use vanilla::{ToonGlintOptions, ToonVfx, ToonVfxLook};

fn queue_gem_glint(vfx: &mut ToonVfx) {
	vfx.set_glint_capacity(32);
	let twinkle = 0.5 + 0.5 * (vfx.get_time() * 6.0).sin();
	vfx.queue_glint(&ToonGlintOptions { position: [0.5, 1.2, 0.0], size: 0.4 * twinkle, look: ToonVfxLook::Star, color: [1.0, 0.95, 0.7], angle: 0.3, brightness: 1.5, ..ToonGlintOptions::default() });
}
```

- `pub position: [f64; 3]` (field, since 0.4.0): Its position.
  - returns [f64; 3]
- `pub size: f64` (field, since 0.4.0): Size.
  - returns f64
- `pub color: [f64; 3]` (field, since 0.4.0): Color. ([r, g, b] in 0 ~ 1, multiplied by the ramp color if there is a ramp)
  - returns [f64; 3]
- `pub ramp: i32` (field, since 0.4.0): Ramp row. (none if -1)
  - returns i32
- `pub look: ToonVfxLook` (field, since 0.4.0): Look.
  - returns ToonVfxLook
- `pub brightness: f64` (field, since 0.4.0): Brightness multiplier. (the per-look set_look_gain multiplier is also applied)
  - returns f64
- `pub alpha: f64` (field, since 0.4.0): Opacity.
  - returns f64
- `pub angle: f64` (field, since 0.4.0): Rotation. (radians)
  - returns f64
- `pub rim: f64` (field, since 0.4.0): Same as the particle rim.
  - returns f64

## ToonFlashOptions (struct) (Clone, Copy, Debug, Default)

Screen flash options. (briefly covers the viewport with that color and quickly clears)

Example: Briefly cover the screen with light on an explosion

```rust
use vanilla::{ToonFlashOptions, ToonVfx};

fn flash_on_blast(vfx: &mut ToonVfx) {
	vfx.add_flash(&ToonFlashOptions { color: [1.0, 0.9, 0.7], strength: 0.6, life: 0.12, key: Some(9), ..ToonFlashOptions::default() });
}
```

- `pub color: [f64; 3]` (field, since 0.4.0): Covering color.
  - returns [f64; 3]
- `pub strength: f64` (field, since 0.4.0): Initial cover fraction.
  - returns f64
- `pub life: f64` (field, since 0.4.0): Fade-out time in seconds.
  - returns f64
- `pub age: f64` (field, since 0.4.0): Age. (if negative, appears that much later)
  - returns f64
- `pub key: Option<u64>` (field, since 0.4.0): Event key. (not emitted if the key was already emitted)
  - returns Option<u64>

## ToonRampColor (trait)

Color of one ramp cell. ("#rrggbb" text or [r, g, b] in 0 ~ 1, the original setRamps accepts both)

Example: Reading a color string and 0 ~ 1 numbers as the same color

```rust
use vanilla::ToonRampColor;

let from_text = "#ff8000".read_ramp_color();
let values: [f64; 3] = [1.0, 0.5, 0.0];
let from_values = values.read_ramp_color();
assert_eq!(from_text[0], 1.0);
assert!((from_text[1] - from_values[1]).abs() < 0.01);
assert_eq!(from_text[2], from_values[2]);
```

- `fn read_ramp_color(&self) -> [f64; 3]` (method, since 0.4.0): Reads [r, g, b] in 0 ~ 1.
  - returns [f64; 3]: [r, g, b] in 0 ~ 1.

## ToonVfxCounts (struct) (Clone, Copy, Debug, Default, PartialEq, Eq)

Number of active effects.

Example: Check whether all effects have disappeared

```rust
use vanilla::{ToonFireballOptions, ToonParticleOptions, ToonVfx, ToonVfxRange};

fn is_quiet_after_one_second(vfx: &mut ToonVfx) -> bool {
	vfx.add_fireball(&ToonFireballOptions { position: [0.0, 1.0, 0.0], radius: 1.0, life: 0.5, ..ToonFireballOptions::default() });
	vfx.emit_particles(&ToonParticleOptions { count: 10, position: [0.0, 1.0, 0.0], life: ToonVfxRange::from(0.3), ..ToonParticleOptions::default() });
	vfx.update(1.0);
	let counts = vfx.get_active_counts();
	counts.particle_count == 0 && counts.fireball_count == 0
}
```

- `pub particle_count: usize` (field, since 0.4.0): Particle slots that may still be alive.
  - returns usize
- `pub fireball_count: usize` (field, since 0.4.0): Fireballs. (add_fireball)
  - returns usize
- `pub shockwave_count: usize` (field, since 0.4.0): Shockwave rings. (add_shockwave)
  - returns usize
- `pub decal_count: usize` (field, since 0.4.0): Floor decals. (add_decal, those passed with queue_decal are not counted)
  - returns usize
- `pub plume_count: usize` (field, since 0.4.0): Smoke plumes. (add_plume)
  - returns usize
- `pub lightning_count: usize` (field, since 0.4.0): Lightning that re-bends during its life. (add_lightning)
  - returns usize
- `pub flash_count: usize` (field, since 0.4.0): Screen flashes. (add_flash)
  - returns usize

## ToonVfx (struct)

Base of toon 3D GPU effects. (see the header comment)

Example: Show an explosion effect over a toon scene and draw one frame

```rust
use vanilla::{create_box_geometry, Matrix4, MeshBuilder, ToonDecalOptions, ToonDrawOptions, ToonFireballOptions, ToonParticleOptions, ToonPartOptions, ToonRenderer, ToonShockwaveOptions, ToonVfx, ToonVfxDecalMode, ToonVfxLook, ToonVfxRange, ToonVfxShape, Vector3, TOON_VFX_DEFAULT_PARTICLE_CAPACITY};

fn draw_explosion(gl: &vanilla::GlContext) -> Result<(), String> {
	let mut renderer = ToonRenderer::new(gl)?;
	let mut builder = MeshBuilder::new();
	builder.add_part(&create_box_geometry(8.0, 0.2, 8.0), &Matrix4::create_translation(0.0, -0.1, 0.0), "#708090", ToonPartOptions { has_outline: false, ..ToonPartOptions::default() });
	let floor_mesh = renderer.create_mesh(gl, &builder.read_arrays()).ok_or("floor mesh")?;
	let mut vfx = ToonVfx::new(gl, TOON_VFX_DEFAULT_PARTICLE_CAPACITY)?;
	vfx.set_ramps(&[vec!["#ffffff", "#ffe080", "#ff8020", "#a02010", "#301008"]]);
	vfx.prepare(gl);
	vfx.add_fireball(&ToonFireballOptions { position: [0.0, 0.8, 0.0], radius: 0.9, life: 1.2, ramp: 0, ..ToonFireballOptions::default() });
	vfx.add_shockwave(&ToonShockwaveOptions { end_radius: 3.0, life: 0.6, ramp: 0, ..ToonShockwaveOptions::default() });
	vfx.add_decal(&ToonDecalOptions { radius: 1.4, life: 8.0, heat_seconds: 1.5, mode: ToonVfxDecalMode::Scorch, ramp: 0, ..ToonDecalOptions::default() });
	vfx.emit_particles(&ToonParticleOptions { count: 40, position: [0.0, 0.6, 0.0], shape: ToonVfxShape::Sphere, radius: 0.3, speed: ToonVfxRange::new(2.0, 5.0), gravity: 6.0, size: ToonVfxRange::new(0.05, 0.12), life: ToonVfxRange::new(0.4, 0.9), look: ToonVfxLook::Streak, stretch: 0.05, ramp: 0, is_grounded: true, ..ToonParticleOptions::default() });
	let view_matrix = Matrix4::create_look_at(Vector3::create(4.0, 3.0, 5.0), Vector3::create(0.0, 0.5, 0.0), Vector3::create(0.0, 1.0, 0.0));
	let projection_matrix = Matrix4::create_perspective(std::f64::consts::FRAC_PI_4, 1.0, 0.1, 100.0);
	vfx.update(1.0 / 60.0);
	renderer.begin_frame_with_matrices(gl, &view_matrix, &projection_matrix);
	renderer.draw_mesh(gl, &floor_mesh, &Matrix4::create_identity(), ToonDrawOptions::default());
	renderer.end_frame(gl);
	vfx.draw(gl, &view_matrix, &projection_matrix);
	Ok(())
}
```

- `pub fn read_program_sources() -> Vec<(String, String)>` (static, since 0.4.0): Shader sources. (eight (vertex, fragment) pairs: particle, fireball, ring, decal, beam, plume, ribbon, flash, with the common fragment code inserted)
  - returns Vec<(String, String)>: List of (vertex, fragment) shader sources. (In the order particle, fireball, ring, decal, beam, plume, ribbon, flash, with the common chunks inserted)
- `pub fn new(gl: &GlContext, particle_capacity: usize) -> Result<ToonVfx, String>` (constructor, since 0.4.0): Constructor. (builds the shaders, meshes and particle buffer, the atlas on the first draw, the capacity is the number of particles alive at once)
  - `gl` &GlContext: GL context to draw effects with.
  - `particle_capacity` usize: Maximum number of particles alive at once. (Raised to at least 1, the original default is TOON_VFX_DEFAULT_PARTICLE_CAPACITY)
  - returns Result<ToonVfx, String>: Effect base. Err(error text) if shaders, buffers or vertex arrays cannot be built.
- `pub fn set_ramps<C: ToonRampColor>(&mut self, ramp_list: &[Vec<C>])` (method, since 0.4.0): Sets the color ramps. (each row is "#rrggbb" or [r, g, b] in 0 ~ 1 going from a white core to dark, up to eight rows, an effect's ramp follows this order, one default row if empty)
  - `ramp_list` &[Vec<C>]: Colors per row going from a white core into darkness. (Up to eight rows, empty rows are dropped)
- `pub fn prepare(&mut self, gl: &GlContext)` (method, since 0.4.0): Prebuilds the atlas. (so it does not stall on the first burst)
  - `gl` &GlContext: GL context.
- `pub fn set_particle_capacity(&mut self, particle_capacity: usize)` (method, since 0.4.0): Sets the particle cap. (Clears alive particles)
  - `particle_capacity` usize: Upper limit of particles alive at once. (1 or more)
- `pub fn get_particle_capacity(&self) -> usize` (method, since 0.4.0): Returns the particle cap.
  - returns usize: Maximum number of particles alive at once.
- `pub fn set_count_ratio(&mut self, count_ratio: f64)` (method, since 0.4.0): Sets the emitted particle count fraction. (reduces only the count on phones or the lite path, 0 ~ 1, at least one when emitting)
  - `count_ratio` f64: Fraction multiplied into the number of particles emitted. (0 ~ 1)
- `pub fn get_count_ratio(&self) -> f64` (method, since 0.4.0): Returns the emitted particle count fraction.
  - returns f64: Fraction multiplied into the number of particles emitted. (0 ~ 1)
- `pub fn set_glint_capacity(&mut self, glint_capacity: usize)` (method, since 0.4.0): Sets the glint cap. (number passed with queue_glint per frame, default 96, clears the glints passed this frame)
  - `glint_capacity` usize: Upper limit of light points submitted per frame. (1 or more)
- `pub fn get_glint_capacity(&self) -> usize` (method, since 0.4.0): Returns the glint cap.
  - returns usize: Upper limit of light points submitted per frame.
- `pub fn set_look_gain(&mut self, look: ToonVfxLook, gain: f64)` (method, since 0.4.0): Sets the brightness gain per look. (multiplied into particle and glint brightness, default 1)
  - `look` ToonVfxLook: Look. (ToonVfxLook)
  - `gain` f64: Brightness multiplier. (0 or more, default 1)
- `pub fn get_look_gain(&self, look: ToonVfxLook) -> f64` (method, since 0.4.0): Returns the brightness gain per look.
  - `look` ToonVfxLook: Look. (ToonVfxLook)
  - returns f64: Brightness multiplier of that look.
- `pub fn register_event_key(&mut self, key: Option<u64>) -> bool` (method, since 0.4.0): Records an event key. (Always true if there is no key, records it and returns true for a new key, false for an already emitted key, forgotten by clear)
  - `key` Option<u64>: Event key. (Always fires if None)
  - returns bool: true if it may fire, false if the key already fired.
- `pub fn set_rim_color(&mut self, rim_color: [f64; 3])` (method, since 0.4.0): Sets the effect rim color. ([r, g, b] 0 ~ 1, edges of rimmed particles and glow ribbons, default is ToonRenderer's default outline color)
  - `rim_color` [f64; 3]: Rim color. ([r, g, b] 0 ~ 1)
- `pub fn get_rim_color(&self) -> [f64; 3]` (method, since 0.4.0): Returns the effect rim color.
  - returns [f64; 3]: Color of the effect rim. ([r, g, b] 0 ~ 1)
- `pub fn set_floor_height_reader(&mut self, floor_height_reader: Option<Box<dyn Fn(f64, f64) -> f64>>)` (method, since 0.4.0): Sets the floor height reader function. ((x, z) → height, 0 when None)
  - `floor_height_reader` Option<Box<dyn Fn(f64, f64) -> f64>>: Function returning the floor height for (x, z). (Always 0 if None)
- `pub fn read_floor_height(&self, x: f64, z: f64) -> f64` (method, since 0.4.0): Floor height at that position.
  - `x` f64: Scene x.
  - `z` f64: Scene z.
  - returns f64: Floor height at that position.
- `pub fn get_time(&self) -> f64` (method, since 0.4.0): This base's clock. (Seconds)
  - returns f64: Clock of this base. (Seconds, advanced by update)
- `pub fn get_active_counts(&self) -> ToonVfxCounts` (method, since 0.4.0): Number of active effects.
  - returns ToonVfxCounts: Number of live effects. (ToonVfxCounts)
- `pub fn clear(&mut self)` (method, since 0.4.0): Clears everything. (When the board changes, also forgets event keys)
- `pub fn clear_queue(&mut self)` (method, since 0.4.0): Clears the items passed this frame. (After drawing)
- `pub fn update(&mut self, delta_time: f64)` (method, since 0.4.0): Ages one frame. (Advances the clock, removes finished fireballs, rings, decals, plumes, lightning and flashes, damps the shake)
  - `delta_time` f64: Seconds.
- `pub fn emit_particles(&mut self, options: &ToonParticleOptions)` (method, since 0.4.0): Emits particles. (if floor is given they stop at that height, with is_grounded at the floor height of the emission point)
  - `options` &ToonParticleOptions: Emission values. (ToonParticleOptions)
- `pub fn add_fireball(&mut self, options: &ToonFireballOptions)` (method, since 0.4.0): Adds a fireball. (a sphere boiling with noise swells, cools into smoke and rises)
  - `options` &ToonFireballOptions: Fireball values. (ToonFireballOptions)
- `pub fn add_shockwave(&mut self, options: &ToonShockwaveOptions)` (method, since 0.4.0): Adds a shockwave ring. (spreads fast then slowly, the outer edge curls up, tears and fades, the floor below briefly brightens, placed at floor height)
  - `options` &ToonShockwaveOptions: Shockwave values. (ToonShockwaveOptions)
- `pub fn add_decal(&mut self, options: &ToonDecalOptions)` (method, since 0.4.0): Adds a floor decal. (the scorch cools from heat and fades in the last 1 second, placed at floor height)
  - `options` &ToonDecalOptions: Decal values. (ToonDecalOptions)
- `pub fn queue_decal(&mut self, options: &ToonDecalOptions)` (method, since 0.4.0): Passes a floor decal drawn only this frame. (options.heat instead of age, rotation and seed are 0 if not given)
  - `options` &ToonDecalOptions: Decal values. (ToonDecalOptions, reads heat (0 ~ 1) instead of age)
- `pub fn queue_blob_shadow(&mut self, options: &ToonBlobShadowOptions)` (method, since 0.4.0): Passes a foot shadow drawn only this frame. (shade fading roundly outward from alpha at the center, placed at floor height)
  - `options` &ToonBlobShadowOptions: Shadow values. (ToonBlobShadowOptions)
- `pub fn add_plume(&mut self, options: &ToonPlumeOptions)` (method, since 0.4.0): Adds a smoke plume. (the stem rises, the cap curls up and grows, the underside of the cap glows hot then cools and fades, stands at floor height)
  - `options` &ToonPlumeOptions: Smoke plume values. (ToonPlumeOptions)
- `pub fn queue_beam(&mut self, options: &ToonBeamOptions)` (method, since 0.4.0): Passes a revolved beam drawn only this frame.
  - `options` &ToonBeamOptions: Beam values. (ToonBeamOptions, submitted only if radius and alpha are above 0)
- `pub fn queue_ribbon(&mut self, options: ToonRibbonOptions)` (method, since 0.4.0): Passes a ribbon drawn only this frame. (two or more points)
  - `options` ToonRibbonOptions: Ribbon values. (ToonRibbonOptions, submitted only with two or more points and width and alpha above 0)
- `pub fn queue_lightning(&mut self, options: &ToonLightningOptions)` (method, since 0.4.0): Passes this frame's lightning. (several ribbons winding down around the axis, re-kinks every 0.08 seconds, the same shape for the same time and seed)
  - `options` &ToonLightningOptions: Lightning values. (ToonLightningOptions, life, age and key are not read)
- `pub fn queue_glint(&mut self, options: &ToonGlintOptions)` (method, since 0.4.0): Passes a glint drawn only this frame. (up to set_glint_capacity, default 96)
  - `options` &ToonGlintOptions: Glint values. (ToonGlintOptions)
- `pub fn add_lightning(&mut self, options: &ToonLightningOptions)` (method, since 0.4.0): Adds lightning that re-kinks over its life. (passed with queue_lightning on every draw, fades in the last 0.1 seconds, if the age is negative it appears that much later)
  - `options` &ToonLightningOptions: Lightning values. (ToonLightningOptions, life, age and key are read too)
- `pub fn add_flash(&mut self, options: &ToonFlashOptions)` (method, since 0.4.0): Adds a screen flash. (briefly covers the viewport with that color and quickly clears)
  - `options` &ToonFlashOptions: Flash values. (ToonFlashOptions)
- `pub fn add_shake(&mut self, strength: f64)` (method, since 0.4.0): Adds camera shake. (Maximum offset in scene length, computed by the engine Shaker with two phase-shifted sine waves and exponential decay, the stronger one if already shaking)
  - `strength` f64: Maximum offset of the shake. (Scene length)
- `pub fn read_shake(&self) -> Vector2` (method, since 0.4.0): Current camera shake. (Scene length, x toward the camera's right and y toward the camera's up, added to both the camera position and the look-at point)
  - returns Vector2: Shake offset. (Scene length, x is the camera's right, y is the camera's up)
- `pub fn is_shaking(&self) -> bool` (method, since 0.4.0): Whether the camera is shaking.
  - returns bool: true while shaking.
- `pub fn draw(&mut self, gl: &GlContext, view_matrix: &Matrix4, projection_matrix: &Matrix4)` (method, since 0.4.0): Draws. (in the order floor decals, rings, smoke plumes, fireballs, beams, ribbons, particles, flashes, living lightning is passed as this frame's ribbons, passed items are cleared after drawing)
  - `gl` &GlContext: GL context.
  - `view_matrix` &Matrix4: View matrix of the camera.
  - `projection_matrix` &Matrix4: Projection matrix. (Perspective or orthographic)
- `pub fn destroy(&mut self, gl: &GlContext)` (method, since 0.4.0): Deletes after use.
  - `gl` &GlContext: GL context used at creation.

## Functions and constants

- `pub const TOON_VFX_MAXIMUM_RAMPS: usize = 8` (field, since 0.4.0): Maximum number of color ramp rows. (Eight rows in one ramp cell of the atlas)
  - returns usize
- `pub const TOON_VFX_DEFAULT_PARTICLE_CAPACITY: usize = 3000` (field, since 0.4.0): Default maximum number of particles alive at once.
  - returns usize

## ToonVfxSlot (enum) (Clone, Copy, Debug, PartialEq, Eq)

Cells of the atlas's right half. (the shader's readSlot index, 6, 7, 11 ~ 15 are empty)

- `Soft`: Soft grain.
- `Streak`: Flame streak. (The v 1 side is the head)
- `Star`: Light ray.
- `ShockBand`: Shock band.
- `BeamGrain`: Beam grain.
- `Scorch`: Scorch. (Alpha is the darkening cover fraction, the red channel is heat)
- `Ramps`: Eight color ramp rows.
- `Dent`: Cratered ground.
- `Glow`: Wide halo glow.

- `pub fn get_index(&self) -> usize` (method, since 0.4.0): Cell index.
  - returns usize: Cell number. (The readSlot number of the shader)

## ToonVfxLook (enum) (Clone, Copy, Debug, PartialEq, Eq)

Particle look. (same order as the shader's look index)

- `Soft`: Soft grain. (Additive light)
- `Streak`: Flame streak stretched along velocity. (Additive light, stretch is the stretch multiplied by velocity)
- `Smoke`: Smoke flipbook. (Covering)
- `Star`: Light ray. (Additive light)
- `Ember`: Flickering ember. (Additive light)
- `Glow`: Wide halo glow. (Additive light)
- `Grit`: Non-emissive rock and dirt grain. (Covering)

## ToonVfxShape (enum) (Clone, Copy, Debug, PartialEq, Eq)

Particle emission shape.

- `Point`: From one point in all directions.
- `Sphere`: Outward within a ball of radius radius.
- `Ring`: Outward on a ring parallel to the floor.
- `Disc`: Outward within a disc parallel to the floor.
- `Cone`: Cone within the spread angle centered on direction.
- `Line`: Toward direction, from a line along direction up to length (within radius around it).

## ToonVfxDecalMode (enum) (Clone, Copy, Debug, PartialEq, Eq)

Floor decal mode.

- `Scorch`: Darkens by alpha, and heat cools in the cracks of the red channel.
- `Glow`: Additive light by the cell's alpha.
- `Ring`: Noise rim flowing around the circumference. (ring is the radius fractions of (rim radius, rim width, noise fineness, flow speed))
- `Stain`: Covers with the tint color by the cell's alpha, and the cell's center density (around the rim) is tinted toward the rim color (set_rim_color). (stains on bright floors, frost)
- `Sheen`: Covers the cell's alpha body with tint and puts a white sheen around the body's edges. (Oil sheen)
- `Shade`: Shade fading roundly from the center outward. (darkens by alpha, ignores the cell, foot shadow queue_blob_shadow)
