Preview_DecodeDepthNormalNode.shader 510 B

12345678910111213141516171819202122232425262728293031
  1. Shader "Hidden/DecodeDepthNormalNode"
  2. {
  3. Properties
  4. {
  5. _A ("_A", 2D) = "white" {}
  6. }
  7. SubShader
  8. {
  9. Pass
  10. {
  11. CGPROGRAM
  12. #include "UnityCG.cginc"
  13. #include "Preview.cginc"
  14. #pragma vertex vert_img
  15. #pragma fragment frag
  16. sampler2D _A;
  17. float4 frag( v2f_img i ) : SV_Target
  18. {
  19. float4 a = tex2D( _A, i.uv );
  20. float depthValue = 0;
  21. float3 normalValue = 0;
  22. DecodeDepthNormal( a , depthValue, normalValue );
  23. return float4( depthValue,normalValue );
  24. }
  25. ENDCG
  26. }
  27. }
  28. }