Add painted-height HUD sliders for AO shift and relief intensity

Wire three material-backed look sliders (occlusion AO shift, relief normal
intensity, parallax intensity) through the paint HUD, its layout/state
persistence, the .paint slot format (bumped to v4), owner-authoritative
network sync and the runtime reset, mirroring the existing camo-knob path so
they save, restore, replicate and reset alongside the brush values.

Change the occlusion AO mapping from a division threshold to a linear shift:
AO fades from 1 down to (1 - shift) at the deepest painted hole, so a 0 shift
no longer leaves black spots. Enable _NORMALMAP alongside _PARALLAXMAP so URP
transforms the painted relief normal into world space (otherwise it discards
normalTS and the relief is invisible), and pin the added keyword in the build
keep-alive material.

Stop the pipette from picking the occlusion/height value and turn its toggle
off after a pick. Default the knobs to 0.2 shift / 1.4 normal / 1.0 parallax
across the shader, painter, network and HUD fallbacks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-07-01 07:07:39 +02:00
1 parent fdcb4f8d8a
commit 59939b3496
11 files changed
+216 -49

No files matched your search

+6
View File
@@ -240,9 +240,15 @@ public partial class MeshPainter
// step parallax (ApplyPerPixelDisplacement) AND our relief-normal/AO remap in PlayerCamoLit.
// Lift _Parallax off its floor so the displacement is actually visible (the relief normal is
// the dominant cue; this just adds subtle motion parallax). Live-tunable on the instance.
// _NORMALMAP is REQUIRED for the relief normal to show: URP's InitializeInputData only
// transforms surfaceData.normalTS into world space when _NORMALMAP (or _DETAIL) is set -
// otherwise it discards normalTS and uses the geometric normal, so the relief is invisible.
// _BumpMap stays unbound (= flat default normal), so it only enables the tangent->world path
// and our relief blends on top of a flat base.
if (_materialInstance.HasProperty(ParallaxMapId))
{
_materialInstance.EnableKeyword("_PARALLAXMAP");
_materialInstance.EnableKeyword("_NORMALMAP");
if (_materialInstance.HasProperty(ParallaxId) && _materialInstance.GetFloat(ParallaxId) < 0.02f)
_materialInstance.SetFloat(ParallaxId, 0.02f);
}