Skip to content

Licensed characters rendered white because their materials were disposed - #20

Merged
ralyodio merged 1 commit into
mainfrom
fix/character-materials
Jul 26, 2026
Merged

Licensed characters rendered white because their materials were disposed#20
ralyodio merged 1 commit into
mainfrom
fix/character-materials

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The Quaternius characters rendered as flat white figures. It was never a lighting problemloadModel was 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: 0 across 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

  • Friendlies and enemies were the same model — the revert pointed both factions at the generated character. Directorate now uses fighter_swat, Nightcell fighter_worker; they differ by whole silhouette, not a colour swatch.
  • Bots all stood at world origin. addPlayer initialises 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

… 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>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit ad92682 into main Jul 26, 2026
6 checks passed
@ralyodio
ralyodio deleted the fix/character-materials branch July 26, 2026 14:34
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