Body skin: per-ped detail strength and its distance fade #492

Manually merged
github merged 2 commits from github-bot/gh-492 into gh-pr/492/base 2026-11-27 19:09:48 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 18:56 UTC · original
holdmysocks:people-skin-perped → master · +41 −11 · 3 files · 2 commits · merged 2026-11-27 19:07 UTC

Follows #463 and #483 (issue #392).

The game scales the engine skin detail by two values in a per-ped GPU record (3b316b01, copied from the ped's own block each frame):

  • Strength (+0x74). 1 - saturate((distance - near) / (far - near)). near and far are 6 and 9 m, or 20 and 21 m for peds with a flag set. Both detail terms are multiplied by it.
  • Normal blend (+0x30). 1, or 1 - c (c is an owner byte / 255) when one of two owner flags is set.
  • Engine default record. Used only by entities without a record of their own. It has both values at 0.

Up close both values are 1, which is what the viewer already uses. So rendering is unchanged.

Changes:

  • extras.skin_spec.detail.per_ped records these rules.
  • The README paragraph now says that the 0/0 default is not what peds get.
  • A shader comment is updated.
  • New test: per_ped_detail_is_one_up_close.

Tests: sixng-core and sixng-gui release tests pass.

**@⁠holdmysocks** on GitHub · 2026-11-27 18:56 UTC · [original](https://github.com/holdmysocks/SixNG/pull/492) `holdmysocks:people-skin-perped` → `master` · +41 −11 · 3 files · 2 commits · merged 2026-11-27 19:07 UTC Follows #463 and #483 (issue #392). The game scales the engine skin detail by two values in a per-ped GPU record (3b316b01, copied from the ped's own block each frame): - **Strength (+0x74).** `1 - saturate((distance - near) / (far - near))`. near and far are 6 and 9 m, or 20 and 21 m for peds with a flag set. Both detail terms are multiplied by it. - **Normal blend (+0x30).** 1, or `1 - c` (c is an owner byte / 255) when one of two owner flags is set. - **Engine default record.** Used only by entities without a record of their own. It has both values at 0. Up close both values are 1, which is what the viewer already uses. So rendering is unchanged. Changes: - `extras.skin_spec.detail.per_ped` records these rules. - The README paragraph now says that the 0/0 default is not what peds get. - A shader comment is updated. - New test: `per_ped_detail_is_one_up_close`. Tests: sixng-core and sixng-gui release tests pass.
The per-ped record 3b316b01 scales both detail terms: +0x74 fades with the
camera distance (1 up to 6 m, 0 from 9 m; 20 and 21 m for some peds), and
+0x30 (normal blend) is 1 unless flags in the owner say otherwise. Up close
both are 1, as the viewer takes them. extras.skin_spec.detail.per_ped holds
the rules.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:58:55 +00:00
github-bot changed target branch from master to gh-pr/492/base 2026-11-27 19:09:46 +00:00
github manually merged commit 2b731569d1 into gh-pr/492/base 2026-11-27 19:09:48 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.