flowmapSmokeDissolve.shader 85 KB

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