Skin detail atlases and occlusion; translucency recorded (#392) #463

Manually merged
github merged 8 commits from github-bot/gh-463 into gh-pr/463/base 2026-11-27 06:07:50 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 05:23 UTC · original
holdmysocks:people-skin-detail → master · +341 −23 · 10 files · 8 commits · merged 2026-11-27 06:05 UTC

Part of #392 (body skin spec maps). It follows #455.

Detail atlases (gap 1). No mesh binds the two skin detail slots. The engine falls back to two arrays of 48 tiles (256 x 256) in data/ttdb/graphics/ttdb_graphics.ttpf:

  • e4bb0ab707979121: detail normals, BC5.
  • 3e830fd3713f2e21: detail control, red channel.

Each material's region table (a6b9e97a) picks a tile from speculartex2 G. On people it is tile 16 + region.

  • The export writes the 16 tiles in region order as two 4 x 4 sheets (skindetail_n_*, skindetail_c_*).
  • It records the tiling and strengths in extras.skin_spec.detail.
  • The viewer applies the detail normal and the colour darkening the way the deferred program does.

Occlusion (gap 3). G-buffer AO = lerp(1, speculartex B, 4d1ecedd). The lighting multiplies diffuse ambient by it and specular ambient by its fourth root. Direct light is not touched.

  • The strength is 0 on every human hand and foot material and 1 on teeth, so the game does not use B on body skin.
  • Where the strength is above 0, the GLB gets an occlusionTexture, and the viewer applies it.

Translucency (gap 3). Decoded: the thickness from speculartex R, the per-entity profile and the per-light transmittance. The formula is in extras.skin_spec.translucency.

Not in this PR (follow-ups):

  • Translucency profiles. They come from a .zmt data file (type 0x163). It was not found among the PSO and meta files of data, levels, packs, script or the story pack. Translucency is recorded but not shaded or mapped to a glTF extension.
  • Two per-ped detail values. Record 3b316b01 +0x74 and +0x30 scale the detail terms. The engine default is 0, which turns detail off. Each ped's own value is not traced, so the viewer takes 1.

Tests: core 358, gui 53. Build OK. The RTX 4080 render of cs_jason is OK.

**@⁠holdmysocks** on GitHub · 2026-11-27 05:23 UTC · [original](https://github.com/holdmysocks/SixNG/pull/463) `holdmysocks:people-skin-detail` → `master` · +341 −23 · 10 files · 8 commits · merged 2026-11-27 06:05 UTC Part of #392 (body skin spec maps). It follows #455. **Detail atlases (gap 1).** No mesh binds the two skin detail slots. The engine falls back to two arrays of 48 tiles (256 x 256) in `data/ttdb/graphics/ttdb_graphics.ttpf`: - `e4bb0ab707979121`: detail normals, BC5. - `3e830fd3713f2e21`: detail control, red channel. Each material's region table (`a6b9e97a`) picks a tile from `speculartex2` G. On people it is tile 16 + region. - The export writes the 16 tiles in region order as two 4 x 4 sheets (`skindetail_n_*`, `skindetail_c_*`). - It records the tiling and strengths in `extras.skin_spec.detail`. - The viewer applies the detail normal and the colour darkening the way the deferred program does. **Occlusion (gap 3).** G-buffer AO = `lerp(1, speculartex B, 4d1ecedd)`. The lighting multiplies diffuse ambient by it and specular ambient by its fourth root. Direct light is not touched. - The strength is 0 on every human hand and foot material and 1 on teeth, so the game does not use B on body skin. - Where the strength is above 0, the GLB gets an `occlusionTexture`, and the viewer applies it. **Translucency (gap 3).** Decoded: the thickness from `speculartex` R, the per-entity profile and the per-light transmittance. The formula is in `extras.skin_spec.translucency`. Not in this PR (follow-ups): - **Translucency profiles.** They come from a `.zmt` data file (type 0x163). It was not found among the PSO and meta files of data, levels, packs, script or the story pack. Translucency is recorded but not shaded or mapped to a glTF extension. - **Two per-ped detail values.** Record `3b316b01` +0x74 and +0x30 scale the detail terms. The engine default is 0, which turns detail off. Each ped's own value is not traced, so the viewer takes 1. Tests: core 358, gui 53. Build OK. The RTX 4080 render of cs_jason is OK.
The export writes each skin material's 16 engine detail tiles (ttdb
graphics arrays) as normal and control sheets and records tiling and
strengths; the viewer applies the detail normal and colour as the
deferred program does. Occlusion (speculartex B) goes to the GLB as an
occlusion texture where the material's strength is above 0 (0 on body
skin, 1 on teeth) and the viewer applies it to ambient light only.
Translucency is decoded and recorded in the extras; its profiles are
loaded data not yet found, so it is not shaded.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 05:28:19 +00:00
github-bot changed target branch from people-skin-window to master 2026-11-27 06:00:36 +00:00
github-bot changed target branch from master to gh-pr/463/base 2026-11-27 06:07:48 +00:00
github manually merged commit f56de3568e into gh-pr/463/base 2026-11-27 06:07:50 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.