BlitNoAlpha.shader 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Shader "Hidden/BlitNoAlpha"
  2. {
  3. Properties
  4. {
  5. _MainTex ("Texture", any) = "" {}
  6. }
  7. SubShader {
  8. Pass {
  9. ZTest Always Cull Off ZWrite Off
  10. CGPROGRAM
  11. #pragma vertex vert
  12. #pragma fragment frag
  13. #include "UnityCG.cginc"
  14. UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex);
  15. uniform float4 _MainTex_ST;
  16. struct appdata_t {
  17. float4 vertex : POSITION;
  18. float2 texcoord : TEXCOORD0;
  19. UNITY_VERTEX_INPUT_INSTANCE_ID
  20. };
  21. struct v2f {
  22. float4 vertex : SV_POSITION;
  23. float2 texcoord : TEXCOORD0;
  24. UNITY_VERTEX_OUTPUT_STEREO
  25. };
  26. v2f vert (appdata_t v)
  27. {
  28. v2f o;
  29. UNITY_SETUP_INSTANCE_ID(v);
  30. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  31. o.vertex = UnityObjectToClipPos(v.vertex);
  32. o.texcoord = TRANSFORM_TEX(v.texcoord.xy, _MainTex);
  33. return o;
  34. }
  35. fixed4 frag (v2f i) : SV_Target
  36. {
  37. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
  38. return half4(UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.texcoord).xyz, 1.0);
  39. }
  40. ENDCG
  41. }
  42. }
  43. Fallback Off
  44. }