Skip to content

feat(registry): eight more WebGPU shader backgrounds and a bundle with thirty new shaders - #5191

Open
miguel-heygen wants to merge 8 commits into
mainfrom
feat/registry-shaders-30
Open

miguel-heygen wants to merge 8 commits into
mainfrom
feat/registry-shaders-30

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What

Eight more 2-second WebGPU background blocks from the MIT Shaders library, used as they are with their default settings: Aurora, Plasma, Voronoi, Strands, Frost, Water, Prism and Stripes. They follow #5138's six: tagged webgpu and webgpu-shader, data-requires-webgpu, preview video, no poster.

The shared bundle now holds thirty new shaders, so the next blocks only add their folders and never touch the bundle.

How

  • One bundle, one list. godrays/source/build.mjs owns the list of shaders; the driver imports it from a module the build generates, so a new shader is one line. The build copies the bundle into every block whose lib/ already holds it. 1.31 MB to 1.44 MB for 30 more shaders.
  • Same library version. Still shaders@4.0.0; the shader sources are byte-identical in the latest 4.0.2.
  • Licences. The bundle now opens with a one-line MIT notice for the library. Everything in it still comes from the shaders package, so shaders.THIRD-PARTY-LICENSES.txt is unchanged.
  • Driver unchanged. It still renders the exact frame on each seek.

Verification

  • Seek order, all 36 shaders in the bundle. t = 1.5 s is pixel-identical when reached from 0, from 1.9 s, or in steps (0, 0.25, 1.0, 1.5). Frames at 1.0 and 1.75 s differ, so every shader moves. Not vacuous: a driver that passes the target time as a delta fails the same check.

  • Old six unchanged. Godrays, Liquid Metal, Marble, Mesh Gradient, Nebula and Flowing Gradient draw pixel-identical frames at 0, 1 and 2 s with the new bundle and with main's.

  • hyperframes check passes on each new block with 0 errors and 0 warnings.

  • Guard for the stacked blocks. Two new tests in registryBlocks.test.ts: every block that installs a file under compositions/lib/ ships the same bytes (a stale bundle in one block would overwrite the shared copy for all), and every shader block names a shader its bundle holds. Each fails when one block carries main's old bundle or a misspelled shader name.

  • Build. It finds shader blocks by their registry-item.json and fills a new block's lib/ with both files. Its guard now throws if either edit to the library's index misses, not only both. A clean npm ci && node build.mjs reproduces the committed bundle byte for byte.

  • oxfmt --check, oxlint and the CLI typecheck pass. Outside the tests, the PR changes only block folders.

  • Previews. Each is hyperframes render of the block on a Metal GPU at 24 fps, then the same web encode as scripts/generate-catalog-previews.ts (1280 wide, H.264 CRF 28), which itself skips WebGPU blocks. A rendered frame at 1 s is pixel-identical to the block seeked to 1 s in the browser. Uploaded to the docs CDN under new names only; each URL serves the uploaded bytes.

Limits

Same as #5138: one shader block per page, and a host without a GPU renders these blocks only with #5133's opt-in. Frost and Water move slowly with their default speeds.

Frames from the uploaded previews at 0.25, 1.0 and 1.75 s:

Frames from the eight uploaded previews at 0.25, 1.0 and 1.75 s

@miguel-heygen
miguel-heygen marked this pull request as ready for review October 8, 2026 08:50
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Edit accuracy: accurate 2059 (base branch 2059), smooth 1604 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen force-pushed the feat/registry-shaders-30 branch from 8be63b4 to 38814cc Compare October 8, 2026 15:17

This branch has not been deployed

No deployments
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