reverseible.shader 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Shader "Unlit/reversible"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Texture", 2D) = "white" {}
  6. _MainTex2("Texture2", 2D) = "white"{}
  7. }
  8. SubShader
  9. {
  10. Tags { "RenderType"="Opaque" }
  11. LOD 100
  12. Cull off
  13. Pass
  14. {
  15. CGPROGRAM
  16. #pragma vertex vert
  17. #pragma fragment frag
  18. #pragma target 3.0
  19. #include "UnityCG.cginc"
  20. struct appdata
  21. {
  22. float4 vertex : POSITION;
  23. float2 uv : TEXCOORD0;
  24. };
  25. struct v2f
  26. {
  27. float2 uv : TEXCOORD0;
  28. float4 vertex : SV_POSITION;
  29. };
  30. sampler2D _MainTex;
  31. sampler2D _MainTex2;
  32. float4 _MainTex_ST;
  33. v2f vert (appdata v)
  34. {
  35. v2f o;
  36. o.vertex = UnityObjectToClipPos( v.vertex );
  37. o.uv = v.uv;
  38. return o;
  39. }
  40. fixed4 frag (v2f i, fixed facing : VFACE) : SV_Target
  41. {
  42. return (facing > 0 ) ? tex2D(_MainTex, i.uv) : tex2D(_MainTex2, i.uv);
  43. }
  44. ENDCG
  45. }
  46. }
  47. }