Skip to content

fix(render): stop the procedural figure flashing before the character loads - #43

Merged
a-baran-orhan merged 2 commits into
mainfrom
fix/hero-procedural-flash
Jul 12, 2026
Merged

fix(render): stop the procedural figure flashing before the character loads#43
a-baran-orhan merged 2 commits into
mainfrom
fix/hero-procedural-flash

Conversation

@a-baran-orhan

Copy link
Copy Markdown
Member

Description

On every landing-page (and playground) refresh, a crude procedural figure flashed for a blink before the realistic skinned character appeared.

Root cause: both surfaces pass showProceduralWhileLoading: false specifically to prevent this — but the option was never consumed. The procedural buildMannequin() is added to the scene visible from frame 0, and its meshes are only hidden after the async character.glb (702 KB) resolves. So the procedural figure rendered for the model's entire fetch time on each load. (Its old doc comment even admitted "the flag is accepted for API compatibility" — i.e. a no-op.)

This is a pre-existing bug, independent of the recent clip/showcase work — hence a standalone PR.

Fix

Actually honor the flag. When a characterUrl is set and showProceduralWhileLoading is false:

  • hide the procedural meshes at init (the skeleton keeps driving animation and bounding-box grounding — same as the existing post-load swap), so a page load shows the skinned figure or nothing, never the procedural flash;
  • reveal them again only if the character load fails, so the scene still degrades to the working procedural fallback and is never blank.

Callers that don't set the flag keep the previous behavior (procedural figure poses the scene during load).

  • packages/posecode-render/src/index.ts — implement the flag; correct the stale doc comment; add a setMeshVisibility helper (also de-dupes the post-load hide).

Verification (in-browser, throttled model load)

Scenario Result
Model stalled 2.5 s (mid-load) Empty stage, no procedural figure; skeleton still animating
Model loaded Skinned character appears, mid-animation
Model aborted (fails) Procedural figure revealed — fallback preserved, never blank

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the code style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new TypeScript/compiler warnings or errors:
    • Running npm run typecheck passes successfully
    • Running npm run build compiles without errors
  • I have run the unit test suite (npm test) and all tests pass
  • If applicable, I have run the fidelity evals (npm run eval) — n/a (viewer load-order fix; no fidelity-invariant logic changed)
  • If I added a new movement, I ran node scripts/generate-content-pages.mjs — n/a

… loads

The landing hero and playground both pass showProceduralWhileLoading:false
to suppress the crude procedural figure while the 702 KB character.glb
loads, but the option was never consumed — the procedural mannequin was
added visible from frame 0 and only hidden once the character resolved, so
it flashed on every page load for the model's fetch time.

Honor the flag: when a characterUrl is set and the flag is false, hide the
procedural meshes at init (the skeleton still drives animation + grounding,
matching the post-load swap) and reveal them only if the character load
fails, so the scene still degrades to the working fallback and never blanks.

- implement showProceduralWhileLoading; correct its now-stale doc comment
- add setMeshVisibility helper (also de-dupes the post-load hide)

Verified in-browser with a throttled model load: mid-load shows no
procedural figure (empty stage, skeleton still animating), the skinned
character appears on load, and an aborted model reveals the procedural
fallback. typecheck, build, and all tests pass.
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
posecode Ready Ready Preview, Comment Jul 12, 2026 6:55pm

@a-baran-orhan
a-baran-orhan merged commit aa52c68 into main Jul 12, 2026
3 checks passed
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