Shader "Chameleon/Laser" { // Unlit additive beam for the hunter's shot LineRenderer. The animated fade (opacity) is carried by the // per-vertex colour alpha the HunterLaserBeam writes each frame; _Color is the constant HDR tint. Properties { [HDR] _Color ("Color", Color) = (1, 0.25, 0.18, 1) _Softness ("Edge Softness", Range(0, 1)) = 1 } SubShader { Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "RenderPipeline" = "UniversalPipeline" "IgnoreProjector" = "True" } Pass { Name "LaserAdditive" Blend One One // pure additive glow (vertex-alpha folded into rgb below) ZWrite Off Cull Off ZTest LEqual // the beam is occluded by nearer opaque geometry HLSLPROGRAM #pragma vertex vert #pragma fragment frag #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" struct Attributes { float4 positionOS : POSITION; float4 color : COLOR; float2 uv : TEXCOORD0; }; struct Varyings { float4 positionHCS : SV_POSITION; float4 color : COLOR; float2 uv : TEXCOORD0; }; half4 _Color; half _Softness; Varyings vert (Attributes IN) { Varyings OUT; OUT.positionHCS = TransformObjectToHClip(IN.positionOS.xyz); OUT.color = IN.color; OUT.uv = IN.uv; return OUT; } half4 frag (Varyings IN) : SV_Target { // LineRenderer maps UV.y across the strip width (0..1): bright core, soft edges. half across = abs(IN.uv.y * 2.0h - 1.0h); half edge = lerp(1.0h, saturate(1.0h - across), saturate(_Softness)); half intensity = IN.color.a * edge; // vertex alpha = animated fade envelope half3 rgb = _Color.rgb * IN.color.rgb * intensity; return half4(rgb, 1.0h); // additive (Blend One One) -> alpha unused } ENDHLSL } } Fallback Off }