ToriaAssets/Sources/Shaders/DepthTexPreview.shader

48 lines
704 B
Plaintext
Raw Permalink Normal View History

2026-05-19 12:20:15 +02:00
Shader "GlobalSnow/Editor/DepthTexPreview"
2026-05-07 10:14:44 +02:00
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
2026-05-19 12:20:15 +02:00
Tags { "RenderType"="Opaque" }
2026-05-07 10:14:44 +02:00
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
2026-05-19 12:20:15 +02:00
2026-05-07 10:14:44 +02:00
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
2026-05-19 12:20:15 +02:00
sampler2D _MainTex;
sampler2D _GS_DepthTexture;
2026-05-07 10:14:44 +02:00
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
2026-05-19 12:20:15 +02:00
return tex2D(_GS_DepthTexture, i.uv).rrrr;
2026-05-07 10:14:44 +02:00
}
ENDCG
}
}
}