summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LinearDepthNode.shader
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LinearDepthNode.shader')
-rw-r--r--Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LinearDepthNode.shader43
1 files changed, 43 insertions, 0 deletions
diff --git a/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LinearDepthNode.shader b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LinearDepthNode.shader
new file mode 100644
index 00000000..0bcf7794
--- /dev/null
+++ b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_LinearDepthNode.shader
@@ -0,0 +1,43 @@
+Shader "Hidden/LinearDepthNode"
+{
+ 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
+ {
+ float depthValue = tex2D( _A, i.uv ).r;
+ return LinearEyeDepth( depthValue );
+ }
+ ENDCG
+ }
+
+ Pass
+ {
+ CGPROGRAM
+ #include "UnityCG.cginc"
+ #pragma vertex vert_img
+ #pragma fragment frag
+
+ sampler2D _A;
+
+ float4 frag(v2f_img i) : SV_Target
+ {
+ float depthValue = tex2D( _A, i.uv ).r;
+ return Linear01Depth( depthValue );
+ }
+ ENDCG
+ }
+ }
+}