Log inGet started
World

Procgen Effects Showcase

Branchmain
Branchesmain
Commit99ff90d12c

README.md

blast_puff

Soft, domain-warped-fBm sprite used for the blast's fire (mode 0, additive) and lit smoke and dust (mode 1, alpha). Each particle is a camera-facing card (zero_billboard) cut to a disc and turned by its seed. Two-octave fx_noise fBm warps the coordinates, a four-octave fBm and a finer two-octave fBm erode the disc from the rim, and the domain drifts with the particle's life so the edge curls as it ages. Per-particle colour, life, seed and glow arrive on data0/data1. The sprite is depth-faded against the scene (soft particles) over 1 unit wherever a surface lies behind it; over the sky it keeps its full opacity.

  • Mode 0 (fire) is brightest in the dense middle: the colour runs from 0.55 of the lane colour at the thin edge to 1.25 of it plus a warm (0.5, 0.32, 0.12) boost scaled by glow at the core. It returns the colour multiplied by its coverage, for additive blending.
  • Mode 1 (smoke and dust) lights a sphere normal bumped by the noise: wrapped sun light, half the ambient light, a rim catching the sun, self-shadowing from the noise, and an orange fire underlight (1.0, 0.4, 0.09) that grows with the square of glow on the underside and core.
  • A mode above 1.5 draws a debug ramp from blue to orange over world height 0 to 14.

The wall_blast graph (blast/wall_blast.procGraph) builds two materials from it: fire_mat (mode 0, additive) for the fireball and the white flash cards, and smoke_mat (mode 1, transparent) for the smoke column and cap, the smoke trailing behind flying rock, the dust puffs where rock lands and the dust ring rolling along the ground. The graph sizes each card from the particle's size and life and writes data1 as (life, a random value, a glow ramp over life, a constant erode bias).

The shader includes @builtin::shaderModules.billboard, fx_noise and zero::scene_depth.

Properties

PropertyTypeDefaultMeaning
modefloat0Look selector, range 0 to 1: below 0.5 fire, 0.5 to 1.5 smoke and dust.
vertexBoundsDilationfloat34How far the vertex hook moves a vertex past the mesh, in world units: the culling bounds grow by it so a moved vertex stays inside them.

Lanes

LaneCarries
data0.rgbColour; HDR for fire.
data0.aPeak opacity.
data1.xLife, 0 at birth to 1 at death; drifts the noise domain.
data1.ySeed: turns the card and offsets the noise.
data1.zGlow 0 to 1: the fire core boost in mode 0 and the fire underlight in mode 1.
data1.wErode bias, subtracted from the shape so a larger value thins the puff.