summaryrefslogtreecommitdiff
path: root/Assets/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_DecodeDepthNormalNode.shader
blob: 41ee539cf0e04d01bffdf112b5dacb31652a3f60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Shader "Hidden/DecodeDepthNormalNode"
{
	Properties
	{
		_A ("_A", 2D) = "white" {}
	}
	SubShader
	{
		Pass
		{
			CGPROGRAM
			#include "UnityCG.cginc"
			#pragma vertex vert_img
			#pragma fragment frag

			sampler2D _A;
		

			float4 frag( v2f_img i ) : SV_Target
			{
				float4 a = tex2D( _A, i.uv );
				float depthValue = 0;
				float3 normalValue = 0;
				DecodeDepthNormal( a , depthValue, normalValue );
				return float4( depthValue,normalValue );
			}
			ENDCG
		}
	}
}