源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.2 KiB

  1. Shader "MyShader/FogSky" {
  2. Properties {
  3. _Color ("Main Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB)", 2D) = "white" {}
  5. }
  6. SubShader {
  7. Tags { "Queue"="Transparent-50" "RenderType"="Opaque" }
  8. Blend SrcAlpha OneMinusSrcAlpha
  9. Cull Off
  10. Pass {
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #pragma multi_compile_fog
  15. #include "UnityCG.cginc"
  16. struct appdata_t {
  17. float4 vertex : POSITION;
  18. float2 texcoord : TEXCOORD0;
  19. };
  20. struct v2f {
  21. float4 pos : SV_POSITION;
  22. float2 texcoord : TEXCOORD0;
  23. UNITY_FOG_COORDS(1)
  24. };
  25. sampler2D _MainTex;
  26. float4 _MainTex_ST;
  27. fixed4 _Color;
  28. v2f vert (appdata_t v)
  29. {
  30. v2f o;
  31. o.pos = UnityObjectToClipPos(v.vertex);
  32. o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
  33. UNITY_TRANSFER_FOG(o, o.pos);
  34. return o;
  35. }
  36. fixed4 frag (v2f i) : SV_Target
  37. {
  38. fixed4 col = tex2D(_MainTex, i.texcoord) * _Color;
  39. UNITY_APPLY_FOG(i.fogCoord, col);
  40. return col;
  41. }
  42. ENDCG
  43. }
  44. }
  45. }