Skip to content

Add showcase presets (Lumen/Aurora/Bloom/Etching) with art defaults on - #46

Merged
tamirelazar merged 11 commits into
devfrom
feat/showcase-presets
Jun 19, 2026
Merged

Add showcase presets (Lumen/Aurora/Bloom/Etching) with art defaults on#46
tamirelazar merged 11 commits into
devfrom
feat/showcase-presets

Conversation

@tamirelazar

Copy link
Copy Markdown
Owner

Closes #36.

Adds four showcase presets that ship the merged art-direction levers ON via per-preset render/sim defaults, so opting into one gives an "alive" look out of the box.

Presets

  • Lumen — Bleuje-style front-lit veins: temporal accent recolor + sqrt deposit + afterglow, Slime palette.
  • Aurora — luminous network glow: soft Gaussian diffusion + restrained afterglow on a deep Ocean palette.
  • Bloom — banded coral depth via mirrored palette cycles, Warm palette.
  • Etching — directional filament linework via Sobel glyph selection (Braille, TUI-only).

Payload extension

Extends the per-preset RenderArtDefaults payload with temporal-color (strength/lag/mode/accent), palette, and charset — all Option/identity so the 30 existing presets stay byte-identical. CLI flags always override per-preset defaults; saved configs gain a temporal_accent field with serde-default back-compat.

Color correctness

Fixes a temporal accent-mode bug surfaced by these presets: an achromatic accent (or palette hot-end fallback) has a NaN OKLch hue, which the old linear hue interpolation propagated (NaN·0 = NaN), corrupting every temporal-on cell to its color complement. Now uses a NaN-safe short-arc hue lerp with endpoint short-circuits, and the accent defaults to the palette's own vivid stop so added front colors stay on the active gradient. Export paths now thread the resolved accent.

Tests

  • 3 new color regression tests (achromatic accent/base, exact endpoints).
  • 4 new golden files for the showcase presets; one pre-existing accent golden corrected by the fix.
  • All 30 existing presets verified byte-identical (51 existing goldens unchanged).
  • Gate: cargo fmt, cargo clippy --all-targets --all-features -- -D warnings, cargo test (850 lib + integration), cargo test --test visual_regression (55) — all green.

Notes

  • Etching's directional glyphs render only in a live TUI (Braille); exports/GIF gallery show its color but not glyphs.
  • Per-preset parameter values are a solid first pass and may be refined later.

Adds `Option<RgbColor>` accent param to `temporal_modulate` and
`colorize_subpixel`. When `None`, behavior is byte-identical to before.
Threads the parameter down through `TerminalRenderer::set_temporal`,
`FrameBuffer::from_downsampled` / `_at` / `create_cell`,
`render_colored_cell`, and `export::png::save_frame_as_png`.
All call sites pass `None`; visual regression unchanged (51/51).
Add Preset::Lumen, Aurora, Bloom, Etching to test_presets_valid so all
34 presets are covered by automated validation.

Also fixes a typo in the ReactiveSwarm FromStr arm: "reactive_swar" →
"reactive_swarm" (the trailing 'm' was missing, causing --preset
reactive_swarm to fail to parse).
Add visual regression golden tests for the four showcase presets
introduced in Task 6: lumen, aurora, bloom, and etching (braille).
Update README Gallery section from 30 to 34 presets and add
one-line descriptions for each new preset.
…export accent

temporal_modulate's Accent mode mixes the base color toward an accent in
OKLch. When the accent (or the palette hot-end fallback, e.g. Slime/Neon)
is achromatic, srgb_to_oklch returns a NaN ('powerless') hue; the old
linear interpolation oa.h + (ob.h - oa.h)*t then yields NaN for every t
(NaN*0 == NaN), so oklch_to_srgb produced garbage (green rendered as its
magenta complement) for every temporal-on cell, not just growing fronts.

- mix_oklch: short-circuit t<=0/t>=1 (no lossy round-trip) and interpolate
  hue via NaN-safe, short-arc lerp_hue (achromatic endpoint -> use the
  chromatic endpoint's hue, per CSS Color 4 missing-component rules).
- Hue mode: leave achromatic bases unchanged (no hue to rotate).
- Export paths (print/capture/gif/webm) now thread the resolved
  temporal_accent instead of hardcoding None, so hand-picked accents reach
  GIF/PNG output (and the ws6 gallery), matching the interactive renderer.

Regenerates the 4 showcase goldens and corrects the pre-existing
temporal_color_accent golden (was generated with the bug). 3 new regression
tests cover achromatic accent/base and exact endpoints.
…rk Aurora)

Keep every temporal-colored cell on the active palette's own gradient, per
the requirement that added front colors must agree with the palette:

- Accent-mode default accent now samples the palette's own vivid stop
  (palette_accent_color, brightness 0.85) instead of the hot end (1.0), which
  is white/desaturated on many palettes (Slime, Cosmic) and washed the front.
- All four showcase presets use Accent mode with palette-derived accents
  (temporal_accent: None); dropped the foreign hand-picked gold/cyan and the
  off-palette hue-mode drift (Aurora/Bloom were hue).
- Rework Aurora: deep Ocean palette + restrained afterglow (0.15) + higher
  white-point (max_brightness 26) so the luminous network reads against a dark
  body instead of washing to a pale fill.

Regenerates the 4 showcase goldens and temporal_color_accent (now reflects the
palette-derived accent). All existing presets remain byte-identical.
The lumen preset's temporal accent-mode render exercises the heaviest OKLch
float path (srgb_to_oklch -> mix -> oklch_to_srgb with cbrt/powf/atan2). One
cell in the seed-42 frame lands on a libm rounding boundary where macOS
(arm64) and Linux (x86_64) diverge by 1 ULP, flipping a u8 channel and thus
the golden bytes. CI runs on Linux, so the golden is pinned to Linux output
(regenerated in a rust:latest container). The other three showcase goldens
and temporal_color_accent are byte-identical across both platforms.
@tamirelazar
tamirelazar merged commit 79278da into dev Jun 19, 2026
3 checks passed
@tamirelazar
tamirelazar deleted the feat/showcase-presets branch June 19, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant