Skin F0: the engine's albedo window, decoded #455
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!455
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-455"
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 04:37 UTC · original
holdmysocks:people-skin-window→master· +928 −125 · 19 files · 13 commits · merged 2026-11-27 05:55 UTCPart of #392 (the skin follow-ups to #446). Stacked on #446; merge that first.
What the engine does. Both skin pixel programs, the studio one and the deferred one, scale F0 by a window on the albedo's brightness:
saturate((max(r, g, b) - lo) / (hi - lo))on the linear albedo.loandhiare at +0x6c0 / +0x6c4 of the per-frame buffer6e8725e4. The engine fills them every frame (fn ff0120) from two constants in.data: sRGB 5 and 20 out of 255, so lo = 0.0015176 and hi = 0.0069954 linear. They do not depend on time of day. Only near-black albedo loses its specular, so on skin the factor is 1.Changes
extras.skin_spec.albedo_windowrecords lo, hi and the rule. glTF has no equivalent, so the specular factor stays as it was.skinspec:ALBEDO_LO,ALBEDO_HIandalbedo_window(), with a test that the bounds are the sRGB decode of 5 and 20.Checks