Skip to main content

Module effects

Module effects 

Source
Expand description

effects — motion + bloom for the facett look. Pure egui, glow backend only: everything here paints with layered alpha shapes on an egui::Painter, so it works without a custom GPU shader.

Three layers:

  1. easingt∈[0,1] → [0,1] tweens (cubic, back, elastic, bounce).
  2. bloom helpersglow_rect, glow_text, shimmer, and a tiny ParticleBurst.
  3. RavenSprite — the signature effect: a raven flies in along a bezier arc with ease-out and perches on a target egui::Rect, then idle-bobs.

§Where the GPU path lands later

True bloom (a bright-pass + separable Gaussian on a HDR target) and the raven as a textured/instanced sprite belong in the wgpu kernel (see .nornir/wgpu-plan.md): they’d replace the layered-alpha glow_rect / shape-painted raven here behind the same call sites. Until then this CPU path is the reference and is fully headless-testable.

Modules§

easing
t∈[0,1] → [0,1] tweening curves. Each is clamped at the ends so f(0.0) == 0.0 and f(1.0) == 1.0 exactly (the demo + tests rely on it).

Structs§

ParticleBurst
A tiny particle burst — circles fired outward from a point that fall under gravity and fade out. Deterministic given the same seed, so a test can pin it. Advance with ParticleBurst::update, render with ParticleBurst::paint.
RavenSprite
The signature effect. A stylized raven 🐦 (painted from shapes — no asset dependency, so it never goes missing) that flies in along a bezier arc with ease-out and perches on a target egui::Rect, then idle-bobs.

Constants§

RAVEN_FLIGHT_SECS
The flight duration (seconds) of a RavenSprite from launch to perch.

Functions§

glow_rect
Paint a soft bloom around rect: layers concentric rounded strokes that fade out as they expand. intensity∈[0,1] scales the alpha (e.g. animate it with a easing curve for a pulse). Cheap stand-in for true HDR bloom.
glow_text
Draw text at pos with a coloured glow halo behind it (offset copies in a ring), then the crisp text on top. glow is usually theme.glow.
shimmer
Paint an animated shimmer sweep across rect: a diagonal highlight band at phase t∈[0,1] (wrap t yourself, e.g. (time * speed).fract()). Built from a handful of vertical alpha bars, brightest at the band centre.