Ped lenses: tinted glass with the game's dual-source blend #503
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!503
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-503"
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-27 20:10 UTC · original
holdmysocks:claude/people-lens→master· +336 −8 · 11 files · 1 commits · merged 2026-11-27 20:23 UTCSunglasses and spectacle lenses (
ped_standard_muv_alpha) were drawn opaque and in the frame's colour. They now draw as tinted glass, using the game's own blend and per-sub-material values.What was wrong
materialidmap, so lenses got the frame's sub 0 (pink) instead of their glass sub-materials (3/5/6 on Connie'scs_iris_specssquare_fr1_000_large). Materials without amaterialidmap of their own now take the vertex part number, even where they share the frame's texture.What is built (traced from the shader archive work, notes 42es and follow-ups 1–4)
matlib::Library::transmission: the per-sub-material record as the game's parser fills it. It starts from the parameter defaults, then applies the profile's fields at index 255 or the field's own index. Fields:AbsorptionσA andf1088873wAscatteringσB and000482aawB5ba33632d_base,95f8d114d_mask,a14dce4ed_maxthicknessanisotropyp,0604e865h0c391fd51k,f920ffb1tCovered by a test against the lens profile
d53758cd.Opacity a0 = the tile material map alpha, baked into the lens texels' base alpha. Then α = sat(a0/k) and o = sat((a0−t)/(1−t)).
Absorption: σ = σA(1 − b·wA) + σB(1 + (b−1)·wB).
View path:
_COLOR0.a) when h0 ≥ 0Blend:
glass.wgsl, a separate module built only when the device hasDUAL_SOURCE_BLENDING). The feature is requested when the adapter has it.Connie's lens values:
Not traced, so left out or approximated
Checks
cargo test --release -p sixng-core -p sixng-gui --lib --bins