Materials: real shader names in the family table; plain alpha no longer glows; every constant in model.json (SIX-198) #262
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!262
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/262/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-25 12:11 UTC · original
holdmysocks:six-198-materials→master· +250 −98 · 4 files · 1 commits · merged 2026-11-25 12:22 UTCCloses SIX-198.
Family labels
The family table in
material.rsnow holds each shader's real effect name, the same namessixng shader-bindingsprints. A test checks every name against its hash, and checks that a family isemissiveexactly when its shader is an emissive one.None of the first four shaders has an emissive input, so the GLB no longer gives them an
emissiveFactorwith the colour map as the emissive texture. The rest of the table checked out; only descriptions changed.classificationnow also carriesshader.What lights an emissive material
emissivetexlights by that map only. If the map does not decode, the material does not light at all. Before, its colour map lit.emissivetexkeep lighting by their colour map:signs_emissive,standard_emissive, the LED strip, and emissive-layer materials that bind noemissivetex.emissive_source(emissive_map,colour_mapornone; null when the material does not light). The viewer follows it.Constants in model.json
Every model.json material now has
parameters: all of its constant values for every shader, not only four-layer. They are keyed by name, with the type from the shader archive (a scalar as a number, a vector as its components, int and bool as such), the same as in materials.json.parameters_not_readlists constants whose values lie outside the material's constant block.These five names are added to the name dictionary, each checked against the shader archive's constant buffers:
blendintensity,blendoffset,hardalphablend,grassopacityandpuddleheightbias. With them, all ten constants the BeamNG mapping needs come out by name: emissiveMultiplier, BlendIntensity, BlendOffset, HardAlphaBlend, wetness, TintIntensity, GrassOpacity, PuddleHeightBias, fresnel and bumpiness.Checked
standard_alpha,prop_batch,prop_2lyr_batchand a four-layer ground model. The alpha shaders have no emissive in the GLB. The emissive layers light by theiremissivetex. All ten constants are present by name where their shader has them.cargo check --workspace --all-targets, andcargo test -p sixng-core -p sixng-gui --release, with new tests for the table, the relabelled families, the emissive source and the typed parameters.