DaoNiaoShu_Dog/Assets/Yolo/Resources/Shaders/boundBoxRender.shader
2026-04-21 10:53:58 +08:00

62 lines
1.3 KiB
Plaintext

Shader "Unlit/boundBoxRender"
{
Properties
{
_MainTex("MainTex",2D)="white"{}
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="Transparent"}
LOD 100
Pass
{
ZWrite off
Cull off
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
sampler2D boundBoxTex;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(boundBoxTex, i.uv);
col.a=step(0.51,col.a);
return col;
}
ENDCG
}
}
}