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

+13
View File
@@ -70,6 +70,9 @@ public partial class PaintHud : MonoBehaviour
private const string SliderHalfLambert = "Slider_HalfLambert";
private const string SliderHalfLambertBrightness = "Slider_HalfLambertBrightness";
private const string SliderSpecularDamp = "Slider_SpecularDamp";
private const string SliderOcclusionThreshold = "Slider_OcclusionThreshold";
private const string SliderNormalIntensity = "Slider_NormalIntensity";
private const string SliderParallaxIntensity = "Slider_ParallaxIntensity";
private const string MaskSelector = "MaskSelector";
private const string MaskSwatchPrefix = "MaskSwatch_";
@@ -310,6 +313,12 @@ public partial class PaintHud : MonoBehaviour
WireSlider(panel, SliderHalfLambertBrightness, painter ? painter.CamoHalfLambertBrightness : 0f, v => { if (painter) painter.CamoHalfLambertBrightness = v; });
WireSlider(panel, SliderSpecularDamp, painter ? painter.CamoSpecularDampen : 0f, v => { if (painter) painter.CamoSpecularDampen = v; });
// Painted-height knobs: material-backed like the camo sliders above, so they are seeded once the
// painter is ready (SyncCamoSliders) and a set before then is a safe no-op.
WireSlider(panel, SliderOcclusionThreshold, painter ? painter.OcclusionThreshold : 0.2f, v => { if (painter) painter.OcclusionThreshold = v; });
WireSlider(panel, SliderNormalIntensity, painter ? painter.HeightNormalIntensity : 1.4f, v => { if (painter) painter.HeightNormalIntensity = v; });
WireSlider(panel, SliderParallaxIntensity, painter ? painter.ParallaxIntensity : 1f, v => { if (painter) painter.ParallaxIntensity = v; });
foreach (var name in DraggablePanels)
MakeDraggable(panel, name);
}
@@ -379,6 +388,10 @@ public partial class PaintHud : MonoBehaviour
SetSlider(panel, SliderHalfLambert, painter.CamoHalfLambert);
SetSlider(panel, SliderHalfLambertBrightness, painter.CamoHalfLambertBrightness);
SetSlider(panel, SliderSpecularDamp, painter.CamoSpecularDampen);
// Painted-height knobs share the same material-ready timing as the camo sliders.
SetSlider(panel, SliderOcclusionThreshold, painter.OcclusionThreshold);
SetSlider(panel, SliderNormalIntensity, painter.HeightNormalIntensity);
SetSlider(panel, SliderParallaxIntensity, painter.ParallaxIntensity);
}
private static void SetToggle(Transform panel, string name, bool value)