源战役客户端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

84 rindas
1.4 KiB

pirms 1 mēnesi
  1. 
  2. Shader "SuYou/Lightmap_Transparent" {
  3. Properties {
  4. _Color ("Main Color", Color) = (1,1,1,1)
  5. _MainTex ("Base", 2D) = "white" {}
  6. }
  7. CGINCLUDE
  8. sampler2D _MainTex;
  9. ENDCG
  10. SubShader {
  11. Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
  12. Blend SrcAlpha OneMinusSrcAlpha
  13. ZWrite Off
  14. Pass {
  15. CGPROGRAM
  16. #include "UnityCG.cginc"
  17. #pragma vertex vert
  18. #pragma fragment frag
  19. #pragma multi_compile_fog
  20. #pragma multi_compile LIGHTMAP_OFF LIGHTMAP_ON
  21. fixed4 _Color;
  22. struct appdata_t {
  23. float4 vertex : POSITION;
  24. float2 texcoord : TEXCOORD0;
  25. float2 texcoord1 : TEXCOORD1;
  26. };
  27. struct v2f
  28. {
  29. half4 pos : SV_POSITION;
  30. half2 uv : TEXCOORD0;
  31. #ifdef LIGHTMAP_ON
  32. half2 uv2 : TEXCOORD1;
  33. #endif
  34. UNITY_FOG_COORDS(2)
  35. };
  36. float4 _MainTex_ST;
  37. v2f vert (appdata_t v)
  38. {
  39. v2f o;
  40. o.pos = UnityObjectToClipPos (v.vertex);
  41. #ifdef LIGHTMAP_ON
  42. o.uv = v.texcoord;
  43. o.uv2 = v.texcoord1 * unity_LightmapST.xy + unity_LightmapST.zw;
  44. #else
  45. o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
  46. #endif
  47. UNITY_TRANSFER_FOG(o,o.pos);
  48. return o;
  49. }
  50. fixed4 frag (v2f i) : COLOR0
  51. {
  52. fixed4 tex = tex2D (_MainTex, i.uv) * _Color;
  53. #ifdef LIGHTMAP_ON
  54. fixed3 lm = DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap,i.uv2));
  55. tex.rgb *= lm;
  56. #endif
  57. UNITY_APPLY_FOG(i.fogCoord, tex);
  58. return tex;
  59. }
  60. ENDCG
  61. }
  62. }
  63. FallBack Off
  64. }