Refactor Assets/Scripts: trim restating comments, minor structure cleanups
Sweep over 48 files (Editor/ excluded): remove comments that restate the code, condense class summaries, fix three stale doc statements (HsvColorPicker alpha bar, PaintHud layoutPrefab, MasterVolume FallbackDefault). Inline two single-use wrappers (IsPointerOverUi, BuildModes), drop an unused using, replace a magic literal with the existing ParallaxBase constant, and convert ~10 UnityEngine.Object null checks to the implicit-bool convention. No serialized fields, signatures, RPC/NetworkVariable names, defaults, or #if blocks touched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eeee5fc2f0
commit
6c03e5d3f6
48 files changed
+289
-481
No files matched your search
@@ -3,17 +3,14 @@ using UnityEngine.Rendering;
|
||||
|
||||
namespace Chameleon.Components
|
||||
{
|
||||
// Drives the shell-texturing fur look for FurShell.shader. Draws the source mesh _shellCount times
|
||||
// via GPU instancing (Graphics.RenderMeshInstanced); every instance is one shell layer and reads its
|
||||
// index from SV_InstanceID in the shader to pick its extrusion height. Put this next to a MeshFilter
|
||||
// (static mesh) OR on an animated character's SkinnedMeshRenderer that already carries a
|
||||
// SkinnedColliderBaker - then the fur borrows that component's per-frame baked pose and follows the
|
||||
// animation. Assign the FurShell material either way.
|
||||
// Shell-texturing fur for FurShell.shader: draws the source mesh _shellCount times via GPU instancing
|
||||
// (Graphics.RenderMeshInstanced); each instance is one shell layer and picks its extrusion height from
|
||||
// SV_InstanceID in the shader. Put this next to a MeshFilter (static mesh) OR on a skinned avatar whose
|
||||
// SkinnedColliderBaker provides the per-frame baked pose the fur follows.
|
||||
//
|
||||
// This component is the SINGLE source of truth for the fur look: every tunable shader parameter is a
|
||||
// serialized field here and gets pushed via a MaterialPropertyBlock. The material's own inspector
|
||||
// sliders are therefore only template defaults - they are overridden live. (Use the "Copy Values From
|
||||
// Material" context menu to pull a material you already tuned into these fields.)
|
||||
// SINGLE source of truth for the fur look: every tunable shader parameter is a serialized field here,
|
||||
// pushed via a MaterialPropertyBlock, so the material's own inspector sliders are only template
|
||||
// defaults. (Use the "Copy Values From Material" context menu to pull in a hand-tuned material.)
|
||||
//
|
||||
// The draw is issued from RenderPipelineManager.beginCameraRendering (not Update/LateUpdate) so it
|
||||
// renders reliably for EVERY camera pass - including the Scene View and edit-mode repaints, where
|
||||
@@ -80,11 +77,9 @@ namespace Chameleon.Components
|
||||
[SerializeField] Vector2 _windDirection = new Vector2(1f, 0f);
|
||||
|
||||
[Header("X-Ray Reveal")]
|
||||
// The sibling MeshPainter's body see-through reveal is mirrored onto the fur so the strands glow WITH
|
||||
// the reveal instead of hiding it under opaque fur (colour/pulse are pulled from the painter, in phase
|
||||
// with the body). The fur draws up to _shellCount stacked TRANSPARENT shells, so that additive glow
|
||||
// composites once per overlapping layer and blows out; this scales the per-shell glow down to tame the
|
||||
// stacking so the total reads at roughly the body's intensity. Lower = subtler.
|
||||
// The fur draws up to _shellCount stacked TRANSPARENT shells, so the mirrored X-ray glow composites
|
||||
// once per overlapping layer and blows out; this scales the per-shell glow down so the total reads
|
||||
// at roughly the body's intensity. Lower = subtler.
|
||||
[SerializeField, Range(0f, 1f)] float _xrayFurStrength = 0.2f;
|
||||
|
||||
[Header("Rendering")]
|
||||
@@ -265,18 +260,16 @@ namespace Chameleon.Components
|
||||
_mpb.SetFloat(FurObjScaleId, transform.lossyScale.y);
|
||||
|
||||
// Mirror the sibling painter's live body X-ray reveal onto the fur so the strands glow WITH the
|
||||
// reveal (see-through camo) instead of hiding it under opaque fur. Same colour/pulse/flash the
|
||||
// body uses => in phase. ToRenderColor matches the raw MPB upload to Material.SetColor's gamma
|
||||
// handling (same convention as the fur tint above). Off (alpha 0) when no painter or not revealed
|
||||
// => the shader's additive term is zero, so the fur is unchanged.
|
||||
// reveal instead of hiding it under opaque fur. Same colour/pulse the body uses => in phase.
|
||||
// ToRenderColor matches the raw MPB upload to Material.SetColor's gamma handling (same
|
||||
// convention as the fur tint above). Off (alpha 0) when no painter or not revealed => the
|
||||
// shader's additive term is zero, so the fur is unchanged.
|
||||
if (_painter)
|
||||
{
|
||||
_mpb.SetColor(XRayColorId, ToRenderColor(_painter.CurrentXRayColor));
|
||||
_mpb.SetFloat(XRayPulseSpeedId, _painter.XRayPulseSpeed);
|
||||
_mpb.SetFloat(XRayPulseStrengthId, _painter.XRayPulseStrength);
|
||||
_mpb.SetFloat(XRayPulseShapeId, _painter.XRayPulseShape);
|
||||
// Per-shell glow scale: the body writes the reveal once (opaque) but the fur stacks many
|
||||
// transparent shells that each composite it, so scale it down to keep the total near the body.
|
||||
_mpb.SetFloat(XRayFurStrengthId, _xrayFurStrength);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user