Created
May 10, 2022 00:44
-
-
Save zilongshanren/f9b653152717ddaeb6e75b504eccb75f to your computer and use it in GitHub Desktop.
Depth only pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pass | |
{ | |
Name "Depth" | |
Tags { "LightMode" = "ShadowCaster" } | |
ZWrite On | |
ColorMask 0 | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#pragma target 2.0 | |
#include "UnityCG.cginc" | |
struct v2f { | |
float4 vertex : POSITION; | |
float Depth: TEXCOORD0; | |
}; | |
v2f vert( appdata_base v ) | |
{ | |
v2f o; | |
o.vertex = UnityObjectToClipPos(v.vertex); | |
return o; | |
} | |
float4 frag( v2f i ) : SV_Target | |
{ | |
return i.Depth; | |
} | |
ENDCG | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment