Add URP bridge cutout shader pass (#7109)

This commit is contained in:
2026-06-11 16:08:00 -07:00
committed by GitHub
parent 8d59800f37
commit 8794e3c1b7
@@ -4,6 +4,56 @@ Shader "Eagle0/Bridge Unlit Cutout" {
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0,1)) = 0.5
}
SubShader {
Tags {
"Queue" = "AlphaTest"
"RenderType" = "TransparentCutout"
"RenderPipeline" = "UniversalPipeline"
}
LOD 100
Cull Off
Pass {
Name "UniversalForward"
Tags { "LightMode" = "UniversalForward" }
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f {
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
float4 _MainTex_ST;
half4 _Color;
half _Cutoff;
v2f vert(appdata v) {
v2f o;
o.vertex = TransformObjectToHClip(v.vertex.xyz);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
half4 frag(v2f i) : SV_Target {
half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv) * _Color;
clip(col.a - _Cutoff);
return col;
}
ENDHLSL
}
}
SubShader {
Tags {
"Queue" = "AlphaTest"