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:
easing—t∈[0,1] → [0,1]tweens (cubic, back, elastic, bounce).- bloom helpers —
glow_rect,glow_text,shimmer, and a tinyParticleBurst. RavenSprite— the signature effect: a raven flies in along a bezier arc with ease-out and perches on a targetegui::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 sof(0.0) == 0.0andf(1.0) == 1.0exactly (the demo + tests rely on it).
Structs§
- Particle
Burst - 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 withParticleBurst::update, render withParticleBurst::paint. - Raven
Sprite - 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
RavenSpritefrom launch to perch.
Functions§
- glow_
rect - Paint a soft bloom around
rect:layersconcentric rounded strokes that fade out as they expand.intensity∈[0,1]scales the alpha (e.g. animate it with aeasingcurve for a pulse). Cheap stand-in for true HDR bloom. - glow_
text - Draw
textatposwith a coloured glow halo behind it (offset copies in a ring), then the crisp text on top.glowis usuallytheme.glow. - shimmer
- Paint an animated shimmer sweep across
rect: a diagonal highlight band at phaset∈[0,1](wraptyourself, e.g.(time * speed).fract()). Built from a handful of vertical alpha bars, brightest at the band centre.