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.

38 lines
777 B

  1. Shader "Hidden/TFHCCompareWithRange"
  2. {
  3. Properties
  4. {
  5. _A ("_Value", 2D) = "white" {}
  6. _B ("_RangeMin", 2D) = "white" {}
  7. _C ("_RangeMax", 2D) = "white" {}
  8. _D ( "_True", 2D ) = "white" {}
  9. _E ( "_False", 2D ) = "white" {}
  10. }
  11. SubShader
  12. {
  13. Pass
  14. {
  15. CGPROGRAM
  16. #include "UnityCG.cginc"
  17. #pragma vertex vert_img
  18. #pragma fragment frag
  19. sampler2D _A;
  20. sampler2D _B;
  21. sampler2D _C;
  22. sampler2D _D;
  23. sampler2D _E;
  24. float4 frag(v2f_img i) : SV_Target
  25. {
  26. float4 Value = tex2D( _A, i.uv ).x;
  27. float4 RangeMin = tex2D( _B, i.uv ).x;
  28. float4 RangeMax = tex2D( _C, i.uv );
  29. float4 True = tex2D ( _D, i.uv );
  30. float4 False = tex2D ( _E, i.uv );
  31. return ( ( Value >= RangeMin && Value <= RangeMax ) ? True : False );
  32. }
  33. ENDCG
  34. }
  35. }
  36. }