Skip to content

Add heat_haze effect — Canvas2D localized heat-shimmer with manifest, docs & tests#265

Open
smcga wants to merge 1 commit intomainfrom
codex/add-heat-haze-effect-to-renderer
Open

Add heat_haze effect — Canvas2D localized heat-shimmer with manifest, docs & tests#265
smcga wants to merge 1 commit intomainfrom
codex/add-heat-haze-effect-to-renderer

Conversation

@smcga
Copy link
Copy Markdown
Owner

@smcga smcga commented Apr 4, 2026

Motivation

  • Provide a lightweight, Canvas2D-first localized refractive “heat haze” effect that can be used as a layer or base scene and behaves organically with upward drift and micro-turbulence.
  • Keep performance friendly on mobile by avoiding full per-pixel getImageData work and reusing offscreen buffers.
  • Expose the effect in the existing registry/debug/docs system so it is selectable and documented like other effects.

Description

  • Implemented the effect in src/renderer/effects/heatHaze.ts as HeatHazeEffect, using an offscreen canvas and strip-based horizontal displacement driven by layered seeded value-noise, sinusoidal shimmer, and upward advection; a subtle vertical offset and small second-pass softening are included (blurHint).
  • Added deterministic noise helpers noise1d and valueNoise1d, and a region-weighting helper getRegionWeight to support region = bottom | band | full with centerY, height, and feather controls.
  • Registered the effect via src/renderer/effects/manifest/heat_haze.manifest.ts and added the manifest into the generated registry list (src/renderer/effects/manifest/generated.ts) so it appears in the UI/debug dropdowns.
  • Updated the README effect catalog and regenerated docs/effects.md so the effect is documented and the docs generator can parse its parameters (scripts/generateEffectsDocs.ts).
  • Added unit tests src/renderer/effects/heatHaze.test.ts for helper determinism and region weighting, and adjusted src/timeline/releaseTimeline.test.ts optional list to include heat_haze so registry coverage tests remain valid.
  • Key param set (defaults included): intensity, speed, scale, drift, region, centerY, height, feather, shimmer, blurHint, tint, audioReactive, beatBoost, bassInfluence, seed.

Testing

  • Regenerated effect docs with npm run docs:effects and verified via npm run docs:check; docs generation succeeded and docs check passed.
  • Ran targeted unit tests with npx vitest run src/renderer/effects/heatHaze.test.ts src/timeline/releaseTimeline.test.ts; both test files passed.
  • Ran full test suite via npm test; all project tests passed except an existing external integration test api/kv.integration.test.ts which failed due to network/Upstash connectivity (ENETUNREACH) in the current environment and is unrelated to the effect code.
  • Manual smoke notes: effect uses cached offscreen canvas and will fall back to a simple warm background if canvas creation fails (sensible standalone appearance).

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codexperimental Ready Ready Preview, Comment Apr 4, 2026 2:14am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant