Can you help me create this shader with shader graph?
Screen position node is calculating Vertex position. I just want the point screen position.
Shader “Unlit/DepthPoint”
{
SubShader
{
Tags { “Queue” = “Transparent” }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include “UnityCG.cginc”
struct v2f
{
fixed4 pos : SV_POSITION;
fixed4 objScreenPoint : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(appdata_base v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.pos = UnityObjectToClipPos(v.vertex);
o.objScreenPoint = ComputeScreenPos(UnityObjectToClipPos(fixed4(0, 0, 0, 1)));
return o;
}
sampler2D _CameraDepthTexture;
fixed4 frag (v2f i) : SV_Target
{
fixed4 depth = tex2D(_CameraDepthTexture, i.objScreenPoint .xy / i.objScreenPoint .w);
return depth;
}
ENDCG
}
}
}