Repository navigation
Draw the skull background live with WebGL2 - #27
Merged
Merged
Conversation
The new design (skull A, block ramp, field, diagonal skulls) is drawn in the browser instead of played from a pre-rendered video, the same way auth draws its eye: three.js renders the scene at one pixel per cell, and shaders turn it into glyphs from an atlas. Nothing is read back and fillText is never called. All 11 skulls are instances of one merged mesh per material, so a frame takes 4 draw calls instead of about 700. Colours come from the active palette (bg, g1-g3) instead of the design's acid green, and they follow the Tweaks palette switch. The skull under the pointer glitches. The weekly video stays as the fallback for browsers without WebGL2, with a lost context, or too slow to keep 28 fps. It is now rendered from the same elements in loop mode, so it shows the new background and loops seamlessly. Reduced motion and Save-Data still get the poster, and phones still get nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The skull background is now drawn live in the browser. Before, the site played a weekly pre-rendered video. The new design (skull A, block ramp, field, diagonal skulls) follows the active palette and reacts to the pointer. The video stays as the fallback for devices that can't run it.
What changes for visitors
bg,g1–g3) instead of the design's acid green#b6ff3a. Switching the palette in Tweaks recolours the background immediately.How it works
The approach is the one auth uses for its eye (bulbashenko-com/auth#7).
<skull-ascii>. three.js renders the scene at one pixel per cell, as the design did. Shaders then pick each cell's glyph and colour, blur a glow layer, and draw glyphs from an atlas. Nothing is read back to the CPU andfillTextis never called.<ascii-bg>. The field and rain run in one plain WebGL2 shader, ported from auth.Fallback render
scripts/skull-rendernow renders the same elements inmanual+loop="20"mode, in grayscale. As before, the site tints the video with the palette.Verification
Main-thread time, headless Chromium, SwiftShader, 1600×900:
Real Intel HD 630 iGPU on the production build: 60 fps, and the frame watchdog never switched to the video, including at 1920×1080 with DPR 2.
Visual parity: compared against the design page by screenshots. Switching to instancing left render frames pixel-identical.
Fallback paths:
render.mjsrun produced a 5.9 MB MP4, a 6.0 MB WebM and a 64 KB poster in about 7 minutes.Checks:
tscandnext buildpass. ESLint is clean for the changed files. The one remaining ESLint error,PublicSite.tsx:39(set-state-in-effect), predates this change.Lockfiles were regenerated with npm 10 (
node:22-slim), as CI requires.After merging
The next weekly
Skull backgroundrun (or a manual dispatch) replaces the old video with a render of the new scene. Until then, the fallback shows the old skull video.🤖 Generated with Claude Code