// Deployment area on a lane (port of scripts/luneraria/view/lune_pad.gdshader): team-coloured // border, faint fill, one line per formation row (1.5 m apart) and chevrons at the front that // point down the lane. UV.x runs across the pad (-1..1), UV.y along it in metres from the rear. Shader "Luneraria/Pad" { Properties { _Tint("Tint", Color) = (0.35, 0.66, 1, 1) _PadLength("Pad Length", Float) = 7.4 _RowStart("Row Start", Float) = 7.2 _RowSpacing("Row Spacing", Float) = 1.5 _Strength("Strength", Float) = 1 _Highlight("Highlight", Float) = 0 } SubShader { Tags { "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent" } Pass { Name "Pad" Tags { "LightMode" = "UniversalForward" } Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Off HLSLPROGRAM #pragma target 3.0 #pragma vertex Vert #pragma fragment Frag #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" CBUFFER_START(UnityPerMaterial) half4 _Tint; float _PadLength; float _RowStart; float _RowSpacing; float _Strength; float _Highlight; CBUFFER_END struct Attributes { float4 positionOS : POSITION; float2 uv : TEXCOORD0; }; struct Varyings { float4 positionCS : SV_POSITION; float2 uv : TEXCOORD0; }; Varyings Vert(Attributes input) { Varyings output; output.positionCS = TransformObjectToHClip(input.positionOS.xyz); output.uv = input.uv; return output; } half4 Frag(Varyings input) : SV_Target { float across = abs(input.uv.x); float along = input.uv.y; float border = smoothstep(0.86, 0.93, across) + (1.0 - smoothstep(0.08, 0.22, along)) + smoothstep(_PadLength - 0.22, _PadLength - 0.08, along); float rows = 0.0; for (int i = 0; i < 5; i++) { float at = _RowStart - i * _RowSpacing; rows += (1.0 - smoothstep(0.0, 0.05, abs(along - at))) * step(across, 0.8) * 0.55; } float chevron = 0.0; float front = along - (_PadLength - 1.4); if (front > 0.0 && front < 1.0) chevron = (1.0 - smoothstep(0.0, 0.12, abs(front - (1.0 - across) * 0.7 - 0.15))) * step(across, 0.55); float pulse = 0.75 + 0.25 * sin(_Time.y * 2.4); float alpha = saturate(0.035 + 0.045 * _Highlight + border * 0.5 + rows * 0.5 + chevron * 0.7); half3 color = min(_Tint.rgb * (0.8 + 0.2 * _Highlight * pulse), 1.0); return half4(color, alpha * _Strength * (0.8 + 0.2 * pulse * _Highlight)); } ENDHLSL } } }