Camo: generalize brightness + add persistent saturation
Move brightness out of the half-lambert diffuse term to a final exposure multiply on the whole shaded body color (diffuse + GI + specular), and add a saturation grade (0 = neutral, -1 = grayscale, >0 = boosted) on the same final stage. Saturation rides as a 4th component on CamoKnobs (Vector3 -> Vector4) so it inherits all three persistence paths: HUD JSON, network replication (_camo NetworkVariable), and painting-slot metadata. Wires the renamed Slider_Brightness and new Slider_Saturation. Bumps HudFileVersion and PaintMetaVersion with load-time remaps so existing paintings keep their look (old 1=neutral saturation remaps to 0=neutral). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
45b7de05e4
commit
50781e32d2
7 files changed
+87
-36
No files matched your search
@@ -59,7 +59,8 @@ public partial class PaintHud : MonoBehaviour
|
||||
private const string SliderSprayDotAlphaMin = "Slider_SprayDotAlphaMin";
|
||||
private const string SliderSprayDotAlphaMax = "Slider_SprayDotAlphaMax";
|
||||
private const string SliderHalfLambert = "Slider_HalfLambert";
|
||||
private const string SliderHalfLambertBrightness = "Slider_HalfLambertBrightness";
|
||||
private const string SliderBrightness = "Slider_Brightness";
|
||||
private const string SliderSaturation = "Slider_Saturation";
|
||||
private const string SliderSpecularDamp = "Slider_SpecularDamp";
|
||||
private const string SliderOcclusionThreshold = "Slider_OcclusionThreshold";
|
||||
private const string SliderNormalIntensity = "Slider_NormalIntensity";
|
||||
@@ -253,7 +254,8 @@ public partial class PaintHud : MonoBehaviour
|
||||
// Camo knobs are material-backed and not readable yet (the HUD binds before the painter's Start);
|
||||
// SyncCamoSliders re-seeds them once IsReady. Setting a slider before then is a safe no-op.
|
||||
WireSlider(panel, SliderHalfLambert, painter ? painter.CamoHalfLambert : 0f, v => { if (painter) painter.CamoHalfLambert = v; });
|
||||
WireSlider(panel, SliderHalfLambertBrightness, painter ? painter.CamoHalfLambertBrightness : 0f, v => { if (painter) painter.CamoHalfLambertBrightness = v; });
|
||||
WireSlider(panel, SliderBrightness, painter ? painter.CamoHalfLambertBrightness : 0f, v => { if (painter) painter.CamoHalfLambertBrightness = v; });
|
||||
WireSlider(panel, SliderSaturation, painter ? painter.CamoSaturation : 0f, v => { if (painter) painter.CamoSaturation = v; });
|
||||
WireSlider(panel, SliderSpecularDamp, painter ? painter.CamoSpecularDampen : 0f, v => { if (painter) painter.CamoSpecularDampen = v; });
|
||||
|
||||
// Painted-height knobs: material-backed like the camo sliders above.
|
||||
@@ -333,7 +335,8 @@ public partial class PaintHud : MonoBehaviour
|
||||
if (!_panel || !painter) return;
|
||||
var panel = _panel.transform;
|
||||
SetSlider(panel, SliderHalfLambert, painter.CamoHalfLambert);
|
||||
SetSlider(panel, SliderHalfLambertBrightness, painter.CamoHalfLambertBrightness);
|
||||
SetSlider(panel, SliderBrightness, painter.CamoHalfLambertBrightness);
|
||||
SetSlider(panel, SliderSaturation, painter.CamoSaturation);
|
||||
SetSlider(panel, SliderSpecularDamp, painter.CamoSpecularDampen);
|
||||
// Painted-height knobs share the same material-ready timing as the camo sliders.
|
||||
SetSlider(panel, SliderOcclusionThreshold, painter.OcclusionThreshold);
|
||||
|
||||
Reference in new issue
Block a user