Viewer: light emissive shaders of any class (SIX-208) #271
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!271
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/271/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 13:18 UTC · original
holdmysocks:six-viewer-emissive-any-class→master· +43 −3 · 6 files · 4 commits · merged 2026-11-25 14:26 UTCStacked on #268, so merge that first.
The viewer lit only materials classed
emissive. Some emissive shaders sit in another class: a bulb'sstandard_emissive_layer_instis cutout, and neon sign tubes are opaque. The GLB lights them through their emissive texture, but the viewer left them dark.Now a material lights in the viewer when its class is
emissiveor the GLB gives it an emissive texture. The export sets that texture only on materials whose shader lights. Such a material gets bit 12 of the material flags. The shader then adds its emissive map with the same per-material scale as class 7 (#268).Checked
cargo check --workspace --all-targetsandcargo test -p sixng-core -p sixng-gui --releasepass. A new test covers which materials light.Not done
standard_alpha_inst) is drawn opaque, because the alpha of its colour texture is constant. Where the glass gets its opacity from is not traced.strength = multiplier / 100 (1.0 = 100 nits), at most 100. Up to 1 it is the emissiveFactor; above 1 the factor is 1 and KHR_materials_emissive_strength holds the strength (listed in extensionsUsed). A multiplier of 0 (switched on at run time) stays lit at strength 1. model.json, materials.json and the GLB extras get emissive_strength {multiplier, strength, source}. The viewer scales emissive materials by the square root of the strength, kept in 0.25..3.