You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
532 B

  1. Shader "Hidden/RefractOpVec"
  2. {
  3. Properties
  4. {
  5. _A ("_Incident", 2D) = "white" {}
  6. _B ("_Normal", 2D) = "white" {}
  7. _C ("_Eta", 2D) = "white" {}
  8. }
  9. SubShader
  10. {
  11. Pass
  12. {
  13. CGPROGRAM
  14. #include "UnityCG.cginc"
  15. #pragma vertex vert_img
  16. #pragma fragment frag
  17. sampler2D _A;
  18. sampler2D _B;
  19. sampler2D _C;
  20. float4 frag(v2f_img i) : SV_Target
  21. {
  22. float4 inc = tex2D( _A, i.uv );
  23. float4 nor = tex2D( _B, i.uv );
  24. float4 eta = tex2D( _C, i.uv );
  25. return refract( inc, nor, eta );
  26. }
  27. ENDCG
  28. }
  29. }
  30. }