Fur als 4. Paint-Map + Ziel-Opacity-Blend
Fur wird die vierte kanonische Paint-Map (RGB=Farbe, A=Länge). Integration über Seed (kahl), GPU/CPU-Paint, Undo, Netzwerk-Sync, Persistence (fur.png, v6) und Live-RT-Hook im FurShellRenderer. HUD-Binding (Toggle/Picker/Alpha) aktiviert. Fur-Alpha lerpt jetzt zu einer Ziel-Opacity (Slider_FurOpacity) statt additiv Richtung 1 zu akkumulieren (zwei Brush-Passes: Fade + Deposit). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
43791abc79
commit
7536e8ec8b
11 files changed
+319
-20
No files matched your search
@@ -53,7 +53,9 @@ namespace Chameleon.Components
|
||||
|
||||
[Header("Fur Map")]
|
||||
// RGBA fur map: RGB = per-texel strand colour, A = fur length (0 = bald, 1 = full length). Leave
|
||||
// null on the standalone prototype - the shader's white default is uniform full-length fur.
|
||||
// null on the standalone prototype - the shader's white default is uniform full-length fur. A
|
||||
// sibling MeshPainter's live fur RT overrides this when present, so a painted avatar grows fur in
|
||||
// real time (see PushProperties).
|
||||
[SerializeField] Texture _furMap;
|
||||
// Fur is fully cut where the map's alpha is at/below this - keeps stray dilation fuzz from growing
|
||||
// hair. 0 keeps the exact "alpha 0 = no fur" contract.
|
||||
@@ -101,6 +103,9 @@ namespace Chameleon.Components
|
||||
|
||||
MeshFilter _meshFilter;
|
||||
SkinnedColliderBaker _baker;
|
||||
// Optional sibling paint source: when present, its live fur RT (RGB = colour, A = length) overrides
|
||||
// the serialized _furMap so painting the fur map drives the shells in real time.
|
||||
MeshPainter _painter;
|
||||
Matrix4x4[] _instances;
|
||||
MaterialPropertyBlock _mpb;
|
||||
|
||||
@@ -110,6 +115,7 @@ namespace Chameleon.Components
|
||||
// On a skinned avatar the fur borrows this component's per-frame baked pose instead of a
|
||||
// static MeshFilter mesh (see ResolveMesh).
|
||||
_baker = GetComponent<SkinnedColliderBaker>();
|
||||
_painter = GetComponent<MeshPainter>();
|
||||
_mpb = new MaterialPropertyBlock();
|
||||
// RenderMeshInstanced requires the material's GPU-instancing flag; guarantee it here so any
|
||||
// assigned FurShell material just works without the manual inspector checkbox.
|
||||
@@ -206,7 +212,9 @@ namespace Chameleon.Components
|
||||
_mpb.SetFloat(SilhouetteStretchId, _silhouetteStretch);
|
||||
|
||||
if (_baseMap) _mpb.SetTexture(BaseMapId, _baseMap);
|
||||
if (_furMap) _mpb.SetTexture(FurMapId, _furMap);
|
||||
// Prefer the sibling painter's live fur RT (painted colour + length) over the serialized map.
|
||||
Texture furTex = _painter && _painter.FurMapTexture ? _painter.FurMapTexture : _furMap;
|
||||
if (furTex) _mpb.SetTexture(FurMapId, furTex);
|
||||
_mpb.SetColor(BaseColorId, ToRenderColor(_rootColor));
|
||||
_mpb.SetColor(TipColorId, ToRenderColor(_tipColor));
|
||||
_mpb.SetFloat(RootAOId, _rootAO);
|
||||
|
||||
Reference in new issue
Block a user