Preview.shader 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Shader "Unlit/Preview"
  2. {
  3. Properties
  4. {
  5. _MainTex("Texture", 2D) = "white" {}
  6. }
  7. SubShader
  8. {
  9. Tags { "RenderType" = "Opaque" }
  10. LOD 100
  11. Pass
  12. {
  13. CGPROGRAM
  14. #pragma vertex vert
  15. #pragma fragment frag
  16. // make fog work
  17. #pragma multi_compile_fog
  18. #include "UnityCG.cginc"
  19. struct appdata
  20. {
  21. float4 vertex : POSITION;
  22. float2 uv : TEXCOORD0;
  23. };
  24. struct v2f
  25. {
  26. float2 uv : TEXCOORD0;
  27. UNITY_FOG_COORDS(1)
  28. float4 vertex : SV_POSITION;
  29. };
  30. sampler2D _MainTex;
  31. float4 _MainTex_ST;
  32. v2f vert(appdata v)
  33. {
  34. v2f o;
  35. o.vertex = UnityObjectToClipPos(v.vertex);
  36. o.uv = TRANSFORM_TEX(v.uv, _MainTex);
  37. UNITY_TRANSFER_FOG(o,o.vertex);
  38. return o;
  39. }
  40. fixed4 frag(v2f i) : SV_Target
  41. {
  42. // sample the texture
  43. fixed4 col = tex2D(_MainTex, i.uv);
  44. fixed4 clo_result = fixed4(col.a, col.a, col.a, col.a);
  45. return clo_result;
  46. }
  47. ENDCG
  48. }
  49. }
  50. }