Tint palettes: export how much of the palette the game applies (SIX-245) #441

Manually merged
github merged 1 commit from github-bot/gh-441 into gh-pr/441/base 2026-11-27 03:26:19 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-27 02:54 UTC · original
holdmysocks:six245-tint-weight → master · +66 −2 · 2 files · 1 commits · merged 2026-11-27 03:23 UTC

SIX-245. The game doesn't always multiply a prop's full tint palette colour into its albedo. Read in the deferred pixel shaders of prop_batch_dirt, standard, standard_dirt and standard_decal_blend:

  • albedo × lerp(1, palette colour, w), with w = 1 − (1 − speculartex2.a) × strength (constant 381999f3).
  • A second control (73511514) smooths w and blends toward a colour (b1b16aaf, sRGB). It is 0 on almost every material.

Every effect that binds speculartex2, the palette and both controls has the same three bindings (217 effects), which is the test the export uses.

model.json: each material with a tint palette gets tint_weight:

  • status
  • strength and smooth (the two controls) and smooth_target (the colour)
  • mask (the speculartex2 PNG and its hash, alpha channel)
  • full_palette
  • formula

The two-layer shaders use 381999f3 for something else, so they are marked not decoded. COLOR_0 in the GLB is unchanged (full palette colour). The README tint paragraph describes it.

Checked on three exports (the construction rock, a Ferris wheel hub, a mannequin):

  • The rock's prop_batch_dirt material: strength 1, mask alpha mean 233/255.
  • The Ferris wheel's standard materials: strength 1; its standard_dirt and standard_pxm_ground materials: 0; its two-layer materials: not decoded.
  • The mannequin: strength 0 everywhere, so its near-black palette colour is the game's.

Across 8.6 K tinted map materials in a sample, strength is 1 on 2.6 K and 0 on 2.0 K.

Tests: tint_weight_reads_the_mask_and_strength; the tint tests pass.

**@⁠holdmysocks** on GitHub · 2026-11-27 02:54 UTC · [original](https://github.com/holdmysocks/SixNG/pull/441) `holdmysocks:six245-tint-weight` → `master` · +66 −2 · 2 files · 1 commits · merged 2026-11-27 03:23 UTC SIX-245. The game doesn't always multiply a prop's full tint palette colour into its albedo. Read in the deferred pixel shaders of prop_batch_dirt, standard, standard_dirt and standard_decal_blend: - albedo × lerp(1, palette colour, w), with w = 1 − (1 − speculartex2.a) × strength (constant `381999f3`). - A second control (`73511514`) smooths w and blends toward a colour (`b1b16aaf`, sRGB). It is 0 on almost every material. Every effect that binds speculartex2, the palette and both controls has the same three bindings (217 effects), which is the test the export uses. **model.json**: each material with a tint palette gets `tint_weight`: - `status` - `strength` and `smooth` (the two controls) and `smooth_target` (the colour) - `mask` (the speculartex2 PNG and its hash, alpha channel) - `full_palette` - `formula` The two-layer shaders use `381999f3` for something else, so they are marked not decoded. COLOR_0 in the GLB is unchanged (full palette colour). The README tint paragraph describes it. **Checked on three exports** (the construction rock, a Ferris wheel hub, a mannequin): - The rock's prop_batch_dirt material: strength 1, mask alpha mean 233/255. - The Ferris wheel's standard materials: strength 1; its standard_dirt and standard_pxm_ground materials: 0; its two-layer materials: not decoded. - The mannequin: strength 0 everywhere, so its near-black palette colour is the game's. Across 8.6 K tinted map materials in a sample, strength is 1 on 2.6 K and 0 on 2.0 K. Tests: `tint_weight_reads_the_mask_and_strength`; the tint tests pass.
Read in the deferred pixel shaders of prop_batch_dirt, standard,
standard_dirt and standard_decal_blend: albedo *= lerp(1, palette, w)
with w = 1 - (1 - speculartex2.a) * c381999f3, plus a smoothing control
(c73511514) toward colour cb1b16aaf. Each tinted material gets the mask
texture, both controls and the formula; two-layer shaders, which use
381999f3 otherwise, are marked not decoded.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:56:25 +00:00
github-bot changed target branch from master to gh-pr/441/base 2026-11-27 03:26:18 +00:00
github manually merged commit a6c4063248 into gh-pr/441/base 2026-11-27 03:26:19 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.