SCUI3D.shader 1.5 KB

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