MultiPassUnlit.shader 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. Shader /*ase_name*/ "Hidden/Templates/Legacy/Multi Pass Unlit" /*end*/
  2. {
  3. Properties
  4. {
  5. /*ase_props*/
  6. }
  7. SubShader
  8. {
  9. Tags { "RenderType"="Opaque" }
  10. LOD 100
  11. Cull Off
  12. CGINCLUDE
  13. #pragma target 3.5
  14. ENDCG
  15. /*ase_pass*/
  16. Pass
  17. {
  18. /*ase_main_pass*/
  19. Name "ForwardBase"
  20. Tags { "LightMode"="ForwardBase" }
  21. /*ase_all_modules*/
  22. CGPROGRAM
  23. #pragma vertex vert
  24. #pragma fragment frag
  25. #pragma multi_compile_fwdbase
  26. #ifndef UNITY_PASS_FORWARDBASE
  27. #define UNITY_PASS_FORWARDBASE
  28. #endif
  29. #include "UnityCG.cginc"
  30. /*ase_pragma*/
  31. /*ase_globals*/
  32. struct appdata
  33. {
  34. float4 vertex : POSITION;
  35. float3 normal : NORMAL;
  36. UNITY_VERTEX_INPUT_INSTANCE_ID
  37. /*ase_vdata:p=p;n=n*/
  38. };
  39. struct v2f
  40. {
  41. float4 pos : SV_POSITION;
  42. UNITY_VERTEX_INPUT_INSTANCE_ID
  43. UNITY_VERTEX_OUTPUT_STEREO
  44. /*ase_interp(1,):sp=sp.xyzw*/
  45. };
  46. v2f vert ( appdata v /*ase_vert_input*/)
  47. {
  48. v2f o;
  49. UNITY_INITIALIZE_OUTPUT(v2f,o);
  50. UNITY_SETUP_INSTANCE_ID(v);
  51. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  52. UNITY_TRANSFER_INSTANCE_ID(v, o);
  53. /*ase_vert_code:v=appdata;o=v2f*/
  54. v.vertex.xyz += /*ase_vert_out:Local Vertex;Float3;_Vertex*/ float3(0,0,0) /*end*/;
  55. o.pos = UnityObjectToClipPos(v.vertex);
  56. #if ASE_SHADOWS
  57. #if UNITY_VERSION >= 560
  58. UNITY_TRANSFER_SHADOW( o, v.texcoord );
  59. #else
  60. TRANSFER_SHADOW( o );
  61. #endif
  62. #endif
  63. return o;
  64. }
  65. float4 frag (v2f i /*ase_frag_input*/) : SV_Target
  66. {
  67. float3 outColor;
  68. float outAlpha;
  69. /*ase_frag_code:i=v2f*/
  70. outColor = /*ase_frag_out:Color;Float3;_Color*/float3(1,1,1)/*end*/;
  71. outAlpha = /*ase_frag_out:Alpha;Float;_Alpha*/1/*end*/;
  72. clip(outAlpha);
  73. return float4(outColor,outAlpha);
  74. }
  75. ENDCG
  76. }
  77. /*ase_pass*/
  78. Pass
  79. {
  80. Name "ForwardAdd"
  81. Tags { "LightMode" = "ForwardAdd" }
  82. ZWrite Off
  83. Blend One One
  84. CGPROGRAM
  85. #pragma vertex vert
  86. #pragma fragment frag
  87. #pragma multi_compile_fwdadd_fullshadows
  88. #ifndef UNITY_PASS_FORWARDADD
  89. #define UNITY_PASS_FORWARDADD
  90. #endif
  91. #include "UnityCG.cginc"
  92. /*ase_pragma*/
  93. /*ase_globals*/
  94. struct appdata
  95. {
  96. float4 vertex : POSITION;
  97. float3 normal : NORMAL;
  98. UNITY_VERTEX_INPUT_INSTANCE_ID
  99. /*ase_vdata:p=p;n=n*/
  100. };
  101. struct v2f
  102. {
  103. float4 pos : SV_POSITION;
  104. UNITY_VERTEX_INPUT_INSTANCE_ID
  105. UNITY_VERTEX_OUTPUT_STEREO
  106. /*ase_interp(1,):sp=sp.xyzw*/
  107. };
  108. v2f vert ( appdata v /*ase_vert_input*/)
  109. {
  110. v2f o;
  111. UNITY_INITIALIZE_OUTPUT(v2f,o);
  112. UNITY_SETUP_INSTANCE_ID(v);
  113. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  114. UNITY_TRANSFER_INSTANCE_ID(v, o);
  115. /*ase_vert_code:v=appdata;o=v2f*/
  116. v.vertex.xyz += /*ase_vert_out:Local Vertex;Float3;_Vertex*/ float3(0,0,0) /*end*/;
  117. o.pos = UnityObjectToClipPos(v.vertex);
  118. #if ASE_SHADOWS
  119. #if UNITY_VERSION >= 560
  120. UNITY_TRANSFER_SHADOW( o, v.texcoord );
  121. #else
  122. TRANSFER_SHADOW( o );
  123. #endif
  124. #endif
  125. return o;
  126. }
  127. float4 frag (v2f i /*ase_frag_input*/) : SV_Target
  128. {
  129. float3 outColor;
  130. float outAlpha;
  131. /*ase_frag_code:i=v2f*/
  132. outColor = /*ase_frag_out:Color;Float3;_Color*/float3(1,1,1)/*end*/;
  133. outAlpha = /*ase_frag_out:Alpha;Float;_Alpha*/1/*end*/;
  134. clip(outAlpha);
  135. return float4(outColor,outAlpha);
  136. }
  137. ENDCG
  138. }
  139. /*ase_pass*/
  140. Pass
  141. {
  142. Name "Deferred"
  143. Tags { "LightMode" = "Deferred" }
  144. /*ase_all_modules*/
  145. CGPROGRAM
  146. #pragma vertex vert
  147. #pragma fragment frag
  148. #pragma multi_compile_prepassfinal
  149. #ifndef UNITY_PASS_DEFERRED
  150. #define UNITY_PASS_DEFERRED
  151. #endif
  152. #include "UnityCG.cginc"
  153. /*ase_pragma*/
  154. /*ase_globals*/
  155. struct appdata
  156. {
  157. float4 vertex : POSITION;
  158. float3 normal : NORMAL;
  159. UNITY_VERTEX_INPUT_INSTANCE_ID
  160. /*ase_vdata:p=p;n=n*/
  161. };
  162. struct v2f
  163. {
  164. float4 pos : SV_POSITION;
  165. UNITY_VERTEX_INPUT_INSTANCE_ID
  166. UNITY_VERTEX_OUTPUT_STEREO
  167. /*ase_interp(1,):sp=sp.xyzw*/
  168. };
  169. v2f vert ( appdata v /*ase_vert_input*/)
  170. {
  171. v2f o;
  172. UNITY_INITIALIZE_OUTPUT(v2f,o);
  173. UNITY_SETUP_INSTANCE_ID(v);
  174. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  175. UNITY_TRANSFER_INSTANCE_ID(v, o);
  176. /*ase_vert_code:v=appdata;o=v2f*/
  177. v.vertex.xyz += /*ase_vert_out:Local Vertex;Float3;_Vertex*/ float3(0,0,0) /*end*/;
  178. o.pos = UnityObjectToClipPos(v.vertex);
  179. #if ASE_SHADOWS
  180. #if UNITY_VERSION >= 560
  181. UNITY_TRANSFER_SHADOW( o, v.texcoord );
  182. #else
  183. TRANSFER_SHADOW( o );
  184. #endif
  185. #endif
  186. return o;
  187. }
  188. void frag (v2f i /*ase_frag_input*/, out half4 outGBuffer0 : SV_Target0, out half4 outGBuffer1 : SV_Target1, out half4 outGBuffer2 : SV_Target2, out half4 outGBuffer3 : SV_Target3)
  189. {
  190. /*ase_frag_code:i=v2f*/
  191. outGBuffer0 = /*ase_frag_out:GBuffer0;Float4*/0/*end*/;
  192. outGBuffer1 = /*ase_frag_out:GBuffer1;Float4*/0/*end*/;
  193. outGBuffer2 = /*ase_frag_out:GBuffer2;Float4*/0/*end*/;
  194. outGBuffer3 = /*ase_frag_out:GBuffer3;Float4*/0/*end*/;
  195. }
  196. ENDCG
  197. }
  198. /*ase_pass*/
  199. Pass
  200. {
  201. /*ase_hide_pass:SyncP*/
  202. Name "ShadowCaster"
  203. Tags { "LightMode"="ShadowCaster" }
  204. ZWrite On
  205. ZTest LEqual
  206. CGPROGRAM
  207. #pragma vertex vert
  208. #pragma fragment frag
  209. #pragma multi_compile_shadowcaster
  210. #ifndef UNITY_PASS_SHADOWCASTER
  211. #define UNITY_PASS_SHADOWCASTER
  212. #endif
  213. #include "UnityCG.cginc"
  214. /*ase_pragma*/
  215. /*ase_globals*/
  216. struct appdata
  217. {
  218. float4 vertex : POSITION;
  219. float3 normal : NORMAL;
  220. UNITY_VERTEX_INPUT_INSTANCE_ID
  221. /*ase_vdata:p=p;n=n*/
  222. };
  223. struct v2f
  224. {
  225. V2F_SHADOW_CASTER;
  226. UNITY_VERTEX_INPUT_INSTANCE_ID
  227. UNITY_VERTEX_OUTPUT_STEREO
  228. /*ase_interp(1,):sp=sp.xyzw*/
  229. };
  230. v2f vert ( appdata v /*ase_vert_input*/)
  231. {
  232. v2f o;
  233. UNITY_INITIALIZE_OUTPUT(v2f,o);
  234. UNITY_SETUP_INSTANCE_ID(v);
  235. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  236. UNITY_TRANSFER_INSTANCE_ID(v, o);
  237. /*ase_vert_code:v=appdata;o=v2f*/
  238. v.vertex.xyz += /*ase_vert_out:Local Vertex;Float3;_Vertex*/ float3(0,0,0) /*end*/;
  239. TRANSFER_SHADOW_CASTER_NORMALOFFSET(o)
  240. return o;
  241. }
  242. float4 frag (v2f i /*ase_frag_input*/) : SV_Target
  243. {
  244. float3 outColor;
  245. float outAlpha;
  246. /*ase_frag_code:i=v2f*/
  247. outColor = /*ase_frag_out:Color;Float3;_Color*/float3(1,1,1)/*end*/;
  248. outAlpha = /*ase_frag_out:Alpha;Float;_Alpha*/1/*end*/;
  249. clip(outAlpha);
  250. SHADOW_CASTER_FRAGMENT(i)
  251. }
  252. ENDCG
  253. }
  254. /*ase_pass_end*/
  255. }
  256. CustomEditor "AmplifyShaderEditor.MaterialInspector"
  257. }