Unliteferred.shader 1.1 KB

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