Files
Project-M/Assets/_Project/Shaders/EmissiveGloamSkinned.shader
T
kronic 7571091394 LANTERN feel pass (DR-052 + gap list): SoD facing, underwater feel, Bathynaut kit, walk/run gait, suit lamp + new Synty anim packs
- SoD facing: PlayerFacing = body-yaw only (move-facing / cast-turn / idle-hold); every fire
  direction re-sourced to FacingMath.ResolveAim (pre-code review blocking catch); TickWindowMath
  shared windows with Movement-skip; reticle/FX coupled to the damage direction; cursor-dash kept.
- Underwater feel: sharpness 15->6, turn 720->360, MoveSpeed 6->4.2; TuningKnob 26-28
  (0 = no-override sentinels, dev-protocol bump on DebugTuningReport); stride footsteps + silt +
  cadence floor; bubbles; underwater ambience bed + distant groans; camera drag + dev scroll zoom.
- Bathynaut kit in-engine: dome/tank/shoulder-lamp + bare head grafted (GraftSmr rigid rebase,
  RecalculateTangents); EmissiveGloamSkinned shader (Rukhanka deformation); shoulder lamp CASTS
  (warm steady spot on body yaw).
- Gait: two-ring walk/run FreeformDirectional tree (walk @0.35, run @1.0) + blended-natural
  StrideScale; additive Posture(Bank) + Lead(chest-lead) layers; idle = AnimationIdles Base;
  banking driven from facing turn rate; flat terrain (Env_SeabedKit seabed squashed - CC is planar).
- New packs: Synty AnimationIdles + AnimationSwordCombat (combat pass queued) + SyntyPropBoneTool;
  four authored clips (sway/trudge/banks/lean) + Anim_Player_Underwater.blend + suit-kit FBX.
- Validation: 411/411 EditMode green; Play smokes (server==client facing, Aim-true projectile,
  bank/stride live-sampled, lamp beam verified); pre-code + post-impl adversarial reviews applied.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 13:56:02 -07:00

86 lines
3.8 KiB
Plaintext

// Emissive-Gloam SKINNED — the deformation-aware variant of ProjectM/EmissiveGloam for
// glow pieces that live on a Rukhanka-animated SkinnedMeshRenderer (suit porthole glass,
// shoulder-lamp lens). Same ontology contract as the master: hue = warm(ours)/cold(gloam),
// _FlickerAmount 0 = STEADY (true light). Vertexes are deformed through Rukhanka's
// ComputeDeformedVertex include (the same entry the AnimatedLitShader subgraph uses), so the
// glow rides the rig under Entities Graphics. Requires DOTS instancing (BRG-only, like all
// EG-skinned materials: renders in the baked ECS world, not in a plain classic scene).
// GOTCHAS (learned 07-16): (1) the UNITY_DOTS_INSTANCING_START block MUST precede the
// ComputeDeformedVertex include — its UNITY_ACCESS_DOTS_INSTANCED_PROP expands at include time;
// (2) _DeformedMeshIndex must ALSO exist in the Properties block — Rukhanka's SkinnedMeshBaker
// validates material.HasProperty("_DeformedMeshIndex") and logs "does not support skinning" otherwise.
Shader "ProjectM/EmissiveGloamSkinned"
{
Properties
{
[HDR] _EmissionColor ("Emission (HDR)", Color) = (2.0, 1.4, 0.55, 1)
_FlickerAmount ("Flicker Amount (0=steady/true, 1=false)", Range(0,1)) = 0.0
_FlickerSpeed ("Flicker Speed", Float) = 6.0
_Seed ("Per-material phase seed", Float) = 0.0
[HideInInspector] _DeformedMeshIndex ("Deformed Mesh Index", Float) = 0
}
SubShader
{
Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" "Queue"="Geometry" }
Pass
{
Name "EmissiveGloamSkinnedUnlit"
Tags { "LightMode"="UniversalForward" }
HLSLPROGRAM
#pragma target 4.5
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ DOTS_INSTANCING_ON
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
CBUFFER_START(UnityPerMaterial)
half4 _EmissionColor;
half _FlickerAmount;
half _FlickerSpeed;
half _Seed;
CBUFFER_END
// MUST precede the Rukhanka include: its UNITY_ACCESS_DOTS_INSTANCED_PROP(_DeformedMeshIndex)
// expands where the include is parsed.
#ifdef UNITY_DOTS_INSTANCING_ENABLED
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
UNITY_DOTS_INSTANCED_PROP(float, _DeformedMeshIndex)
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
#endif
#include "Packages/com.rukhanka.animation/Rukhanka.Runtime/Deformation/Resources/ComputeDeformedVertex.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
uint vertexID : SV_VertexID;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings { float4 positionHCS : SV_POSITION; };
Varyings vert (Attributes IN)
{
UNITY_SETUP_INSTANCE_ID(IN);
float3 dpos = IN.positionOS.xyz;
float3 dnrm = IN.normalOS;
float3 dtan = float3(1, 0, 0);
ComputeDeformedVertex_float(IN.vertexID, IN.positionOS.xyz, IN.normalOS, dtan,
dpos, dnrm, dtan);
Varyings OUT;
OUT.positionHCS = TransformObjectToHClip(dpos);
return OUT;
}
half4 frag (Varyings IN) : SV_Target
{
float t = _Time.y * _FlickerSpeed + _Seed;
float wave = 0.6 * sin(t) + 0.4 * sin(t * 2.37 + 1.3);
float f = 1.0 - _FlickerAmount * (0.5 - 0.5 * wave);
return half4(_EmissionColor.rgb * f, 1.0);
}
ENDHLSL
}
}
Fallback Off
}