FurShell: remove scale-influence, curvature scales with player scale
Drop the _FurScaleInfluence blend (fur stays a constant world length at any avatar size, as tuned to influence 0) and scale the gravity curvature droop by the avatar world scale (_FurObjScale) instead, so the bend tracks the player: hider 0.5 => smaller droop, hunter 1.5 => bigger droop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
41d5b87e9e
commit
9d16524ded
2 files changed
+20
-35
No files matched your search
@@ -41,11 +41,6 @@ namespace Chameleon.Components
|
||||
// direction so the flat shell slices merge into continuous strands at the rim instead of squished
|
||||
// dots. 0 = off (footprint stays circular everywhere).
|
||||
[SerializeField, Range(0f, 5f)] float _silhouetteStretch = 2f;
|
||||
// How much the avatar's world scale drives the fur SIZE. 1 = fully proportional (small avatar => small
|
||||
// fur, like the body). 0 = constant world size (same absolute fur length at any avatar scale). Fully
|
||||
// proportional fur reads as too short on the small hider and too long on the big hunter, so dial this
|
||||
// down to keep the fur closer to a fixed world length; the curl keeps its shape at any setting.
|
||||
[SerializeField, Range(0f, 1f)] float _furScaleInfluence = 0.5f;
|
||||
|
||||
[Header("Shading")]
|
||||
// Optional albedo (strand-colour) override for the standalone prototype; a sibling MeshPainter's
|
||||
@@ -124,7 +119,6 @@ namespace Chameleon.Components
|
||||
static readonly int WindFrequencyId = Shader.PropertyToID("_WindFrequency");
|
||||
static readonly int WindDirectionId = Shader.PropertyToID("_WindDirection");
|
||||
static readonly int FurObjScaleId = Shader.PropertyToID("_FurObjScale");
|
||||
static readonly int FurScaleInfluenceId = Shader.PropertyToID("_FurScaleInfluence");
|
||||
static readonly int XRayColorId = Shader.PropertyToID("_XRayColor");
|
||||
static readonly int XRayPulseSpeedId = Shader.PropertyToID("_XRayPulseSpeed");
|
||||
static readonly int XRayPulseStrengthId = Shader.PropertyToID("_XRayPulseStrength");
|
||||
@@ -264,14 +258,11 @@ namespace Chameleon.Components
|
||||
_mpb.SetFloat(WindFrequencyId, _windFrequency);
|
||||
_mpb.SetVector(WindDirectionId, new Vector4(_windDirection.x, _windDirection.y, 0f, 0f));
|
||||
|
||||
// Avatar world scale (uniform via PlayerScaler) = the scale baked into the instance matrix used
|
||||
// for the shell extrusion, so the shader can scale the curvature droop in lockstep and keep the
|
||||
// curl proportional at any player size (hider 0.5 / hunter 1.5). Read from lossyScale because
|
||||
// the raw object matrix does NOT carry the per-instance scale in the RenderMeshInstanced path.
|
||||
// Avatar world scale (uniform via PlayerScaler). The shader keeps the fur a CONSTANT world length
|
||||
// but scales the gravity droop by this, so the bend tracks the player (hider 0.5 / hunter 1.5).
|
||||
// Read from lossyScale because the raw object matrix does NOT carry the per-instance scale in the
|
||||
// RenderMeshInstanced path.
|
||||
_mpb.SetFloat(FurObjScaleId, transform.lossyScale.y);
|
||||
// Blend the fur size between fully proportional to the avatar (1) and a constant world size (0):
|
||||
// the shader pre-divides the object-space displacement so the net world length follows this.
|
||||
_mpb.SetFloat(FurScaleInfluenceId, _furScaleInfluence);
|
||||
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user