mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:35:42 +00:00
Add URP bridge cutout shader pass (#7109)
This commit is contained in:
+50
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user