Licensed characters rendered white because their materials were disposed - #20
Merged
Conversation
… were disposed
The Quaternius characters rendered as flat white figures. It was never a
lighting problem — `loadModel` was destroying their materials at load.
That function disposed every material in a GLB whose name was not one of our
generated slot names, on the assumption that a model's own materials are always
replaced by the slot-binding loop above it. True for the props we generate;
catastrophically wrong for a licensed model. All seven Quaternius materials
(DarkBrown, Grey, Black, Skin, Swat, Swat_Black, Visor) failed the name test,
were disposed, and left every mesh with no material at all — which Babylon
renders as flat white.
It now disposes only materials nothing references.
This cost three wrong diagnoses. It presented as over-exposure, so it was
"fixed" by scaling albedo to the scene's budget, clearing emissive, and
excluding the meshes from the GlowLayer — none of which can help a mesh that
has no material to scale. What settled it was instrumenting the load and
printing the actual state: `withMaterial: 0` across all twelve meshes, while
the GLB itself had seven materials and every primitive referencing one. Worth
remembering as a habit: three guesses cost more than one measurement.
Also fixes two things that followed from the earlier revert:
- Friendlies and enemies were the same model, because the revert pointed both
factions at the generated character. The Directorate now uses fighter_swat
and Nightcell fighter_worker, which differ by whole silhouette rather than
by a colour swatch.
- Bots all stood at the world origin. `addPlayer` initialises movement to
(0,0,0) and nothing else placed them, so they piled onto the central hard
point. Each is now put on a real spawn pad for its team.
And body hits bleed instead of throwing sparks: dark red particles, a dimmer
red light, and a flash scaled to 0.35 rather than 1.7 — the previous value
painted a ~3.7 m white card over anyone shot at close range, which is what
"they blow up white when shot" was.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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 Quaternius characters rendered as flat white figures. It was never a lighting problem —
loadModelwas destroying their materials at load.That function disposed every material whose name wasn't one of our generated slot names, assuming a model's own materials are always replaced by the slot-binding loop above it. True for props we generate; catastrophically wrong for a licensed model. All seven Quaternius materials (
DarkBrown,Grey,Black,Skin,Swat,Swat_Black,Visor) failed the name test, were disposed, and left every mesh with no material at all — which Babylon renders as flat white.Now disposes only materials nothing references.
This cost three wrong diagnoses
It presented as over-exposure, so it was "fixed" by scaling albedo to the scene's budget, clearing emissive, and excluding the meshes from the GlowLayer — none of which can help a mesh that has no material to scale.
What settled it was instrumenting the load and printing actual state:
withMaterial: 0across all twelve meshes, while the GLB itself had seven materials and every primitive referencing one. Three guesses cost more than one measurement.Also fixed, both consequences of the earlier revert
fighter_swat, Nightcellfighter_worker; they differ by whole silhouette, not a colour swatch.addPlayerinitialises movement to (0,0,0) and nothing placed them, so they piled onto the central hard point. Each now gets a real spawn pad.Body hits bleed
Dark red particles, dimmer red light, and a flash scaled 0.35 instead of 1.7 — the old value painted a ~3.7 m white card over anyone shot close up, which is what "they blow up white when shot" was.
201 tests pass. Format, lint, typecheck clean.
🤖 Generated with Claude Code