Lightning.shader 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "LT/Lightning VFX/Lightning"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
  8. [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
  9. [ASEBegin][Toggle]_ParticleMode("Particle Mode", Float) = 1
  10. [HDR]_Colour("Colour", Color) = (1,1,1,1)
  11. _AlphaErosion("Alpha Erosion", Range( 0 , 1)) = 0
  12. _RemapMin("Remap Min", Range( 0 , 1)) = 0
  13. _RemapMax("Remap Max", Range( 0 , 1)) = 0
  14. _AlbedoTexture("Albedo Texture", 2D) = "white" {}
  15. _Duplicate("Duplicate", Range( 0 , 1)) = 0
  16. _Ymask("Ymask", Float) = 0.21
  17. [ASEEnd]_YmaskExp("Ymask硬吗", Range( 1 , 10)) = 1
  18. [HideInInspector]_QueueOffset("_QueueOffset", Float) = 0
  19. [HideInInspector]_QueueControl("_QueueControl", Float) = -1
  20. [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
  21. [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
  22. [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
  23. //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
  24. //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
  25. //_TessMin( "Tess Min Distance", Float ) = 10
  26. //_TessMax( "Tess Max Distance", Float ) = 25
  27. //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
  28. //_TessMaxDisp( "Tess Max Displacement", Float ) = 25
  29. }
  30. SubShader
  31. {
  32. LOD 0
  33. Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" }
  34. Cull Off
  35. AlphaToMask Off
  36. HLSLINCLUDE
  37. #pragma target 3.0
  38. #pragma prefer_hlslcc gles
  39. #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal vulkan nomrt
  40. #ifndef ASE_TESS_FUNCS
  41. #define ASE_TESS_FUNCS
  42. float4 FixedTess( float tessValue )
  43. {
  44. return tessValue;
  45. }
  46. float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
  47. {
  48. float3 wpos = mul(o2w,vertex).xyz;
  49. float dist = distance (wpos, cameraPos);
  50. float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
  51. return f;
  52. }
  53. float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
  54. {
  55. float4 tess;
  56. tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
  57. tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
  58. tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
  59. tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
  60. return tess;
  61. }
  62. float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
  63. {
  64. float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
  65. float len = distance(wpos0, wpos1);
  66. float f = max(len * scParams.y / (edgeLen * dist), 1.0);
  67. return f;
  68. }
  69. float DistanceFromPlane (float3 pos, float4 plane)
  70. {
  71. float d = dot (float4(pos,1.0f), plane);
  72. return d;
  73. }
  74. bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
  75. {
  76. float4 planeTest;
  77. planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  78. (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  79. (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
  80. planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  81. (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  82. (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
  83. planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  84. (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  85. (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
  86. planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  87. (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  88. (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
  89. return !all (planeTest);
  90. }
  91. float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
  92. {
  93. float3 f;
  94. f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
  95. f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
  96. f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
  97. return CalcTriEdgeTessFactors (f);
  98. }
  99. float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
  100. {
  101. float3 pos0 = mul(o2w,v0).xyz;
  102. float3 pos1 = mul(o2w,v1).xyz;
  103. float3 pos2 = mul(o2w,v2).xyz;
  104. float4 tess;
  105. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  106. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  107. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  108. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  109. return tess;
  110. }
  111. float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
  112. {
  113. float3 pos0 = mul(o2w,v0).xyz;
  114. float3 pos1 = mul(o2w,v1).xyz;
  115. float3 pos2 = mul(o2w,v2).xyz;
  116. float4 tess;
  117. if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
  118. {
  119. tess = 0.0f;
  120. }
  121. else
  122. {
  123. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  124. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  125. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  126. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  127. }
  128. return tess;
  129. }
  130. #endif //ASE_TESS_FUNCS
  131. ENDHLSL
  132. Pass
  133. {
  134. Name "Forward"
  135. Tags { "LightMode"="UniversalForwardOnly" }
  136. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  137. ZWrite Off
  138. ZTest LEqual
  139. Offset 0 , 0
  140. ColorMask RGBA
  141. HLSLPROGRAM
  142. #pragma multi_compile_instancing
  143. #define _RECEIVE_SHADOWS_OFF 1
  144. #define ASE_SRP_VERSION 999999
  145. #pragma multi_compile _ LIGHTMAP_ON
  146. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  147. #pragma shader_feature _ _SAMPLE_GI
  148. #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  149. #pragma multi_compile _ DEBUG_DISPLAY
  150. #define SHADERPASS SHADERPASS_UNLIT
  151. #pragma vertex vert
  152. #pragma fragment frag
  153. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  154. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  155. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  156. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  157. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  158. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  159. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  160. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  161. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl"
  162. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  163. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceData.hlsl"
  164. #define ASE_NEEDS_FRAG_COLOR
  165. #define ASE_NEEDS_FRAG_WORLD_POSITION
  166. struct VertexInput
  167. {
  168. float4 vertex : POSITION;
  169. float3 ase_normal : NORMAL;
  170. float4 ase_texcoord : TEXCOORD0;
  171. float4 ase_color : COLOR;
  172. UNITY_VERTEX_INPUT_INSTANCE_ID
  173. };
  174. struct VertexOutput
  175. {
  176. float4 clipPos : SV_POSITION;
  177. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  178. float3 worldPos : TEXCOORD0;
  179. #endif
  180. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  181. float4 shadowCoord : TEXCOORD1;
  182. #endif
  183. #ifdef ASE_FOG
  184. float fogFactor : TEXCOORD2;
  185. #endif
  186. float4 ase_texcoord3 : TEXCOORD3;
  187. float4 ase_color : COLOR;
  188. UNITY_VERTEX_INPUT_INSTANCE_ID
  189. UNITY_VERTEX_OUTPUT_STEREO
  190. };
  191. CBUFFER_START(UnityPerMaterial)
  192. float4 _Colour;
  193. float _Duplicate;
  194. float _ParticleMode;
  195. float _AlphaErosion;
  196. float _RemapMin;
  197. float _RemapMax;
  198. float _Ymask;
  199. float _YmaskExp;
  200. #ifdef TESSELLATION_ON
  201. float _TessPhongStrength;
  202. float _TessValue;
  203. float _TessMin;
  204. float _TessMax;
  205. float _TessEdgeLength;
  206. float _TessMaxDisp;
  207. #endif
  208. CBUFFER_END
  209. sampler2D _AlbedoTexture;
  210. VertexOutput VertexFunction ( VertexInput v )
  211. {
  212. VertexOutput o = (VertexOutput)0;
  213. UNITY_SETUP_INSTANCE_ID(v);
  214. UNITY_TRANSFER_INSTANCE_ID(v, o);
  215. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  216. o.ase_texcoord3 = v.ase_texcoord;
  217. o.ase_color = v.ase_color;
  218. #ifdef ASE_ABSOLUTE_VERTEX_POS
  219. float3 defaultVertexValue = v.vertex.xyz;
  220. #else
  221. float3 defaultVertexValue = float3(0, 0, 0);
  222. #endif
  223. float3 vertexValue = defaultVertexValue;
  224. #ifdef ASE_ABSOLUTE_VERTEX_POS
  225. v.vertex.xyz = vertexValue;
  226. #else
  227. v.vertex.xyz += vertexValue;
  228. #endif
  229. v.ase_normal = v.ase_normal;
  230. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  231. float4 positionCS = TransformWorldToHClip( positionWS );
  232. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  233. o.worldPos = positionWS;
  234. #endif
  235. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  236. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  237. vertexInput.positionWS = positionWS;
  238. vertexInput.positionCS = positionCS;
  239. o.shadowCoord = GetShadowCoord( vertexInput );
  240. #endif
  241. #ifdef ASE_FOG
  242. o.fogFactor = ComputeFogFactor( positionCS.z );
  243. #endif
  244. o.clipPos = positionCS;
  245. return o;
  246. }
  247. #if defined(TESSELLATION_ON)
  248. struct VertexControl
  249. {
  250. float4 vertex : INTERNALTESSPOS;
  251. float3 ase_normal : NORMAL;
  252. float4 ase_texcoord : TEXCOORD0;
  253. float4 ase_color : COLOR;
  254. UNITY_VERTEX_INPUT_INSTANCE_ID
  255. };
  256. struct TessellationFactors
  257. {
  258. float edge[3] : SV_TessFactor;
  259. float inside : SV_InsideTessFactor;
  260. };
  261. VertexControl vert ( VertexInput v )
  262. {
  263. VertexControl o;
  264. UNITY_SETUP_INSTANCE_ID(v);
  265. UNITY_TRANSFER_INSTANCE_ID(v, o);
  266. o.vertex = v.vertex;
  267. o.ase_normal = v.ase_normal;
  268. o.ase_texcoord = v.ase_texcoord;
  269. o.ase_color = v.ase_color;
  270. return o;
  271. }
  272. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  273. {
  274. TessellationFactors o;
  275. float4 tf = 1;
  276. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  277. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  278. #if defined(ASE_FIXED_TESSELLATION)
  279. tf = FixedTess( tessValue );
  280. #elif defined(ASE_DISTANCE_TESSELLATION)
  281. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  282. #elif defined(ASE_LENGTH_TESSELLATION)
  283. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  284. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  285. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  286. #endif
  287. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  288. return o;
  289. }
  290. [domain("tri")]
  291. [partitioning("fractional_odd")]
  292. [outputtopology("triangle_cw")]
  293. [patchconstantfunc("TessellationFunction")]
  294. [outputcontrolpoints(3)]
  295. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  296. {
  297. return patch[id];
  298. }
  299. [domain("tri")]
  300. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  301. {
  302. VertexInput o = (VertexInput) 0;
  303. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  304. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  305. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  306. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  307. #if defined(ASE_PHONG_TESSELLATION)
  308. float3 pp[3];
  309. for (int i = 0; i < 3; ++i)
  310. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  311. float phongStrength = _TessPhongStrength;
  312. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  313. #endif
  314. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  315. return VertexFunction(o);
  316. }
  317. #else
  318. VertexOutput vert ( VertexInput v )
  319. {
  320. return VertexFunction( v );
  321. }
  322. #endif
  323. half4 frag ( VertexOutput IN ) : SV_Target
  324. {
  325. UNITY_SETUP_INSTANCE_ID( IN );
  326. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  327. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  328. float3 WorldPosition = IN.worldPos;
  329. #endif
  330. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  331. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  332. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  333. ShadowCoords = IN.shadowCoord;
  334. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  335. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  336. #endif
  337. #endif
  338. float2 texCoord34 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
  339. float ParticleStableRandom42 = IN.ase_texcoord3.w;
  340. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  341. float2 texCoord52 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
  342. float ifLocalVar63 = 0;
  343. if( ParticleStableRandom42 <= 0.5 )
  344. ifLocalVar63 = 1.0;
  345. else
  346. ifLocalVar63 = -1.0;
  347. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  348. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  349. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  350. float3 ColourRGB4 = (temp_output_5_0).rgb;
  351. float ColourA10 = (temp_output_5_0).a;
  352. float ParticleErosionOverLifetime30 = IN.ase_texcoord3.z;
  353. float temp_output_1_0_g2 = _RemapMin;
  354. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  355. float clampResult93 = clamp( ( ( WorldPosition.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  356. float3 BakedAlbedo = 0;
  357. float3 BakedEmission = 0;
  358. float3 Color = ColourRGB4;
  359. float Alpha = ( Opacity23 * clampResult93 );
  360. float AlphaClipThreshold = 0.5;
  361. float AlphaClipThresholdShadow = 0.5;
  362. #ifdef _ALPHATEST_ON
  363. clip( Alpha - AlphaClipThreshold );
  364. #endif
  365. #if defined(_DBUFFER)
  366. ApplyDecalToBaseColor(IN.clipPos, Color);
  367. #endif
  368. #if defined(_ALPHAPREMULTIPLY_ON)
  369. Color *= Alpha;
  370. #endif
  371. #ifdef LOD_FADE_CROSSFADE
  372. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  373. #endif
  374. #ifdef ASE_FOG
  375. Color = MixFog( Color, IN.fogFactor );
  376. #endif
  377. return half4( Color, Alpha );
  378. }
  379. ENDHLSL
  380. }
  381. Pass
  382. {
  383. Name "DepthOnly"
  384. Tags { "LightMode"="DepthOnly" }
  385. ZWrite On
  386. ColorMask 0
  387. AlphaToMask Off
  388. HLSLPROGRAM
  389. #pragma multi_compile_instancing
  390. #define _RECEIVE_SHADOWS_OFF 1
  391. #define ASE_SRP_VERSION 999999
  392. #pragma vertex vert
  393. #pragma fragment frag
  394. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  395. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  396. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  397. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  398. #define ASE_NEEDS_FRAG_WORLD_POSITION
  399. struct VertexInput
  400. {
  401. float4 vertex : POSITION;
  402. float3 ase_normal : NORMAL;
  403. float4 ase_texcoord : TEXCOORD0;
  404. float4 ase_color : COLOR;
  405. UNITY_VERTEX_INPUT_INSTANCE_ID
  406. };
  407. struct VertexOutput
  408. {
  409. float4 clipPos : SV_POSITION;
  410. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  411. float3 worldPos : TEXCOORD0;
  412. #endif
  413. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  414. float4 shadowCoord : TEXCOORD1;
  415. #endif
  416. float4 ase_texcoord2 : TEXCOORD2;
  417. float4 ase_color : COLOR;
  418. UNITY_VERTEX_INPUT_INSTANCE_ID
  419. UNITY_VERTEX_OUTPUT_STEREO
  420. };
  421. CBUFFER_START(UnityPerMaterial)
  422. float4 _Colour;
  423. float _Duplicate;
  424. float _ParticleMode;
  425. float _AlphaErosion;
  426. float _RemapMin;
  427. float _RemapMax;
  428. float _Ymask;
  429. float _YmaskExp;
  430. #ifdef TESSELLATION_ON
  431. float _TessPhongStrength;
  432. float _TessValue;
  433. float _TessMin;
  434. float _TessMax;
  435. float _TessEdgeLength;
  436. float _TessMaxDisp;
  437. #endif
  438. CBUFFER_END
  439. sampler2D _AlbedoTexture;
  440. VertexOutput VertexFunction( VertexInput v )
  441. {
  442. VertexOutput o = (VertexOutput)0;
  443. UNITY_SETUP_INSTANCE_ID(v);
  444. UNITY_TRANSFER_INSTANCE_ID(v, o);
  445. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  446. o.ase_texcoord2 = v.ase_texcoord;
  447. o.ase_color = v.ase_color;
  448. #ifdef ASE_ABSOLUTE_VERTEX_POS
  449. float3 defaultVertexValue = v.vertex.xyz;
  450. #else
  451. float3 defaultVertexValue = float3(0, 0, 0);
  452. #endif
  453. float3 vertexValue = defaultVertexValue;
  454. #ifdef ASE_ABSOLUTE_VERTEX_POS
  455. v.vertex.xyz = vertexValue;
  456. #else
  457. v.vertex.xyz += vertexValue;
  458. #endif
  459. v.ase_normal = v.ase_normal;
  460. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  461. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  462. o.worldPos = positionWS;
  463. #endif
  464. o.clipPos = TransformWorldToHClip( positionWS );
  465. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  466. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  467. vertexInput.positionWS = positionWS;
  468. vertexInput.positionCS = o.clipPos;
  469. o.shadowCoord = GetShadowCoord( vertexInput );
  470. #endif
  471. return o;
  472. }
  473. #if defined(TESSELLATION_ON)
  474. struct VertexControl
  475. {
  476. float4 vertex : INTERNALTESSPOS;
  477. float3 ase_normal : NORMAL;
  478. float4 ase_texcoord : TEXCOORD0;
  479. float4 ase_color : COLOR;
  480. UNITY_VERTEX_INPUT_INSTANCE_ID
  481. };
  482. struct TessellationFactors
  483. {
  484. float edge[3] : SV_TessFactor;
  485. float inside : SV_InsideTessFactor;
  486. };
  487. VertexControl vert ( VertexInput v )
  488. {
  489. VertexControl o;
  490. UNITY_SETUP_INSTANCE_ID(v);
  491. UNITY_TRANSFER_INSTANCE_ID(v, o);
  492. o.vertex = v.vertex;
  493. o.ase_normal = v.ase_normal;
  494. o.ase_texcoord = v.ase_texcoord;
  495. o.ase_color = v.ase_color;
  496. return o;
  497. }
  498. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  499. {
  500. TessellationFactors o;
  501. float4 tf = 1;
  502. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  503. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  504. #if defined(ASE_FIXED_TESSELLATION)
  505. tf = FixedTess( tessValue );
  506. #elif defined(ASE_DISTANCE_TESSELLATION)
  507. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  508. #elif defined(ASE_LENGTH_TESSELLATION)
  509. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  510. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  511. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  512. #endif
  513. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  514. return o;
  515. }
  516. [domain("tri")]
  517. [partitioning("fractional_odd")]
  518. [outputtopology("triangle_cw")]
  519. [patchconstantfunc("TessellationFunction")]
  520. [outputcontrolpoints(3)]
  521. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  522. {
  523. return patch[id];
  524. }
  525. [domain("tri")]
  526. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  527. {
  528. VertexInput o = (VertexInput) 0;
  529. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  530. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  531. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  532. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  533. #if defined(ASE_PHONG_TESSELLATION)
  534. float3 pp[3];
  535. for (int i = 0; i < 3; ++i)
  536. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  537. float phongStrength = _TessPhongStrength;
  538. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  539. #endif
  540. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  541. return VertexFunction(o);
  542. }
  543. #else
  544. VertexOutput vert ( VertexInput v )
  545. {
  546. return VertexFunction( v );
  547. }
  548. #endif
  549. half4 frag(VertexOutput IN ) : SV_TARGET
  550. {
  551. UNITY_SETUP_INSTANCE_ID(IN);
  552. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  553. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  554. float3 WorldPosition = IN.worldPos;
  555. #endif
  556. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  557. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  558. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  559. ShadowCoords = IN.shadowCoord;
  560. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  561. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  562. #endif
  563. #endif
  564. float2 texCoord34 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
  565. float ParticleStableRandom42 = IN.ase_texcoord2.w;
  566. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  567. float2 texCoord52 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
  568. float ifLocalVar63 = 0;
  569. if( ParticleStableRandom42 <= 0.5 )
  570. ifLocalVar63 = 1.0;
  571. else
  572. ifLocalVar63 = -1.0;
  573. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  574. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  575. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  576. float ColourA10 = (temp_output_5_0).a;
  577. float ParticleErosionOverLifetime30 = IN.ase_texcoord2.z;
  578. float temp_output_1_0_g2 = _RemapMin;
  579. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  580. float clampResult93 = clamp( ( ( WorldPosition.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  581. float Alpha = ( Opacity23 * clampResult93 );
  582. float AlphaClipThreshold = 0.5;
  583. #ifdef _ALPHATEST_ON
  584. clip(Alpha - AlphaClipThreshold);
  585. #endif
  586. #ifdef LOD_FADE_CROSSFADE
  587. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  588. #endif
  589. return 0;
  590. }
  591. ENDHLSL
  592. }
  593. Pass
  594. {
  595. Name "Universal2D"
  596. Tags { "LightMode"="Universal2D" }
  597. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  598. ZWrite Off
  599. ZTest LEqual
  600. Offset 0 , 0
  601. ColorMask RGBA
  602. HLSLPROGRAM
  603. #pragma multi_compile_instancing
  604. #define _RECEIVE_SHADOWS_OFF 1
  605. #define ASE_SRP_VERSION 999999
  606. #pragma multi_compile _ LIGHTMAP_ON
  607. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  608. #pragma shader_feature _ _SAMPLE_GI
  609. #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  610. #pragma multi_compile _ DEBUG_DISPLAY
  611. #define SHADERPASS SHADERPASS_UNLIT
  612. #pragma vertex vert
  613. #pragma fragment frag
  614. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  615. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  616. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  617. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  618. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  619. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  620. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  621. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  622. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl"
  623. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  624. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceData.hlsl"
  625. #define ASE_NEEDS_FRAG_COLOR
  626. #define ASE_NEEDS_FRAG_WORLD_POSITION
  627. struct VertexInput
  628. {
  629. float4 vertex : POSITION;
  630. float3 ase_normal : NORMAL;
  631. float4 ase_texcoord : TEXCOORD0;
  632. float4 ase_color : COLOR;
  633. UNITY_VERTEX_INPUT_INSTANCE_ID
  634. };
  635. struct VertexOutput
  636. {
  637. float4 clipPos : SV_POSITION;
  638. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  639. float3 worldPos : TEXCOORD0;
  640. #endif
  641. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  642. float4 shadowCoord : TEXCOORD1;
  643. #endif
  644. #ifdef ASE_FOG
  645. float fogFactor : TEXCOORD2;
  646. #endif
  647. float4 ase_texcoord3 : TEXCOORD3;
  648. float4 ase_color : COLOR;
  649. UNITY_VERTEX_INPUT_INSTANCE_ID
  650. UNITY_VERTEX_OUTPUT_STEREO
  651. };
  652. CBUFFER_START(UnityPerMaterial)
  653. float4 _Colour;
  654. float _Duplicate;
  655. float _ParticleMode;
  656. float _AlphaErosion;
  657. float _RemapMin;
  658. float _RemapMax;
  659. float _Ymask;
  660. float _YmaskExp;
  661. #ifdef TESSELLATION_ON
  662. float _TessPhongStrength;
  663. float _TessValue;
  664. float _TessMin;
  665. float _TessMax;
  666. float _TessEdgeLength;
  667. float _TessMaxDisp;
  668. #endif
  669. CBUFFER_END
  670. sampler2D _AlbedoTexture;
  671. VertexOutput VertexFunction ( VertexInput v )
  672. {
  673. VertexOutput o = (VertexOutput)0;
  674. UNITY_SETUP_INSTANCE_ID(v);
  675. UNITY_TRANSFER_INSTANCE_ID(v, o);
  676. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  677. o.ase_texcoord3 = v.ase_texcoord;
  678. o.ase_color = v.ase_color;
  679. #ifdef ASE_ABSOLUTE_VERTEX_POS
  680. float3 defaultVertexValue = v.vertex.xyz;
  681. #else
  682. float3 defaultVertexValue = float3(0, 0, 0);
  683. #endif
  684. float3 vertexValue = defaultVertexValue;
  685. #ifdef ASE_ABSOLUTE_VERTEX_POS
  686. v.vertex.xyz = vertexValue;
  687. #else
  688. v.vertex.xyz += vertexValue;
  689. #endif
  690. v.ase_normal = v.ase_normal;
  691. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  692. float4 positionCS = TransformWorldToHClip( positionWS );
  693. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  694. o.worldPos = positionWS;
  695. #endif
  696. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  697. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  698. vertexInput.positionWS = positionWS;
  699. vertexInput.positionCS = positionCS;
  700. o.shadowCoord = GetShadowCoord( vertexInput );
  701. #endif
  702. #ifdef ASE_FOG
  703. o.fogFactor = ComputeFogFactor( positionCS.z );
  704. #endif
  705. o.clipPos = positionCS;
  706. return o;
  707. }
  708. #if defined(TESSELLATION_ON)
  709. struct VertexControl
  710. {
  711. float4 vertex : INTERNALTESSPOS;
  712. float3 ase_normal : NORMAL;
  713. float4 ase_texcoord : TEXCOORD0;
  714. float4 ase_color : COLOR;
  715. UNITY_VERTEX_INPUT_INSTANCE_ID
  716. };
  717. struct TessellationFactors
  718. {
  719. float edge[3] : SV_TessFactor;
  720. float inside : SV_InsideTessFactor;
  721. };
  722. VertexControl vert ( VertexInput v )
  723. {
  724. VertexControl o;
  725. UNITY_SETUP_INSTANCE_ID(v);
  726. UNITY_TRANSFER_INSTANCE_ID(v, o);
  727. o.vertex = v.vertex;
  728. o.ase_normal = v.ase_normal;
  729. o.ase_texcoord = v.ase_texcoord;
  730. o.ase_color = v.ase_color;
  731. return o;
  732. }
  733. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  734. {
  735. TessellationFactors o;
  736. float4 tf = 1;
  737. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  738. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  739. #if defined(ASE_FIXED_TESSELLATION)
  740. tf = FixedTess( tessValue );
  741. #elif defined(ASE_DISTANCE_TESSELLATION)
  742. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  743. #elif defined(ASE_LENGTH_TESSELLATION)
  744. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  745. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  746. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  747. #endif
  748. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  749. return o;
  750. }
  751. [domain("tri")]
  752. [partitioning("fractional_odd")]
  753. [outputtopology("triangle_cw")]
  754. [patchconstantfunc("TessellationFunction")]
  755. [outputcontrolpoints(3)]
  756. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  757. {
  758. return patch[id];
  759. }
  760. [domain("tri")]
  761. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  762. {
  763. VertexInput o = (VertexInput) 0;
  764. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  765. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  766. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  767. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  768. #if defined(ASE_PHONG_TESSELLATION)
  769. float3 pp[3];
  770. for (int i = 0; i < 3; ++i)
  771. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  772. float phongStrength = _TessPhongStrength;
  773. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  774. #endif
  775. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  776. return VertexFunction(o);
  777. }
  778. #else
  779. VertexOutput vert ( VertexInput v )
  780. {
  781. return VertexFunction( v );
  782. }
  783. #endif
  784. half4 frag ( VertexOutput IN ) : SV_Target
  785. {
  786. UNITY_SETUP_INSTANCE_ID( IN );
  787. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  788. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  789. float3 WorldPosition = IN.worldPos;
  790. #endif
  791. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  792. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  793. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  794. ShadowCoords = IN.shadowCoord;
  795. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  796. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  797. #endif
  798. #endif
  799. float2 texCoord34 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
  800. float ParticleStableRandom42 = IN.ase_texcoord3.w;
  801. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  802. float2 texCoord52 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
  803. float ifLocalVar63 = 0;
  804. if( ParticleStableRandom42 <= 0.5 )
  805. ifLocalVar63 = 1.0;
  806. else
  807. ifLocalVar63 = -1.0;
  808. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  809. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  810. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  811. float3 ColourRGB4 = (temp_output_5_0).rgb;
  812. float ColourA10 = (temp_output_5_0).a;
  813. float ParticleErosionOverLifetime30 = IN.ase_texcoord3.z;
  814. float temp_output_1_0_g2 = _RemapMin;
  815. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  816. float clampResult93 = clamp( ( ( WorldPosition.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  817. float3 BakedAlbedo = 0;
  818. float3 BakedEmission = 0;
  819. float3 Color = ColourRGB4;
  820. float Alpha = ( Opacity23 * clampResult93 );
  821. float AlphaClipThreshold = 0.5;
  822. float AlphaClipThresholdShadow = 0.5;
  823. #ifdef _ALPHATEST_ON
  824. clip( Alpha - AlphaClipThreshold );
  825. #endif
  826. #if defined(_DBUFFER)
  827. ApplyDecalToBaseColor(IN.clipPos, Color);
  828. #endif
  829. #if defined(_ALPHAPREMULTIPLY_ON)
  830. Color *= Alpha;
  831. #endif
  832. #ifdef LOD_FADE_CROSSFADE
  833. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  834. #endif
  835. #ifdef ASE_FOG
  836. Color = MixFog( Color, IN.fogFactor );
  837. #endif
  838. return half4( Color, Alpha );
  839. }
  840. ENDHLSL
  841. }
  842. Pass
  843. {
  844. Name "SceneSelectionPass"
  845. Tags { "LightMode"="SceneSelectionPass" }
  846. Cull Off
  847. HLSLPROGRAM
  848. #pragma multi_compile_instancing
  849. #define _RECEIVE_SHADOWS_OFF 1
  850. #define ASE_SRP_VERSION 999999
  851. #pragma only_renderers d3d11 glcore gles gles3
  852. #pragma vertex vert
  853. #pragma fragment frag
  854. #define ATTRIBUTES_NEED_NORMAL
  855. #define ATTRIBUTES_NEED_TANGENT
  856. #define SHADERPASS SHADERPASS_DEPTHONLY
  857. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  858. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  859. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  860. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  861. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  862. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  863. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  864. struct VertexInput
  865. {
  866. float4 vertex : POSITION;
  867. float3 ase_normal : NORMAL;
  868. float4 ase_texcoord : TEXCOORD0;
  869. float4 ase_color : COLOR;
  870. UNITY_VERTEX_INPUT_INSTANCE_ID
  871. };
  872. struct VertexOutput
  873. {
  874. float4 clipPos : SV_POSITION;
  875. float4 ase_texcoord : TEXCOORD0;
  876. float4 ase_color : COLOR;
  877. float4 ase_texcoord1 : TEXCOORD1;
  878. UNITY_VERTEX_INPUT_INSTANCE_ID
  879. UNITY_VERTEX_OUTPUT_STEREO
  880. };
  881. CBUFFER_START(UnityPerMaterial)
  882. float4 _Colour;
  883. float _Duplicate;
  884. float _ParticleMode;
  885. float _AlphaErosion;
  886. float _RemapMin;
  887. float _RemapMax;
  888. float _Ymask;
  889. float _YmaskExp;
  890. #ifdef TESSELLATION_ON
  891. float _TessPhongStrength;
  892. float _TessValue;
  893. float _TessMin;
  894. float _TessMax;
  895. float _TessEdgeLength;
  896. float _TessMaxDisp;
  897. #endif
  898. CBUFFER_END
  899. sampler2D _AlbedoTexture;
  900. int _ObjectId;
  901. int _PassValue;
  902. struct SurfaceDescription
  903. {
  904. float Alpha;
  905. float AlphaClipThreshold;
  906. };
  907. VertexOutput VertexFunction(VertexInput v )
  908. {
  909. VertexOutput o;
  910. ZERO_INITIALIZE(VertexOutput, o);
  911. UNITY_SETUP_INSTANCE_ID(v);
  912. UNITY_TRANSFER_INSTANCE_ID(v, o);
  913. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  914. float3 ase_worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz;
  915. o.ase_texcoord1.xyz = ase_worldPos;
  916. o.ase_texcoord = v.ase_texcoord;
  917. o.ase_color = v.ase_color;
  918. //setting value to unused interpolator channels and avoid initialization warnings
  919. o.ase_texcoord1.w = 0;
  920. #ifdef ASE_ABSOLUTE_VERTEX_POS
  921. float3 defaultVertexValue = v.vertex.xyz;
  922. #else
  923. float3 defaultVertexValue = float3(0, 0, 0);
  924. #endif
  925. float3 vertexValue = defaultVertexValue;
  926. #ifdef ASE_ABSOLUTE_VERTEX_POS
  927. v.vertex.xyz = vertexValue;
  928. #else
  929. v.vertex.xyz += vertexValue;
  930. #endif
  931. v.ase_normal = v.ase_normal;
  932. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  933. o.clipPos = TransformWorldToHClip(positionWS);
  934. return o;
  935. }
  936. #if defined(TESSELLATION_ON)
  937. struct VertexControl
  938. {
  939. float4 vertex : INTERNALTESSPOS;
  940. float3 ase_normal : NORMAL;
  941. float4 ase_texcoord : TEXCOORD0;
  942. float4 ase_color : COLOR;
  943. UNITY_VERTEX_INPUT_INSTANCE_ID
  944. };
  945. struct TessellationFactors
  946. {
  947. float edge[3] : SV_TessFactor;
  948. float inside : SV_InsideTessFactor;
  949. };
  950. VertexControl vert ( VertexInput v )
  951. {
  952. VertexControl o;
  953. UNITY_SETUP_INSTANCE_ID(v);
  954. UNITY_TRANSFER_INSTANCE_ID(v, o);
  955. o.vertex = v.vertex;
  956. o.ase_normal = v.ase_normal;
  957. o.ase_texcoord = v.ase_texcoord;
  958. o.ase_color = v.ase_color;
  959. return o;
  960. }
  961. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  962. {
  963. TessellationFactors o;
  964. float4 tf = 1;
  965. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  966. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  967. #if defined(ASE_FIXED_TESSELLATION)
  968. tf = FixedTess( tessValue );
  969. #elif defined(ASE_DISTANCE_TESSELLATION)
  970. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  971. #elif defined(ASE_LENGTH_TESSELLATION)
  972. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  973. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  974. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  975. #endif
  976. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  977. return o;
  978. }
  979. [domain("tri")]
  980. [partitioning("fractional_odd")]
  981. [outputtopology("triangle_cw")]
  982. [patchconstantfunc("TessellationFunction")]
  983. [outputcontrolpoints(3)]
  984. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  985. {
  986. return patch[id];
  987. }
  988. [domain("tri")]
  989. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  990. {
  991. VertexInput o = (VertexInput) 0;
  992. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  993. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  994. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  995. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  996. #if defined(ASE_PHONG_TESSELLATION)
  997. float3 pp[3];
  998. for (int i = 0; i < 3; ++i)
  999. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1000. float phongStrength = _TessPhongStrength;
  1001. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1002. #endif
  1003. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1004. return VertexFunction(o);
  1005. }
  1006. #else
  1007. VertexOutput vert ( VertexInput v )
  1008. {
  1009. return VertexFunction( v );
  1010. }
  1011. #endif
  1012. half4 frag(VertexOutput IN ) : SV_TARGET
  1013. {
  1014. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1015. float2 texCoord34 = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
  1016. float ParticleStableRandom42 = IN.ase_texcoord.w;
  1017. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  1018. float2 texCoord52 = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
  1019. float ifLocalVar63 = 0;
  1020. if( ParticleStableRandom42 <= 0.5 )
  1021. ifLocalVar63 = 1.0;
  1022. else
  1023. ifLocalVar63 = -1.0;
  1024. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  1025. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  1026. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  1027. float ColourA10 = (temp_output_5_0).a;
  1028. float ParticleErosionOverLifetime30 = IN.ase_texcoord.z;
  1029. float temp_output_1_0_g2 = _RemapMin;
  1030. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  1031. float3 ase_worldPos = IN.ase_texcoord1.xyz;
  1032. float clampResult93 = clamp( ( ( ase_worldPos.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  1033. surfaceDescription.Alpha = ( Opacity23 * clampResult93 );
  1034. surfaceDescription.AlphaClipThreshold = 0.5;
  1035. #if _ALPHATEST_ON
  1036. float alphaClipThreshold = 0.01f;
  1037. #if ALPHA_CLIP_THRESHOLD
  1038. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  1039. #endif
  1040. clip(surfaceDescription.Alpha - alphaClipThreshold);
  1041. #endif
  1042. half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  1043. return outColor;
  1044. }
  1045. ENDHLSL
  1046. }
  1047. Pass
  1048. {
  1049. Name "ScenePickingPass"
  1050. Tags { "LightMode"="Picking" }
  1051. HLSLPROGRAM
  1052. #pragma multi_compile_instancing
  1053. #define _RECEIVE_SHADOWS_OFF 1
  1054. #define ASE_SRP_VERSION 999999
  1055. #pragma only_renderers d3d11 glcore gles gles3
  1056. #pragma vertex vert
  1057. #pragma fragment frag
  1058. #define ATTRIBUTES_NEED_NORMAL
  1059. #define ATTRIBUTES_NEED_TANGENT
  1060. #define SHADERPASS SHADERPASS_DEPTHONLY
  1061. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1062. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1063. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1064. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1065. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1066. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1067. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1068. struct VertexInput
  1069. {
  1070. float4 vertex : POSITION;
  1071. float3 ase_normal : NORMAL;
  1072. float4 ase_texcoord : TEXCOORD0;
  1073. float4 ase_color : COLOR;
  1074. UNITY_VERTEX_INPUT_INSTANCE_ID
  1075. };
  1076. struct VertexOutput
  1077. {
  1078. float4 clipPos : SV_POSITION;
  1079. float4 ase_texcoord : TEXCOORD0;
  1080. float4 ase_color : COLOR;
  1081. float4 ase_texcoord1 : TEXCOORD1;
  1082. UNITY_VERTEX_INPUT_INSTANCE_ID
  1083. UNITY_VERTEX_OUTPUT_STEREO
  1084. };
  1085. CBUFFER_START(UnityPerMaterial)
  1086. float4 _Colour;
  1087. float _Duplicate;
  1088. float _ParticleMode;
  1089. float _AlphaErosion;
  1090. float _RemapMin;
  1091. float _RemapMax;
  1092. float _Ymask;
  1093. float _YmaskExp;
  1094. #ifdef TESSELLATION_ON
  1095. float _TessPhongStrength;
  1096. float _TessValue;
  1097. float _TessMin;
  1098. float _TessMax;
  1099. float _TessEdgeLength;
  1100. float _TessMaxDisp;
  1101. #endif
  1102. CBUFFER_END
  1103. sampler2D _AlbedoTexture;
  1104. float4 _SelectionID;
  1105. struct SurfaceDescription
  1106. {
  1107. float Alpha;
  1108. float AlphaClipThreshold;
  1109. };
  1110. VertexOutput VertexFunction(VertexInput v )
  1111. {
  1112. VertexOutput o;
  1113. ZERO_INITIALIZE(VertexOutput, o);
  1114. UNITY_SETUP_INSTANCE_ID(v);
  1115. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1116. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1117. float3 ase_worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz;
  1118. o.ase_texcoord1.xyz = ase_worldPos;
  1119. o.ase_texcoord = v.ase_texcoord;
  1120. o.ase_color = v.ase_color;
  1121. //setting value to unused interpolator channels and avoid initialization warnings
  1122. o.ase_texcoord1.w = 0;
  1123. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1124. float3 defaultVertexValue = v.vertex.xyz;
  1125. #else
  1126. float3 defaultVertexValue = float3(0, 0, 0);
  1127. #endif
  1128. float3 vertexValue = defaultVertexValue;
  1129. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1130. v.vertex.xyz = vertexValue;
  1131. #else
  1132. v.vertex.xyz += vertexValue;
  1133. #endif
  1134. v.ase_normal = v.ase_normal;
  1135. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  1136. o.clipPos = TransformWorldToHClip(positionWS);
  1137. return o;
  1138. }
  1139. #if defined(TESSELLATION_ON)
  1140. struct VertexControl
  1141. {
  1142. float4 vertex : INTERNALTESSPOS;
  1143. float3 ase_normal : NORMAL;
  1144. float4 ase_texcoord : TEXCOORD0;
  1145. float4 ase_color : COLOR;
  1146. UNITY_VERTEX_INPUT_INSTANCE_ID
  1147. };
  1148. struct TessellationFactors
  1149. {
  1150. float edge[3] : SV_TessFactor;
  1151. float inside : SV_InsideTessFactor;
  1152. };
  1153. VertexControl vert ( VertexInput v )
  1154. {
  1155. VertexControl o;
  1156. UNITY_SETUP_INSTANCE_ID(v);
  1157. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1158. o.vertex = v.vertex;
  1159. o.ase_normal = v.ase_normal;
  1160. o.ase_texcoord = v.ase_texcoord;
  1161. o.ase_color = v.ase_color;
  1162. return o;
  1163. }
  1164. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1165. {
  1166. TessellationFactors o;
  1167. float4 tf = 1;
  1168. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1169. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1170. #if defined(ASE_FIXED_TESSELLATION)
  1171. tf = FixedTess( tessValue );
  1172. #elif defined(ASE_DISTANCE_TESSELLATION)
  1173. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1174. #elif defined(ASE_LENGTH_TESSELLATION)
  1175. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1176. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1177. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1178. #endif
  1179. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1180. return o;
  1181. }
  1182. [domain("tri")]
  1183. [partitioning("fractional_odd")]
  1184. [outputtopology("triangle_cw")]
  1185. [patchconstantfunc("TessellationFunction")]
  1186. [outputcontrolpoints(3)]
  1187. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1188. {
  1189. return patch[id];
  1190. }
  1191. [domain("tri")]
  1192. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1193. {
  1194. VertexInput o = (VertexInput) 0;
  1195. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1196. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  1197. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  1198. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1199. #if defined(ASE_PHONG_TESSELLATION)
  1200. float3 pp[3];
  1201. for (int i = 0; i < 3; ++i)
  1202. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1203. float phongStrength = _TessPhongStrength;
  1204. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1205. #endif
  1206. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1207. return VertexFunction(o);
  1208. }
  1209. #else
  1210. VertexOutput vert ( VertexInput v )
  1211. {
  1212. return VertexFunction( v );
  1213. }
  1214. #endif
  1215. half4 frag(VertexOutput IN ) : SV_TARGET
  1216. {
  1217. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1218. float2 texCoord34 = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
  1219. float ParticleStableRandom42 = IN.ase_texcoord.w;
  1220. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  1221. float2 texCoord52 = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
  1222. float ifLocalVar63 = 0;
  1223. if( ParticleStableRandom42 <= 0.5 )
  1224. ifLocalVar63 = 1.0;
  1225. else
  1226. ifLocalVar63 = -1.0;
  1227. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  1228. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  1229. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  1230. float ColourA10 = (temp_output_5_0).a;
  1231. float ParticleErosionOverLifetime30 = IN.ase_texcoord.z;
  1232. float temp_output_1_0_g2 = _RemapMin;
  1233. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  1234. float3 ase_worldPos = IN.ase_texcoord1.xyz;
  1235. float clampResult93 = clamp( ( ( ase_worldPos.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  1236. surfaceDescription.Alpha = ( Opacity23 * clampResult93 );
  1237. surfaceDescription.AlphaClipThreshold = 0.5;
  1238. #if _ALPHATEST_ON
  1239. float alphaClipThreshold = 0.01f;
  1240. #if ALPHA_CLIP_THRESHOLD
  1241. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  1242. #endif
  1243. clip(surfaceDescription.Alpha - alphaClipThreshold);
  1244. #endif
  1245. half4 outColor = 0;
  1246. outColor = _SelectionID;
  1247. return outColor;
  1248. }
  1249. ENDHLSL
  1250. }
  1251. Pass
  1252. {
  1253. Name "DepthNormals"
  1254. Tags { "LightMode"="DepthNormalsOnly" }
  1255. ZTest LEqual
  1256. ZWrite On
  1257. HLSLPROGRAM
  1258. #pragma multi_compile_instancing
  1259. #define _RECEIVE_SHADOWS_OFF 1
  1260. #define ASE_SRP_VERSION 999999
  1261. #pragma only_renderers d3d11 glcore gles gles3
  1262. #pragma multi_compile_fog
  1263. #pragma instancing_options renderinglayer
  1264. #pragma vertex vert
  1265. #pragma fragment frag
  1266. #define ATTRIBUTES_NEED_NORMAL
  1267. #define ATTRIBUTES_NEED_TANGENT
  1268. #define VARYINGS_NEED_NORMAL_WS
  1269. #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
  1270. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1271. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1272. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1273. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1274. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1275. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1276. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1277. struct VertexInput
  1278. {
  1279. float4 vertex : POSITION;
  1280. float3 ase_normal : NORMAL;
  1281. float4 ase_texcoord : TEXCOORD0;
  1282. float4 ase_color : COLOR;
  1283. UNITY_VERTEX_INPUT_INSTANCE_ID
  1284. };
  1285. struct VertexOutput
  1286. {
  1287. float4 clipPos : SV_POSITION;
  1288. float3 normalWS : TEXCOORD0;
  1289. float4 ase_texcoord1 : TEXCOORD1;
  1290. float4 ase_color : COLOR;
  1291. float4 ase_texcoord2 : TEXCOORD2;
  1292. UNITY_VERTEX_INPUT_INSTANCE_ID
  1293. UNITY_VERTEX_OUTPUT_STEREO
  1294. };
  1295. CBUFFER_START(UnityPerMaterial)
  1296. float4 _Colour;
  1297. float _Duplicate;
  1298. float _ParticleMode;
  1299. float _AlphaErosion;
  1300. float _RemapMin;
  1301. float _RemapMax;
  1302. float _Ymask;
  1303. float _YmaskExp;
  1304. #ifdef TESSELLATION_ON
  1305. float _TessPhongStrength;
  1306. float _TessValue;
  1307. float _TessMin;
  1308. float _TessMax;
  1309. float _TessEdgeLength;
  1310. float _TessMaxDisp;
  1311. #endif
  1312. CBUFFER_END
  1313. sampler2D _AlbedoTexture;
  1314. struct SurfaceDescription
  1315. {
  1316. float Alpha;
  1317. float AlphaClipThreshold;
  1318. };
  1319. VertexOutput VertexFunction(VertexInput v )
  1320. {
  1321. VertexOutput o;
  1322. ZERO_INITIALIZE(VertexOutput, o);
  1323. UNITY_SETUP_INSTANCE_ID(v);
  1324. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1325. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1326. float3 ase_worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz;
  1327. o.ase_texcoord2.xyz = ase_worldPos;
  1328. o.ase_texcoord1 = v.ase_texcoord;
  1329. o.ase_color = v.ase_color;
  1330. //setting value to unused interpolator channels and avoid initialization warnings
  1331. o.ase_texcoord2.w = 0;
  1332. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1333. float3 defaultVertexValue = v.vertex.xyz;
  1334. #else
  1335. float3 defaultVertexValue = float3(0, 0, 0);
  1336. #endif
  1337. float3 vertexValue = defaultVertexValue;
  1338. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1339. v.vertex.xyz = vertexValue;
  1340. #else
  1341. v.vertex.xyz += vertexValue;
  1342. #endif
  1343. v.ase_normal = v.ase_normal;
  1344. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  1345. float3 normalWS = TransformObjectToWorldNormal(v.ase_normal);
  1346. o.clipPos = TransformWorldToHClip(positionWS);
  1347. o.normalWS.xyz = normalWS;
  1348. return o;
  1349. }
  1350. #if defined(TESSELLATION_ON)
  1351. struct VertexControl
  1352. {
  1353. float4 vertex : INTERNALTESSPOS;
  1354. float3 ase_normal : NORMAL;
  1355. float4 ase_texcoord : TEXCOORD0;
  1356. float4 ase_color : COLOR;
  1357. UNITY_VERTEX_INPUT_INSTANCE_ID
  1358. };
  1359. struct TessellationFactors
  1360. {
  1361. float edge[3] : SV_TessFactor;
  1362. float inside : SV_InsideTessFactor;
  1363. };
  1364. VertexControl vert ( VertexInput v )
  1365. {
  1366. VertexControl o;
  1367. UNITY_SETUP_INSTANCE_ID(v);
  1368. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1369. o.vertex = v.vertex;
  1370. o.ase_normal = v.ase_normal;
  1371. o.ase_texcoord = v.ase_texcoord;
  1372. o.ase_color = v.ase_color;
  1373. return o;
  1374. }
  1375. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1376. {
  1377. TessellationFactors o;
  1378. float4 tf = 1;
  1379. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1380. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1381. #if defined(ASE_FIXED_TESSELLATION)
  1382. tf = FixedTess( tessValue );
  1383. #elif defined(ASE_DISTANCE_TESSELLATION)
  1384. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1385. #elif defined(ASE_LENGTH_TESSELLATION)
  1386. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1387. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1388. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1389. #endif
  1390. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1391. return o;
  1392. }
  1393. [domain("tri")]
  1394. [partitioning("fractional_odd")]
  1395. [outputtopology("triangle_cw")]
  1396. [patchconstantfunc("TessellationFunction")]
  1397. [outputcontrolpoints(3)]
  1398. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1399. {
  1400. return patch[id];
  1401. }
  1402. [domain("tri")]
  1403. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1404. {
  1405. VertexInput o = (VertexInput) 0;
  1406. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1407. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  1408. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  1409. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1410. #if defined(ASE_PHONG_TESSELLATION)
  1411. float3 pp[3];
  1412. for (int i = 0; i < 3; ++i)
  1413. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1414. float phongStrength = _TessPhongStrength;
  1415. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1416. #endif
  1417. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1418. return VertexFunction(o);
  1419. }
  1420. #else
  1421. VertexOutput vert ( VertexInput v )
  1422. {
  1423. return VertexFunction( v );
  1424. }
  1425. #endif
  1426. half4 frag(VertexOutput IN ) : SV_TARGET
  1427. {
  1428. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1429. float2 texCoord34 = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
  1430. float ParticleStableRandom42 = IN.ase_texcoord1.w;
  1431. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  1432. float2 texCoord52 = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
  1433. float ifLocalVar63 = 0;
  1434. if( ParticleStableRandom42 <= 0.5 )
  1435. ifLocalVar63 = 1.0;
  1436. else
  1437. ifLocalVar63 = -1.0;
  1438. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  1439. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  1440. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  1441. float ColourA10 = (temp_output_5_0).a;
  1442. float ParticleErosionOverLifetime30 = IN.ase_texcoord1.z;
  1443. float temp_output_1_0_g2 = _RemapMin;
  1444. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  1445. float3 ase_worldPos = IN.ase_texcoord2.xyz;
  1446. float clampResult93 = clamp( ( ( ase_worldPos.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  1447. surfaceDescription.Alpha = ( Opacity23 * clampResult93 );
  1448. surfaceDescription.AlphaClipThreshold = 0.5;
  1449. #if _ALPHATEST_ON
  1450. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  1451. #endif
  1452. #ifdef LOD_FADE_CROSSFADE
  1453. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  1454. #endif
  1455. float3 normalWS = IN.normalWS;
  1456. return half4(NormalizeNormalPerPixel(normalWS), 0.0);
  1457. }
  1458. ENDHLSL
  1459. }
  1460. Pass
  1461. {
  1462. Name "DepthNormalsOnly"
  1463. Tags { "LightMode"="DepthNormalsOnly" }
  1464. ZTest LEqual
  1465. ZWrite On
  1466. HLSLPROGRAM
  1467. #pragma multi_compile_instancing
  1468. #define _RECEIVE_SHADOWS_OFF 1
  1469. #define ASE_SRP_VERSION 999999
  1470. #pragma exclude_renderers glcore gles gles3
  1471. #pragma vertex vert
  1472. #pragma fragment frag
  1473. #define ATTRIBUTES_NEED_NORMAL
  1474. #define ATTRIBUTES_NEED_TANGENT
  1475. #define ATTRIBUTES_NEED_TEXCOORD1
  1476. #define VARYINGS_NEED_NORMAL_WS
  1477. #define VARYINGS_NEED_TANGENT_WS
  1478. #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
  1479. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1480. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1481. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1482. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1483. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1484. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1485. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1486. struct VertexInput
  1487. {
  1488. float4 vertex : POSITION;
  1489. float3 ase_normal : NORMAL;
  1490. float4 ase_texcoord : TEXCOORD0;
  1491. float4 ase_color : COLOR;
  1492. UNITY_VERTEX_INPUT_INSTANCE_ID
  1493. };
  1494. struct VertexOutput
  1495. {
  1496. float4 clipPos : SV_POSITION;
  1497. float3 normalWS : TEXCOORD0;
  1498. float4 ase_texcoord1 : TEXCOORD1;
  1499. float4 ase_color : COLOR;
  1500. float4 ase_texcoord2 : TEXCOORD2;
  1501. UNITY_VERTEX_INPUT_INSTANCE_ID
  1502. UNITY_VERTEX_OUTPUT_STEREO
  1503. };
  1504. CBUFFER_START(UnityPerMaterial)
  1505. float4 _Colour;
  1506. float _Duplicate;
  1507. float _ParticleMode;
  1508. float _AlphaErosion;
  1509. float _RemapMin;
  1510. float _RemapMax;
  1511. float _Ymask;
  1512. float _YmaskExp;
  1513. #ifdef TESSELLATION_ON
  1514. float _TessPhongStrength;
  1515. float _TessValue;
  1516. float _TessMin;
  1517. float _TessMax;
  1518. float _TessEdgeLength;
  1519. float _TessMaxDisp;
  1520. #endif
  1521. CBUFFER_END
  1522. sampler2D _AlbedoTexture;
  1523. struct SurfaceDescription
  1524. {
  1525. float Alpha;
  1526. float AlphaClipThreshold;
  1527. };
  1528. VertexOutput VertexFunction(VertexInput v )
  1529. {
  1530. VertexOutput o;
  1531. ZERO_INITIALIZE(VertexOutput, o);
  1532. UNITY_SETUP_INSTANCE_ID(v);
  1533. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1534. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1535. float3 ase_worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz;
  1536. o.ase_texcoord2.xyz = ase_worldPos;
  1537. o.ase_texcoord1 = v.ase_texcoord;
  1538. o.ase_color = v.ase_color;
  1539. //setting value to unused interpolator channels and avoid initialization warnings
  1540. o.ase_texcoord2.w = 0;
  1541. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1542. float3 defaultVertexValue = v.vertex.xyz;
  1543. #else
  1544. float3 defaultVertexValue = float3(0, 0, 0);
  1545. #endif
  1546. float3 vertexValue = defaultVertexValue;
  1547. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1548. v.vertex.xyz = vertexValue;
  1549. #else
  1550. v.vertex.xyz += vertexValue;
  1551. #endif
  1552. v.ase_normal = v.ase_normal;
  1553. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  1554. float3 normalWS = TransformObjectToWorldNormal(v.ase_normal);
  1555. o.clipPos = TransformWorldToHClip(positionWS);
  1556. o.normalWS.xyz = normalWS;
  1557. return o;
  1558. }
  1559. #if defined(TESSELLATION_ON)
  1560. struct VertexControl
  1561. {
  1562. float4 vertex : INTERNALTESSPOS;
  1563. float3 ase_normal : NORMAL;
  1564. float4 ase_texcoord : TEXCOORD0;
  1565. float4 ase_color : COLOR;
  1566. UNITY_VERTEX_INPUT_INSTANCE_ID
  1567. };
  1568. struct TessellationFactors
  1569. {
  1570. float edge[3] : SV_TessFactor;
  1571. float inside : SV_InsideTessFactor;
  1572. };
  1573. VertexControl vert ( VertexInput v )
  1574. {
  1575. VertexControl o;
  1576. UNITY_SETUP_INSTANCE_ID(v);
  1577. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1578. o.vertex = v.vertex;
  1579. o.ase_normal = v.ase_normal;
  1580. o.ase_texcoord = v.ase_texcoord;
  1581. o.ase_color = v.ase_color;
  1582. return o;
  1583. }
  1584. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1585. {
  1586. TessellationFactors o;
  1587. float4 tf = 1;
  1588. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1589. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1590. #if defined(ASE_FIXED_TESSELLATION)
  1591. tf = FixedTess( tessValue );
  1592. #elif defined(ASE_DISTANCE_TESSELLATION)
  1593. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1594. #elif defined(ASE_LENGTH_TESSELLATION)
  1595. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1596. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1597. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1598. #endif
  1599. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1600. return o;
  1601. }
  1602. [domain("tri")]
  1603. [partitioning("fractional_odd")]
  1604. [outputtopology("triangle_cw")]
  1605. [patchconstantfunc("TessellationFunction")]
  1606. [outputcontrolpoints(3)]
  1607. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1608. {
  1609. return patch[id];
  1610. }
  1611. [domain("tri")]
  1612. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1613. {
  1614. VertexInput o = (VertexInput) 0;
  1615. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1616. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  1617. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  1618. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1619. #if defined(ASE_PHONG_TESSELLATION)
  1620. float3 pp[3];
  1621. for (int i = 0; i < 3; ++i)
  1622. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1623. float phongStrength = _TessPhongStrength;
  1624. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1625. #endif
  1626. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1627. return VertexFunction(o);
  1628. }
  1629. #else
  1630. VertexOutput vert ( VertexInput v )
  1631. {
  1632. return VertexFunction( v );
  1633. }
  1634. #endif
  1635. half4 frag(VertexOutput IN ) : SV_TARGET
  1636. {
  1637. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1638. float2 texCoord34 = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
  1639. float ParticleStableRandom42 = IN.ase_texcoord1.w;
  1640. float2 appendResult40 = (float2(0.0 , ParticleStableRandom42));
  1641. float2 texCoord52 = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
  1642. float ifLocalVar63 = 0;
  1643. if( ParticleStableRandom42 <= 0.5 )
  1644. ifLocalVar63 = 1.0;
  1645. else
  1646. ifLocalVar63 = -1.0;
  1647. float2 appendResult54 = (float2(0.0 , ( ParticleStableRandom42 - 0.5 )));
  1648. float4 AlbedoTextureSample48 = saturate( ( tex2D( _AlbedoTexture, ( texCoord34 + appendResult40 ) ) + ( tex2D( _AlbedoTexture, ( ( texCoord52 * ifLocalVar63 ) + appendResult54 ) ) * _Duplicate ) ) );
  1649. float4 temp_output_5_0 = ( AlbedoTextureSample48 * IN.ase_color * _Colour );
  1650. float ColourA10 = (temp_output_5_0).a;
  1651. float ParticleErosionOverLifetime30 = IN.ase_texcoord1.z;
  1652. float temp_output_1_0_g2 = _RemapMin;
  1653. float Opacity23 = saturate( ( ( saturate( ( ColourA10 - (( _ParticleMode )?( ParticleErosionOverLifetime30 ):( _AlphaErosion )) ) ) - temp_output_1_0_g2 ) / ( _RemapMax - temp_output_1_0_g2 ) ) );
  1654. float3 ase_worldPos = IN.ase_texcoord2.xyz;
  1655. float clampResult93 = clamp( ( ( ase_worldPos.y - _Ymask ) * _YmaskExp ) , 0.0 , 1.0 );
  1656. surfaceDescription.Alpha = ( Opacity23 * clampResult93 );
  1657. surfaceDescription.AlphaClipThreshold = 0.5;
  1658. #if _ALPHATEST_ON
  1659. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  1660. #endif
  1661. #ifdef LOD_FADE_CROSSFADE
  1662. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  1663. #endif
  1664. float3 normalWS = IN.normalWS;
  1665. return half4(NormalizeNormalPerPixel(normalWS), 0.0);
  1666. }
  1667. ENDHLSL
  1668. }
  1669. }
  1670. CustomEditor "UnityEditor.ShaderGraphUnlitGUI"
  1671. Fallback "False"
  1672. }
  1673. /*ASEBEGIN
  1674. Version=18935
  1675. 2092.8;176.8;1567.2;735;829.6702;66.65156;1.026331;True;False
  1676. Node;AmplifyShaderEditor.TexCoordVertexDataNode;86;-4907.174,995.6688;Inherit;False;0;4;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1677. Node;AmplifyShaderEditor.RegisterLocalVarNode;42;-4530.296,1039.647;Inherit;False;ParticleStableRandom;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  1678. Node;AmplifyShaderEditor.RangedFloatNode;65;-3804.417,269.1858;Inherit;False;Constant;_Float1;Float 1;6;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
  1679. Node;AmplifyShaderEditor.RangedFloatNode;64;-3803.417,177.1858;Inherit;False;Constant;_Float0;Float 0;6;0;Create;True;0;0;0;False;0;False;-1;0;0;0;0;1;FLOAT;0
  1680. Node;AmplifyShaderEditor.GetLocalVarNode;55;-3887.397,4.424606;Inherit;False;42;ParticleStableRandom;1;0;OBJECT;;False;1;FLOAT;0
  1681. Node;AmplifyShaderEditor.TexturePropertyNode;45;-2834.576,-1077.884;Inherit;True;Property;_AlbedoTexture;Albedo Texture;5;0;Create;True;0;0;0;False;0;False;None;af896ed708756ad4389f5afe872676b2;False;white;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
  1682. Node;AmplifyShaderEditor.TextureCoordinatesNode;52;-3505.815,-122.2801;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1683. Node;AmplifyShaderEditor.SimpleSubtractOpNode;58;-3427.291,214.0071;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0.5;False;1;FLOAT;0
  1684. Node;AmplifyShaderEditor.ConditionalIfNode;63;-3464.289,22.70003;Inherit;False;False;5;0;FLOAT;0;False;1;FLOAT;0.5;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;1;FLOAT;0
  1685. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;62;-3083.363,-61.91193;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  1686. Node;AmplifyShaderEditor.DynamicAppendNode;54;-3044.616,83.11993;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  1687. Node;AmplifyShaderEditor.RegisterLocalVarNode;46;-2546.912,-1080.454;Inherit;False;AlbedoTexture;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
  1688. Node;AmplifyShaderEditor.GetLocalVarNode;43;-3454.442,-270.0697;Inherit;False;42;ParticleStableRandom;1;0;OBJECT;;False;1;FLOAT;0
  1689. Node;AmplifyShaderEditor.DynamicAppendNode;40;-3031.5,-289.6468;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  1690. Node;AmplifyShaderEditor.TextureCoordinatesNode;34;-3119.566,-463.8468;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1691. Node;AmplifyShaderEditor.SimpleAddOpNode;53;-2784.015,-36.08008;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  1692. Node;AmplifyShaderEditor.GetLocalVarNode;51;-2803.25,-170.4918;Inherit;False;46;AlbedoTexture;1;0;OBJECT;;False;1;SAMPLER2D;0
  1693. Node;AmplifyShaderEditor.RangedFloatNode;68;-2552.866,71.40936;Inherit;False;Property;_Duplicate;Duplicate;6;0;Create;True;0;0;0;False;0;False;0;0.1;0;1;0;1;FLOAT;0
  1694. Node;AmplifyShaderEditor.GetLocalVarNode;47;-2828.424,-556.1292;Inherit;False;46;AlbedoTexture;1;0;OBJECT;;False;1;SAMPLER2D;0
  1695. Node;AmplifyShaderEditor.SamplerNode;50;-2541.193,-168.293;Inherit;True;Property;_TextureSample0;Texture Sample 0;2;0;Create;True;0;0;0;False;0;False;-1;0ad415cb683dc65438c8fd22c34a1500;0ad415cb683dc65438c8fd22c34a1500;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1696. Node;AmplifyShaderEditor.SimpleAddOpNode;35;-2770.899,-408.8468;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  1697. Node;AmplifyShaderEditor.SamplerNode;1;-2546.521,-433.6447;Inherit;True;Property;_Albedo;Albedo;2;0;Create;True;0;0;0;False;0;False;-1;0ad415cb683dc65438c8fd22c34a1500;0ad415cb683dc65438c8fd22c34a1500;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1698. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;67;-2079.845,-160.9764;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  1699. Node;AmplifyShaderEditor.SimpleAddOpNode;56;-1810.38,-351.0695;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  1700. Node;AmplifyShaderEditor.SaturateNode;57;-1582.219,-369.7292;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  1701. Node;AmplifyShaderEditor.RegisterLocalVarNode;48;-1321.7,-371.4484;Inherit;False;AlbedoTextureSample;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  1702. Node;AmplifyShaderEditor.GetLocalVarNode;49;-2897.91,714.2134;Inherit;False;48;AlbedoTextureSample;1;0;OBJECT;;False;1;COLOR;0
  1703. Node;AmplifyShaderEditor.ColorNode;17;-2867.359,1045.198;Inherit;False;Property;_Colour;Colour;1;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,1;3.688605,3.688605,3.688605,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1704. Node;AmplifyShaderEditor.VertexColorNode;7;-2852.733,852.0948;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1705. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-2410.602,843.3228;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
  1706. Node;AmplifyShaderEditor.ComponentMaskNode;9;-2123.373,920.113;Inherit;False;False;False;False;True;1;0;COLOR;0,0,0,0;False;1;FLOAT;0
  1707. Node;AmplifyShaderEditor.RegisterLocalVarNode;30;-4532.04,894.6838;Inherit;False;ParticleErosionOverLifetime;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  1708. Node;AmplifyShaderEditor.RegisterLocalVarNode;10;-1814.059,918.3372;Inherit;False;ColourA;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  1709. Node;AmplifyShaderEditor.GetLocalVarNode;31;-3473.074,2765.492;Inherit;False;30;ParticleErosionOverLifetime;1;0;OBJECT;;False;1;FLOAT;0
  1710. Node;AmplifyShaderEditor.RangedFloatNode;13;-3464.127,2639.93;Inherit;False;Property;_AlphaErosion;Alpha Erosion;2;0;Create;True;0;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
  1711. Node;AmplifyShaderEditor.ToggleSwitchNode;33;-3033.589,2664.47;Inherit;False;Property;_ParticleMode;Particle Mode;0;0;Create;True;0;0;0;False;0;False;1;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  1712. Node;AmplifyShaderEditor.GetLocalVarNode;11;-2958.83,2508.922;Inherit;False;10;ColourA;1;0;OBJECT;;False;1;FLOAT;0
  1713. Node;AmplifyShaderEditor.SimpleSubtractOpNode;14;-2687.626,2566.406;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  1714. Node;AmplifyShaderEditor.RangedFloatNode;22;-2649.944,2398.179;Inherit;False;Property;_RemapMax;Remap Max;4;0;Create;True;0;0;0;False;0;False;0;0.6;0;1;0;1;FLOAT;0
  1715. Node;AmplifyShaderEditor.RangedFloatNode;19;-2658.175,2289.733;Inherit;False;Property;_RemapMin;Remap Min;3;0;Create;True;0;0;0;False;0;False;0;0.1;0;1;0;1;FLOAT;0
  1716. Node;AmplifyShaderEditor.SaturateNode;15;-2481.626,2566.406;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  1717. Node;AmplifyShaderEditor.CommentaryNode;87;-627.5839,335.8369;Inherit;False;803.3438;451.5571;Comment;6;93;92;91;90;89;88;ymask;1,1,1,1;0;0
  1718. Node;AmplifyShaderEditor.FunctionNode;20;-2173.595,2325.791;Inherit;False;Inverse Lerp;-1;;2;09cbe79402f023141a4dc1fddd4c9511;0;3;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;1;FLOAT;0
  1719. Node;AmplifyShaderEditor.WorldPosInputsNode;92;-577.5839,385.8369;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  1720. Node;AmplifyShaderEditor.RangedFloatNode;88;-531.1824,535.9989;Inherit;False;Property;_Ymask;Ymask;7;0;Create;True;0;0;0;False;0;False;0.21;0.5;0;0;0;1;FLOAT;0
  1721. Node;AmplifyShaderEditor.SaturateNode;21;-1934.944,2325.179;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  1722. Node;AmplifyShaderEditor.RangedFloatNode;91;-576.2746,671.9941;Inherit;False;Property;_YmaskExp;Ymask硬吗;8;0;Create;False;0;0;0;False;0;False;1;3;1;10;0;1;FLOAT;0
  1723. Node;AmplifyShaderEditor.SimpleSubtractOpNode;90;-368.6824,452.7989;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  1724. Node;AmplifyShaderEditor.RegisterLocalVarNode;23;-1736.821,2317.068;Inherit;False;Opacity;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  1725. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;89;-219.3401,476.1981;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  1726. Node;AmplifyShaderEditor.ClampOpNode;93;4.959807,473.66;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
  1727. Node;AmplifyShaderEditor.GetLocalVarNode;24;-446.1404,164.6196;Inherit;False;23;Opacity;1;0;OBJECT;;False;1;FLOAT;0
  1728. Node;AmplifyShaderEditor.GetLocalVarNode;8;-358.2879,-52.5931;Inherit;False;4;ColourRGB;1;0;OBJECT;;False;1;FLOAT3;0
  1729. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;94;121.9437,214.1526;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  1730. Node;AmplifyShaderEditor.ComponentMaskNode;2;-2125.706,785.3329;Inherit;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
  1731. Node;AmplifyShaderEditor.RangedFloatNode;66;-3866.417,94.18584;Inherit;False;Constant;_Float2;Float 2;6;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
  1732. Node;AmplifyShaderEditor.RegisterLocalVarNode;4;-1814.993,781.9593;Inherit;False;ColourRGB;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  1733. Node;AmplifyShaderEditor.GetLocalVarNode;74;-394.8003,69.01295;Inherit;False;73;Emission_TEST_ONLY;1;0;OBJECT;;False;1;COLOR;0
  1734. Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-2284.102,1569.408;Inherit;False;Emission_TEST_ONLY;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  1735. Node;AmplifyShaderEditor.ColorNode;69;-2862.788,1511.097;Inherit;False;Constant;_Emission;Emission;7;0;Create;True;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1736. Node;AmplifyShaderEditor.VertexColorNode;72;-2836.96,1698.101;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1737. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;71;-2514.049,1571.927;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  1738. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;76;89.8209,-55.05157;Float;False;True;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;LT/Lightning VFX/Lightning;2992e84f91cbeb14eab234972e07ea9d;True;Forward;0;1;Forward;8;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;True;8;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;nomrt;0;False;True;1;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;2;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=UniversalForwardOnly;False;False;0;False;0;0;Standard;22;Surface;1;638484904299245596; Blend;0;0;Two Sided;0;638497147069243289;Cast Shadows;0;638484904450751545; Use Shadow Threshold;0;0;Receive Shadows;0;638484904461828233;GPU Instancing;1;0;LOD CrossFade;0;0;Built-in Fog;0;0;DOTS Instancing;0;0;Meta Pass;0;0;Extra Pre Pass;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Vertex Position,InvertActionOnDeselection;1;0;0;10;False;True;False;True;False;True;True;True;True;True;False;;False;0
  1739. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;78;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;False;0;0;Standard;0;False;0
  1740. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;83;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthNormals;0;8;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormalsOnly;False;True;4;d3d11;glcore;gles;gles3;0;False;0;0;Standard;0;False;0
  1741. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;77;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;False;0;0;Standard;0;False;0
  1742. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;81;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;SceneSelectionPass;0;6;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;False;0;0;Standard;0;False;0
  1743. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;84;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthNormalsOnly;0;9;DepthNormalsOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormalsOnly;False;True;15;d3d9;d3d11_9x;d3d11;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;0;0;Standard;0;False;0
  1744. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;82;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ScenePickingPass;0;7;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;False;0;0;Standard;0;False;0
  1745. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;79;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;False;0;0;Standard;0;False;0
  1746. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;80;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;2;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=Universal2D;False;False;0;False;0;0;Standard;0;False;0
  1747. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;75;0,0;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;0;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;False;0;0;Standard;0;False;0
  1748. WireConnection;42;0;86;4
  1749. WireConnection;58;0;55;0
  1750. WireConnection;63;0;55;0
  1751. WireConnection;63;2;64;0
  1752. WireConnection;63;3;65;0
  1753. WireConnection;63;4;65;0
  1754. WireConnection;62;0;52;0
  1755. WireConnection;62;1;63;0
  1756. WireConnection;54;1;58;0
  1757. WireConnection;46;0;45;0
  1758. WireConnection;40;1;43;0
  1759. WireConnection;53;0;62;0
  1760. WireConnection;53;1;54;0
  1761. WireConnection;50;0;51;0
  1762. WireConnection;50;1;53;0
  1763. WireConnection;35;0;34;0
  1764. WireConnection;35;1;40;0
  1765. WireConnection;1;0;47;0
  1766. WireConnection;1;1;35;0
  1767. WireConnection;67;0;50;0
  1768. WireConnection;67;1;68;0
  1769. WireConnection;56;0;1;0
  1770. WireConnection;56;1;67;0
  1771. WireConnection;57;0;56;0
  1772. WireConnection;48;0;57;0
  1773. WireConnection;5;0;49;0
  1774. WireConnection;5;1;7;0
  1775. WireConnection;5;2;17;0
  1776. WireConnection;9;0;5;0
  1777. WireConnection;30;0;86;3
  1778. WireConnection;10;0;9;0
  1779. WireConnection;33;0;13;0
  1780. WireConnection;33;1;31;0
  1781. WireConnection;14;0;11;0
  1782. WireConnection;14;1;33;0
  1783. WireConnection;15;0;14;0
  1784. WireConnection;20;1;19;0
  1785. WireConnection;20;2;22;0
  1786. WireConnection;20;3;15;0
  1787. WireConnection;21;0;20;0
  1788. WireConnection;90;0;92;2
  1789. WireConnection;90;1;88;0
  1790. WireConnection;23;0;21;0
  1791. WireConnection;89;0;90;0
  1792. WireConnection;89;1;91;0
  1793. WireConnection;93;0;89;0
  1794. WireConnection;94;0;24;0
  1795. WireConnection;94;1;93;0
  1796. WireConnection;2;0;5;0
  1797. WireConnection;4;0;2;0
  1798. WireConnection;73;0;71;0
  1799. WireConnection;71;0;69;0
  1800. WireConnection;71;1;72;0
  1801. WireConnection;76;2;8;0
  1802. WireConnection;76;3;94;0
  1803. ASEEND*/
  1804. //CHKSM=D2F2B4F096A1E25443EDAAD2F0A3A0A3F51DAA49