fix(render): stop the procedural figure flashing before the character loads - #43
Merged
Conversation
… 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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: falsespecifically to prevent this — but the option was never consumed. The proceduralbuildMannequin()is added to the scene visible from frame 0, and its meshes are only hidden after the asynccharacter.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
characterUrlis set andshowProceduralWhileLoadingisfalse: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 asetMeshVisibilityhelper (also de-dupes the post-load hide).Verification (in-browser, throttled model load)
Type of Change
Checklist
npm run typecheckpasses successfullynpm run buildcompiles without errorsnpm test) and all tests passnpm run eval) — n/a (viewer load-order fix; no fidelity-invariant logic changed)node scripts/generate-content-pages.mjs— n/a