// S4 fog of war: a ground-hugging grid whose vertex alpha darkens what the viewer's team cannot see. Shader "Luneraria/FogOverlay" { Properties { _Color("Fog colour", Color) = (0.03, 0.04, 0.07, 1) } SubShader { Tags { "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" "Queue" = "Transparent-50" } Pass { Name "Fog" Tags { "LightMode" = "UniversalForward" } Blend SrcAlpha OneMinusSrcAlpha ZWrite Off ZTest LEqual Cull Off HLSLPROGRAM #pragma vertex Vert #pragma fragment Frag #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" CBUFFER_START(UnityPerMaterial) half4 _Color; CBUFFER_END struct Attributes { float4 positionOS : POSITION; half4 color : COLOR; }; struct Varyings { float4 positionCS : SV_POSITION; half alpha : TEXCOORD0; }; Varyings Vert(Attributes input) { Varyings output; output.positionCS = TransformObjectToHClip(input.positionOS.xyz); output.alpha = input.color.a; return output; } half4 Frag(Varyings input) : SV_Target { return half4(_Color.rgb, _Color.a * input.alpha); } ENDHLSL } } }