SkyClouds.shader 217 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241
  1. // Made with Amplify Shader Editor v1.9.6.3
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "SkyClouds"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
  8. [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
  9. _BaseColor("Base Color", Color) = (1,1,1,1)
  10. _TranslucencyColor("Translucency Color", Color) = (1,1,1,0)
  11. _EmmissiveColor("Emmissive Color", Color) = (0.5490196,0.627451,0.7294118,0)
  12. _Scale("Scale", Float) = 1
  13. _WindDirection("WindDirection", Vector) = (-1,-0.3,-0.3,0)
  14. _WindSpeed("WindSpeed", Float) = 1
  15. _Mask0("Mask0", Vector) = (1.985208,0.440832,0.2055923,1.2)
  16. _Mask1("Mask1", Vector) = (1.985208,0.440832,0.2055923,1.2)
  17. _DepthDistance("Depth Distance", Float) = 0.4
  18. _NoiseColorStrength("Noise Color Strength", Range( 0 , 1)) = 0.5565214
  19. _EmmissiveNoiseColor("Emmissive Noise Color", Range( 0 , 1)) = 0.2000003
  20. _NoiseSpeed("Noise Speed", Float) = 0.2
  21. _VorSpeed("Vor Speed", Float) = 0.05
  22. _AdditionalNoiseDir("Additional Noise Dir", Vector) = (0,0,0,0)
  23. _AdditionalVoronoiDir("AdditionalVoronoiDir", Vector) = (0.7,-0.3,-0.3,0)
  24. _VoronoiScale("Voronoi Scale", Float) = 1.4
  25. _NoiseScale("Noise Scale", Float) = 20
  26. _VoronoiStrength("Voronoi Strength", Float) = 0.9
  27. _NoiseStrength("Noise Strength", Float) = 0.03
  28. _NoiseDisplacement("Noise Displacement", Float) = 0.5
  29. _NoiseScale3D("Noise Scale 3D", Vector) = (1,0.2,0.6,0)
  30. _EmmissiveDepthFade("Emmissive Depth Fade", Range( 0 , 1)) = 0.2086951
  31. _NoiseColorMix("NoiseColorMix", Range( 0 , 1)) = 0.96
  32. _VertexColorStrength("Vertex Color Strength", Range( 0 , 1)) = 0.7030082
  33. //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5
  34. _TransStrength( "Strength", Range( 0, 50 ) ) = 1
  35. _TransNormal( "Normal Distortion", Range( 0, 1 ) ) = 0.5
  36. _TransScattering( "Scattering", Range( 1, 50 ) ) = 2
  37. _TransDirect( "Direct", Range( 0, 1 ) ) = 0.9
  38. _TransAmbient( "Ambient", Range( 0, 1 ) ) = 0.1
  39. _TransShadow( "Shadow", Range( 0, 1 ) ) = 0.5
  40. _TessPhongStrength( "Phong Tess Strength", Range( 0, 1 ) ) = 0.5
  41. //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
  42. //_TessMin( "Tess Min Distance", Float ) = 10
  43. //_TessMax( "Tess Max Distance", Float ) = 25
  44. _TessEdgeLength ( "Edge length", Range( 2, 50 ) ) = 16
  45. //_TessMaxDisp( "Tess Max Displacement", Float ) = 25
  46. [HideInInspector][ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1
  47. [HideInInspector][ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1
  48. [HideInInspector][ToggleOff] _ReceiveShadows("Receive Shadows", Float) = 1.0
  49. [HideInInspector] _QueueOffset("_QueueOffset", Float) = 0
  50. [HideInInspector] _QueueControl("_QueueControl", Float) = -1
  51. [HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
  52. [HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
  53. [HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
  54. }
  55. SubShader
  56. {
  57. LOD 0
  58. Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" "UniversalMaterialType"="Lit" }
  59. Cull Back
  60. ZWrite Off
  61. ZTest LEqual
  62. Offset 0 , 0
  63. AlphaToMask Off
  64. HLSLINCLUDE
  65. #pragma target 4.5
  66. #pragma prefer_hlslcc gles
  67. // ensure rendering platforms toggle list is visible
  68. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  69. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
  70. #ifndef ASE_TESS_FUNCS
  71. #define ASE_TESS_FUNCS
  72. float4 FixedTess( float tessValue )
  73. {
  74. return tessValue;
  75. }
  76. float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
  77. {
  78. float3 wpos = mul(o2w,vertex).xyz;
  79. float dist = distance (wpos, cameraPos);
  80. float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
  81. return f;
  82. }
  83. float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
  84. {
  85. float4 tess;
  86. tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
  87. tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
  88. tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
  89. tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
  90. return tess;
  91. }
  92. float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
  93. {
  94. float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
  95. float len = distance(wpos0, wpos1);
  96. float f = max(len * scParams.y / (edgeLen * dist), 1.0);
  97. return f;
  98. }
  99. float DistanceFromPlane (float3 pos, float4 plane)
  100. {
  101. float d = dot (float4(pos,1.0f), plane);
  102. return d;
  103. }
  104. bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
  105. {
  106. float4 planeTest;
  107. planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  108. (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  109. (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
  110. planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  111. (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  112. (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
  113. planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  114. (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  115. (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
  116. planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  117. (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  118. (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
  119. return !all (planeTest);
  120. }
  121. float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
  122. {
  123. float3 f;
  124. f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
  125. f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
  126. f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
  127. return CalcTriEdgeTessFactors (f);
  128. }
  129. float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
  130. {
  131. float3 pos0 = mul(o2w,v0).xyz;
  132. float3 pos1 = mul(o2w,v1).xyz;
  133. float3 pos2 = mul(o2w,v2).xyz;
  134. float4 tess;
  135. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  136. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  137. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  138. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  139. return tess;
  140. }
  141. float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
  142. {
  143. float3 pos0 = mul(o2w,v0).xyz;
  144. float3 pos1 = mul(o2w,v1).xyz;
  145. float3 pos2 = mul(o2w,v2).xyz;
  146. float4 tess;
  147. if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
  148. {
  149. tess = 0.0f;
  150. }
  151. else
  152. {
  153. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  154. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  155. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  156. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  157. }
  158. return tess;
  159. }
  160. #endif //ASE_TESS_FUNCS
  161. ENDHLSL
  162. Pass
  163. {
  164. Name "Forward"
  165. Tags { "LightMode"="UniversalForwardOnly" }
  166. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  167. ZWrite On
  168. ZTest LEqual
  169. Offset 0 , 0
  170. ColorMask RGBA
  171. HLSLPROGRAM
  172. #define _NORMAL_DROPOFF_TS 1
  173. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  174. #pragma multi_compile_instancing
  175. #pragma instancing_options renderinglayer
  176. #pragma multi_compile _ LOD_FADE_CROSSFADE
  177. #pragma multi_compile_fog
  178. #define ASE_FOG 1
  179. #define ASE_PHONG_TESSELLATION
  180. #define ASE_DEPTH_WRITE_ON
  181. #define _SURFACE_TYPE_TRANSPARENT 1
  182. #define ASE_TESSELLATION 1
  183. #pragma require tessellation tessHW
  184. #pragma hull HullFunction
  185. #pragma domain DomainFunction
  186. #define ASE_TRANSLUCENCY 1
  187. #define ASE_LENGTH_TESSELLATION
  188. #define _EMISSION
  189. #define _ALPHATEST_ON 1
  190. #define ASE_SRP_VERSION 140004
  191. #define REQUIRE_DEPTH_TEXTURE 1
  192. #pragma multi_compile _ DOTS_INSTANCING_ON
  193. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
  194. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  195. #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
  196. #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
  197. #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
  198. #pragma multi_compile_fragment _ _SHADOWS_SOFT
  199. #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  200. #pragma multi_compile _ _LIGHT_LAYERS
  201. #pragma multi_compile_fragment _ _LIGHT_COOKIES
  202. #pragma multi_compile _ _FORWARD_PLUS
  203. #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS
  204. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  205. #pragma multi_compile _ SHADOWS_SHADOWMASK
  206. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  207. #pragma multi_compile _ LIGHTMAP_ON
  208. #pragma multi_compile _ DYNAMICLIGHTMAP_ON
  209. #pragma multi_compile_fragment _ DEBUG_DISPLAY
  210. #pragma vertex vert
  211. #pragma fragment frag
  212. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  213. #define _SPECULAR_COLOR 1
  214. #endif
  215. #define SHADERPASS SHADERPASS_FORWARD
  216. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  217. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  218. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  219. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  220. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  221. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  222. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
  223. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  224. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  225. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  226. #if defined(LOD_FADE_CROSSFADE)
  227. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  228. #endif
  229. #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
  230. #define ENABLE_TERRAIN_PERPIXEL_NORMAL
  231. #endif
  232. #define ASE_NEEDS_VERT_POSITION
  233. #define ASE_NEEDS_VERT_NORMAL
  234. #define ASE_NEEDS_FRAG_WORLD_VIEW_DIR
  235. #define ASE_NEEDS_FRAG_WORLD_NORMAL
  236. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  237. #define ASE_SV_DEPTH SV_DepthLessEqual
  238. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  239. #else
  240. #define ASE_SV_DEPTH SV_Depth
  241. #define ASE_SV_POSITION_QUALIFIERS
  242. #endif
  243. struct VertexInput
  244. {
  245. float4 positionOS : POSITION;
  246. float3 normalOS : NORMAL;
  247. float4 tangentOS : TANGENT;
  248. float4 texcoord : TEXCOORD0;
  249. float4 texcoord1 : TEXCOORD1;
  250. float4 texcoord2 : TEXCOORD2;
  251. float4 ase_color : COLOR;
  252. UNITY_VERTEX_INPUT_INSTANCE_ID
  253. };
  254. struct VertexOutput
  255. {
  256. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  257. float4 clipPosV : TEXCOORD0;
  258. float4 lightmapUVOrVertexSH : TEXCOORD1;
  259. half4 fogFactorAndVertexLight : TEXCOORD2;
  260. float4 tSpace0 : TEXCOORD3;
  261. float4 tSpace1 : TEXCOORD4;
  262. float4 tSpace2 : TEXCOORD5;
  263. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  264. float4 shadowCoord : TEXCOORD6;
  265. #endif
  266. #if defined(DYNAMICLIGHTMAP_ON)
  267. float2 dynamicLightmapUV : TEXCOORD7;
  268. #endif
  269. float4 ase_texcoord8 : TEXCOORD8;
  270. float4 ase_texcoord9 : TEXCOORD9;
  271. float3 ase_normal : NORMAL;
  272. float4 ase_color : COLOR;
  273. UNITY_VERTEX_INPUT_INSTANCE_ID
  274. UNITY_VERTEX_OUTPUT_STEREO
  275. };
  276. CBUFFER_START(UnityPerMaterial)
  277. float4 _TranslucencyColor;
  278. float4 _EmmissiveColor;
  279. float4 _BaseColor;
  280. float4 _Mask1;
  281. float4 _Mask0;
  282. float3 _NoiseScale3D;
  283. float3 _WindDirection;
  284. float3 _AdditionalNoiseDir;
  285. float3 _AdditionalVoronoiDir;
  286. float _EmmissiveNoiseColor;
  287. float _VertexColorStrength;
  288. float _NoiseColorStrength;
  289. float _NoiseColorMix;
  290. float _DepthDistance;
  291. float _VoronoiStrength;
  292. float _EmmissiveDepthFade;
  293. float _VorSpeed;
  294. float _VoronoiScale;
  295. float _NoiseStrength;
  296. float _NoiseScale;
  297. float _WindSpeed;
  298. float _NoiseSpeed;
  299. float _NoiseDisplacement;
  300. float _Scale;
  301. #ifdef ASE_TRANSMISSION
  302. float _TransmissionShadow;
  303. #endif
  304. #ifdef ASE_TRANSLUCENCY
  305. float _TransStrength;
  306. float _TransNormal;
  307. float _TransScattering;
  308. float _TransDirect;
  309. float _TransAmbient;
  310. float _TransShadow;
  311. #endif
  312. #ifdef ASE_TESSELLATION
  313. float _TessPhongStrength;
  314. float _TessValue;
  315. float _TessMin;
  316. float _TessMax;
  317. float _TessEdgeLength;
  318. float _TessMaxDisp;
  319. #endif
  320. CBUFFER_END
  321. #ifdef SCENEPICKINGPASS
  322. float4 _SelectionID;
  323. #endif
  324. #ifdef SCENESELECTIONPASS
  325. int _ObjectId;
  326. int _PassValue;
  327. #endif
  328. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  329. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  330. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  331. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  332. float snoise( float3 v )
  333. {
  334. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  335. float3 i = floor( v + dot( v, C.yyy ) );
  336. float3 x0 = v - i + dot( i, C.xxx );
  337. float3 g = step( x0.yzx, x0.xyz );
  338. float3 l = 1.0 - g;
  339. float3 i1 = min( g.xyz, l.zxy );
  340. float3 i2 = max( g.xyz, l.zxy );
  341. float3 x1 = x0 - i1 + C.xxx;
  342. float3 x2 = x0 - i2 + C.yyy;
  343. float3 x3 = x0 - 0.5;
  344. i = mod3D289( i);
  345. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  346. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  347. float4 x_ = floor( j / 7.0 );
  348. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  349. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  350. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  351. float4 h = 1.0 - abs( x ) - abs( y );
  352. float4 b0 = float4( x.xy, y.xy );
  353. float4 b1 = float4( x.zw, y.zw );
  354. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  355. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  356. float4 sh = -step( h, 0.0 );
  357. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  358. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  359. float3 g0 = float3( a0.xy, h.x );
  360. float3 g1 = float3( a0.zw, h.y );
  361. float3 g2 = float3( a1.xy, h.z );
  362. float3 g3 = float3( a1.zw, h.w );
  363. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  364. g0 *= norm.x;
  365. g1 *= norm.y;
  366. g2 *= norm.z;
  367. g3 *= norm.w;
  368. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  369. m = m* m;
  370. m = m* m;
  371. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  372. return 42.0 * dot( m, px);
  373. }
  374. float2 voronoihash97( float2 p )
  375. {
  376. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  377. return frac( sin( p ) *43758.5453);
  378. }
  379. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  380. {
  381. float2 n = floor( v );
  382. float2 f = frac( v );
  383. float F1 = 8.0;
  384. float F2 = 8.0; float2 mg = 0;
  385. for ( int j = -1; j <= 1; j++ )
  386. {
  387. for ( int i = -1; i <= 1; i++ )
  388. {
  389. float2 g = float2( i, j );
  390. float2 o = voronoihash97( n + g );
  391. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  392. float d = 0.5 * dot( r, r );
  393. if( d<F1 ) {
  394. F2 = F1;
  395. F1 = d; mg = g; mr = r; id = o;
  396. } else if( d<F2 ) {
  397. F2 = d;
  398. }
  399. }
  400. }
  401. return F1;
  402. }
  403. float2 voronoihash96( float2 p )
  404. {
  405. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  406. return frac( sin( p ) *43758.5453);
  407. }
  408. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  409. {
  410. float2 n = floor( v );
  411. float2 f = frac( v );
  412. float F1 = 8.0;
  413. float F2 = 8.0; float2 mg = 0;
  414. for ( int j = -1; j <= 1; j++ )
  415. {
  416. for ( int i = -1; i <= 1; i++ )
  417. {
  418. float2 g = float2( i, j );
  419. float2 o = voronoihash96( n + g );
  420. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  421. float d = 0.5 * dot( r, r );
  422. if( d<F1 ) {
  423. F2 = F1;
  424. F1 = d; mg = g; mr = r; id = o;
  425. } else if( d<F2 ) {
  426. F2 = d;
  427. }
  428. }
  429. }
  430. return F1;
  431. }
  432. float2 voronoihash89( float2 p )
  433. {
  434. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  435. return frac( sin( p ) *43758.5453);
  436. }
  437. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  438. {
  439. float2 n = floor( v );
  440. float2 f = frac( v );
  441. float F1 = 8.0;
  442. float F2 = 8.0; float2 mg = 0;
  443. for ( int j = -1; j <= 1; j++ )
  444. {
  445. for ( int i = -1; i <= 1; i++ )
  446. {
  447. float2 g = float2( i, j );
  448. float2 o = voronoihash89( n + g );
  449. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  450. float d = 0.5 * dot( r, r );
  451. if( d<F1 ) {
  452. F2 = F1;
  453. F1 = d; mg = g; mr = r; id = o;
  454. } else if( d<F2 ) {
  455. F2 = d;
  456. }
  457. }
  458. }
  459. return F1;
  460. }
  461. VertexOutput VertexFunction( VertexInput v )
  462. {
  463. VertexOutput o = (VertexOutput)0;
  464. UNITY_SETUP_INSTANCE_ID(v);
  465. UNITY_TRANSFER_INSTANCE_ID(v, o);
  466. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  467. #if ( SHADER_TARGET >= 50 )
  468. float recip367 = rcp( _Scale );
  469. #else
  470. float recip367 = 1.0 / _Scale;
  471. #endif
  472. float Scale228 = recip367;
  473. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  474. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  475. float3 break332 = WindDir317;
  476. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  477. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  478. float4 WindDirWeights341 = appendResult340;
  479. float4 break344 = abs( WindDirWeights341 );
  480. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  481. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  482. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  483. float4 temp_output_71_0 = (transform70).xyzw;
  484. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  485. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  486. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  487. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  488. float time97 = 0.0;
  489. float2 voronoiSmoothId97 = 0;
  490. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  491. float2 appendResult85 = (float2(break84.z , break84.y));
  492. float2 coords97 = appendResult85 * temp_output_198_0;
  493. float2 id97 = 0;
  494. float2 uv97 = 0;
  495. float fade97 = 0.5;
  496. float voroi97 = 0;
  497. float rest97 = 0;
  498. for( int it97 = 0; it97 <3; it97++ ){
  499. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  500. rest97 += fade97;
  501. coords97 *= 2;
  502. fade97 *= 0.5;
  503. }//Voronoi97
  504. voroi97 /= rest97;
  505. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  506. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  507. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  508. float3 break104 = ( temp_output_93_0 / dotResult94 );
  509. float time96 = 217.0;
  510. float2 voronoiSmoothId96 = 0;
  511. float2 appendResult86 = (float2(break84.z , break84.x));
  512. float2 coords96 = appendResult86 * temp_output_198_0;
  513. float2 id96 = 0;
  514. float2 uv96 = 0;
  515. float fade96 = 0.5;
  516. float voroi96 = 0;
  517. float rest96 = 0;
  518. for( int it96 = 0; it96 <3; it96++ ){
  519. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  520. rest96 += fade96;
  521. coords96 *= 2;
  522. fade96 *= 0.5;
  523. }//Voronoi96
  524. voroi96 /= rest96;
  525. float time89 = 137.0;
  526. float2 voronoiSmoothId89 = 0;
  527. float2 appendResult87 = (float2(break84.x , break84.y));
  528. float2 coords89 = appendResult87 * temp_output_198_0;
  529. float2 id89 = 0;
  530. float2 uv89 = 0;
  531. float fade89 = 0.5;
  532. float voroi89 = 0;
  533. float rest89 = 0;
  534. for( int it89 = 0; it89 <3; it89++ ){
  535. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  536. rest89 += fade89;
  537. coords89 *= 2;
  538. fade89 *= 0.5;
  539. }//Voronoi89
  540. voroi89 /= rest89;
  541. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  542. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  543. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  544. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  545. float4 temp_output_2_0_g146 = _Mask0;
  546. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  547. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  548. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  549. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  550. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  551. float4 temp_output_2_0_g153 = _Mask1;
  552. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  553. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  554. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  555. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  556. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  557. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  558. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  559. o.ase_texcoord8 = screenPos38;
  560. o.ase_texcoord9 = v.positionOS;
  561. o.ase_normal = v.normalOS;
  562. o.ase_color = v.ase_color;
  563. #ifdef ASE_ABSOLUTE_VERTEX_POS
  564. float3 defaultVertexValue = v.positionOS.xyz;
  565. #else
  566. float3 defaultVertexValue = float3(0, 0, 0);
  567. #endif
  568. float3 vertexValue = VertexOffset305;
  569. #ifdef ASE_ABSOLUTE_VERTEX_POS
  570. v.positionOS.xyz = vertexValue;
  571. #else
  572. v.positionOS.xyz += vertexValue;
  573. #endif
  574. v.normalOS = v.normalOS;
  575. v.tangentOS = v.tangentOS;
  576. VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
  577. VertexNormalInputs normalInput = GetVertexNormalInputs( v.normalOS, v.tangentOS );
  578. o.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x );
  579. o.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y );
  580. o.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z );
  581. #if defined(LIGHTMAP_ON)
  582. OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy );
  583. #endif
  584. #if !defined(LIGHTMAP_ON)
  585. OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz );
  586. #endif
  587. #if defined(DYNAMICLIGHTMAP_ON)
  588. o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
  589. #endif
  590. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  591. o.lightmapUVOrVertexSH.zw = v.texcoord.xy;
  592. o.lightmapUVOrVertexSH.xy = v.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
  593. #endif
  594. half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
  595. #ifdef ASE_FOG
  596. half fogFactor = ComputeFogFactor( vertexInput.positionCS.z );
  597. #else
  598. half fogFactor = 0;
  599. #endif
  600. o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
  601. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  602. o.shadowCoord = GetShadowCoord( vertexInput );
  603. #endif
  604. o.positionCS = vertexInput.positionCS;
  605. o.clipPosV = vertexInput.positionCS;
  606. return o;
  607. }
  608. #if defined(ASE_TESSELLATION)
  609. struct VertexControl
  610. {
  611. float4 vertex : INTERNALTESSPOS;
  612. float3 normalOS : NORMAL;
  613. float4 tangentOS : TANGENT;
  614. float4 texcoord : TEXCOORD0;
  615. float4 texcoord1 : TEXCOORD1;
  616. float4 texcoord2 : TEXCOORD2;
  617. float4 ase_color : COLOR;
  618. UNITY_VERTEX_INPUT_INSTANCE_ID
  619. };
  620. struct TessellationFactors
  621. {
  622. float edge[3] : SV_TessFactor;
  623. float inside : SV_InsideTessFactor;
  624. };
  625. VertexControl vert ( VertexInput v )
  626. {
  627. VertexControl o;
  628. UNITY_SETUP_INSTANCE_ID(v);
  629. UNITY_TRANSFER_INSTANCE_ID(v, o);
  630. o.vertex = v.positionOS;
  631. o.normalOS = v.normalOS;
  632. o.tangentOS = v.tangentOS;
  633. o.texcoord = v.texcoord;
  634. o.texcoord1 = v.texcoord1;
  635. o.texcoord2 = v.texcoord2;
  636. o.ase_color = v.ase_color;
  637. return o;
  638. }
  639. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  640. {
  641. TessellationFactors o;
  642. float4 tf = 1;
  643. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  644. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  645. #if defined(ASE_FIXED_TESSELLATION)
  646. tf = FixedTess( tessValue );
  647. #elif defined(ASE_DISTANCE_TESSELLATION)
  648. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  649. #elif defined(ASE_LENGTH_TESSELLATION)
  650. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  651. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  652. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  653. #endif
  654. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  655. return o;
  656. }
  657. [domain("tri")]
  658. [partitioning("fractional_odd")]
  659. [outputtopology("triangle_cw")]
  660. [patchconstantfunc("TessellationFunction")]
  661. [outputcontrolpoints(3)]
  662. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  663. {
  664. return patch[id];
  665. }
  666. [domain("tri")]
  667. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  668. {
  669. VertexInput o = (VertexInput) 0;
  670. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  671. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  672. o.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
  673. o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
  674. o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
  675. o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
  676. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  677. #if defined(ASE_PHONG_TESSELLATION)
  678. float3 pp[3];
  679. for (int i = 0; i < 3; ++i)
  680. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  681. float phongStrength = _TessPhongStrength;
  682. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  683. #endif
  684. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  685. return VertexFunction(o);
  686. }
  687. #else
  688. VertexOutput vert ( VertexInput v )
  689. {
  690. return VertexFunction( v );
  691. }
  692. #endif
  693. half4 frag ( VertexOutput IN
  694. #ifdef ASE_DEPTH_WRITE_ON
  695. ,out float outputDepth : ASE_SV_DEPTH
  696. #endif
  697. #ifdef _WRITE_RENDERING_LAYERS
  698. , out float4 outRenderingLayers : SV_Target1
  699. #endif
  700. ) : SV_Target
  701. {
  702. UNITY_SETUP_INSTANCE_ID(IN);
  703. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
  704. #if defined(LOD_FADE_CROSSFADE)
  705. LODFadeCrossFade( IN.positionCS );
  706. #endif
  707. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  708. float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
  709. float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
  710. float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
  711. float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
  712. #else
  713. float3 WorldNormal = normalize( IN.tSpace0.xyz );
  714. float3 WorldTangent = IN.tSpace1.xyz;
  715. float3 WorldBiTangent = IN.tSpace2.xyz;
  716. #endif
  717. float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
  718. float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
  719. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  720. float4 ClipPos = IN.clipPosV;
  721. float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
  722. float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.positionCS);
  723. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  724. ShadowCoords = IN.shadowCoord;
  725. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  726. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  727. #endif
  728. WorldViewDirection = SafeNormalize( WorldViewDirection );
  729. float4 screenPos38 = IN.ase_texcoord8;
  730. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  731. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  732. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  733. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  734. float temp_output_1_0_g154 = distanceDepth38;
  735. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  736. #if ( SHADER_TARGET >= 50 )
  737. float recip367 = rcp( _Scale );
  738. #else
  739. float recip367 = 1.0 / _Scale;
  740. #endif
  741. float Scale228 = recip367;
  742. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  743. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  744. float3 break332 = WindDir317;
  745. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  746. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  747. float4 WindDirWeights341 = appendResult340;
  748. float4 break344 = abs( WindDirWeights341 );
  749. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  750. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  751. float4 transform70 = mul(GetObjectToWorldMatrix(),IN.ase_texcoord9);
  752. float4 temp_output_71_0 = (transform70).xyzw;
  753. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  754. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  755. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  756. float NoiseColor3D151 = temp_output_118_0;
  757. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  758. float time97 = 0.0;
  759. float2 voronoiSmoothId97 = 0;
  760. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  761. float2 appendResult85 = (float2(break84.z , break84.y));
  762. float2 coords97 = appendResult85 * temp_output_198_0;
  763. float2 id97 = 0;
  764. float2 uv97 = 0;
  765. float fade97 = 0.5;
  766. float voroi97 = 0;
  767. float rest97 = 0;
  768. for( int it97 = 0; it97 <3; it97++ ){
  769. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  770. rest97 += fade97;
  771. coords97 *= 2;
  772. fade97 *= 0.5;
  773. }//Voronoi97
  774. voroi97 /= rest97;
  775. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( IN.ase_normal, 0 ) ).xyz;
  776. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  777. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  778. float3 break104 = ( temp_output_93_0 / dotResult94 );
  779. float time96 = 217.0;
  780. float2 voronoiSmoothId96 = 0;
  781. float2 appendResult86 = (float2(break84.z , break84.x));
  782. float2 coords96 = appendResult86 * temp_output_198_0;
  783. float2 id96 = 0;
  784. float2 uv96 = 0;
  785. float fade96 = 0.5;
  786. float voroi96 = 0;
  787. float rest96 = 0;
  788. for( int it96 = 0; it96 <3; it96++ ){
  789. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  790. rest96 += fade96;
  791. coords96 *= 2;
  792. fade96 *= 0.5;
  793. }//Voronoi96
  794. voroi96 /= rest96;
  795. float time89 = 137.0;
  796. float2 voronoiSmoothId89 = 0;
  797. float2 appendResult87 = (float2(break84.x , break84.y));
  798. float2 coords89 = appendResult87 * temp_output_198_0;
  799. float2 id89 = 0;
  800. float2 uv89 = 0;
  801. float fade89 = 0.5;
  802. float voroi89 = 0;
  803. float rest89 = 0;
  804. for( int it89 = 0; it89 <3; it89++ ){
  805. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  806. rest89 += fade89;
  807. coords89 *= 2;
  808. fade89 *= 0.5;
  809. }//Voronoi89
  810. voroi89 /= rest89;
  811. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  812. float NoiseColorVoronoi152 = temp_output_190_0;
  813. float lerpResult157 = lerp( NoiseColor3D151 , NoiseColorVoronoi152 , _NoiseColorMix);
  814. float NoiseColorMix158 = lerpResult157;
  815. float3 temp_cast_3 = (NoiseColorMix158).xxx;
  816. float temp_output_2_0_g158 = _NoiseColorStrength;
  817. float temp_output_3_0_g158 = ( 1.0 - temp_output_2_0_g158 );
  818. float3 appendResult7_g158 = (float3(temp_output_3_0_g158 , temp_output_3_0_g158 , temp_output_3_0_g158));
  819. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  820. float4 Albedo30 = saturate( ( float4( ( DepthFade43 * ( ( temp_cast_3 * temp_output_2_0_g158 ) + appendResult7_g158 ) ) , 0.0 ) * lerpResult161 ) );
  821. float3 temp_cast_6 = (NoiseColorMix158).xxx;
  822. float temp_output_2_0_g156 = _EmmissiveNoiseColor;
  823. float temp_output_3_0_g156 = ( 1.0 - temp_output_2_0_g156 );
  824. float3 appendResult7_g156 = (float3(temp_output_3_0_g156 , temp_output_3_0_g156 , temp_output_3_0_g156));
  825. float3 temp_cast_8 = (DepthFade43).xxx;
  826. float temp_output_2_0_g157 = _EmmissiveDepthFade;
  827. float temp_output_3_0_g157 = ( 1.0 - temp_output_2_0_g157 );
  828. float3 appendResult7_g157 = (float3(temp_output_3_0_g157 , temp_output_3_0_g157 , temp_output_3_0_g157));
  829. float4 temp_output_2_0_g155 = lerpResult161;
  830. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  831. float fresnelNdotV54 = dot( WorldNormal, WorldViewDirection );
  832. float fresnelNode54 = ( 0.0 + 1.0 * pow( 1.0 - fresnelNdotV54, 5.0 ) );
  833. float3 BaseColor = Albedo30.rgb;
  834. float3 Normal = float3(0, 0, 1);
  835. float3 Emission = ( ( _EmmissiveColor * float4( ( ( temp_cast_6 * temp_output_2_0_g156 ) + appendResult7_g156 ) , 0.0 ) ) * float4( ( ( temp_cast_8 * temp_output_2_0_g157 ) + appendResult7_g157 ) , 0.0 ) ).rgb;
  836. float3 Specular = 0.5;
  837. float Metallic = 0.0;
  838. float Smoothness = 0.0;
  839. float Occlusion = 1;
  840. float Alpha = ( DepthFade43 * BaseColorAlpha162 );
  841. float AlphaClipThreshold = 0.0;
  842. float AlphaClipThresholdShadow = 0.5;
  843. float3 BakedGI = 0;
  844. float3 RefractionColor = 1;
  845. float RefractionIndex = 1;
  846. float3 Transmission = 1;
  847. float3 Translucency = ( ( ( fresnelNode54 + 0.5 ) * _TranslucencyColor ) * DepthFade43 ).rgb;
  848. #ifdef ASE_DEPTH_WRITE_ON
  849. float DepthValue = IN.positionCS.z;
  850. #endif
  851. #ifdef _CLEARCOAT
  852. float CoatMask = 0;
  853. float CoatSmoothness = 0;
  854. #endif
  855. #ifdef _ALPHATEST_ON
  856. clip(Alpha - AlphaClipThreshold);
  857. #endif
  858. InputData inputData = (InputData)0;
  859. inputData.positionWS = WorldPosition;
  860. inputData.viewDirectionWS = WorldViewDirection;
  861. #ifdef _NORMALMAP
  862. #if _NORMAL_DROPOFF_TS
  863. inputData.normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent, WorldBiTangent, WorldNormal));
  864. #elif _NORMAL_DROPOFF_OS
  865. inputData.normalWS = TransformObjectToWorldNormal(Normal);
  866. #elif _NORMAL_DROPOFF_WS
  867. inputData.normalWS = Normal;
  868. #endif
  869. inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
  870. #else
  871. inputData.normalWS = WorldNormal;
  872. #endif
  873. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  874. inputData.shadowCoord = ShadowCoords;
  875. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  876. inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
  877. #else
  878. inputData.shadowCoord = float4(0, 0, 0, 0);
  879. #endif
  880. #ifdef ASE_FOG
  881. inputData.fogCoord = IN.fogFactorAndVertexLight.x;
  882. #endif
  883. inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw;
  884. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  885. float3 SH = SampleSH(inputData.normalWS.xyz);
  886. #else
  887. float3 SH = IN.lightmapUVOrVertexSH.xyz;
  888. #endif
  889. #if defined(DYNAMICLIGHTMAP_ON)
  890. inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS);
  891. #else
  892. inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
  893. #endif
  894. #ifdef ASE_BAKEDGI
  895. inputData.bakedGI = BakedGI;
  896. #endif
  897. inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
  898. inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy);
  899. #if defined(DEBUG_DISPLAY)
  900. #if defined(DYNAMICLIGHTMAP_ON)
  901. inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy;
  902. #endif
  903. #if defined(LIGHTMAP_ON)
  904. inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy;
  905. #else
  906. inputData.vertexSH = SH;
  907. #endif
  908. #endif
  909. SurfaceData surfaceData;
  910. surfaceData.albedo = BaseColor;
  911. surfaceData.metallic = saturate(Metallic);
  912. surfaceData.specular = Specular;
  913. surfaceData.smoothness = saturate(Smoothness),
  914. surfaceData.occlusion = Occlusion,
  915. surfaceData.emission = Emission,
  916. surfaceData.alpha = saturate(Alpha);
  917. surfaceData.normalTS = Normal;
  918. surfaceData.clearCoatMask = 0;
  919. surfaceData.clearCoatSmoothness = 1;
  920. #ifdef _CLEARCOAT
  921. surfaceData.clearCoatMask = saturate(CoatMask);
  922. surfaceData.clearCoatSmoothness = saturate(CoatSmoothness);
  923. #endif
  924. #ifdef _DBUFFER
  925. ApplyDecalToSurfaceData(IN.positionCS, surfaceData, inputData);
  926. #endif
  927. #ifdef _ASE_LIGHTING_SIMPLE
  928. half4 color = UniversalFragmentBlinnPhong( inputData, surfaceData);
  929. #else
  930. half4 color = UniversalFragmentPBR( inputData, surfaceData);
  931. #endif
  932. #ifdef ASE_TRANSMISSION
  933. {
  934. float shadow = _TransmissionShadow;
  935. #define SUM_LIGHT_TRANSMISSION(Light)\
  936. float3 atten = Light.color * Light.distanceAttenuation;\
  937. atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
  938. half3 transmission = max( 0, -dot( inputData.normalWS, Light.direction ) ) * atten * Transmission;\
  939. color.rgb += BaseColor * transmission;
  940. SUM_LIGHT_TRANSMISSION( GetMainLight( inputData.shadowCoord ) );
  941. #if defined(_ADDITIONAL_LIGHTS)
  942. uint meshRenderingLayers = GetMeshRenderingLayer();
  943. uint pixelLightCount = GetAdditionalLightsCount();
  944. #if USE_FORWARD_PLUS
  945. for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
  946. {
  947. FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
  948. Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
  949. #ifdef _LIGHT_LAYERS
  950. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  951. #endif
  952. {
  953. SUM_LIGHT_TRANSMISSION( light );
  954. }
  955. }
  956. #endif
  957. LIGHT_LOOP_BEGIN( pixelLightCount )
  958. Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
  959. #ifdef _LIGHT_LAYERS
  960. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  961. #endif
  962. {
  963. SUM_LIGHT_TRANSMISSION( light );
  964. }
  965. LIGHT_LOOP_END
  966. #endif
  967. }
  968. #endif
  969. #ifdef ASE_TRANSLUCENCY
  970. {
  971. float shadow = _TransShadow;
  972. float normal = _TransNormal;
  973. float scattering = _TransScattering;
  974. float direct = _TransDirect;
  975. float ambient = _TransAmbient;
  976. float strength = _TransStrength;
  977. #define SUM_LIGHT_TRANSLUCENCY(Light)\
  978. float3 atten = Light.color * Light.distanceAttenuation;\
  979. atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
  980. half3 lightDir = Light.direction + inputData.normalWS * normal;\
  981. half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );\
  982. half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;\
  983. color.rgb += BaseColor * translucency * strength;
  984. SUM_LIGHT_TRANSLUCENCY( GetMainLight( inputData.shadowCoord ) );
  985. #if defined(_ADDITIONAL_LIGHTS)
  986. uint meshRenderingLayers = GetMeshRenderingLayer();
  987. uint pixelLightCount = GetAdditionalLightsCount();
  988. #if USE_FORWARD_PLUS
  989. for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
  990. {
  991. FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
  992. Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
  993. #ifdef _LIGHT_LAYERS
  994. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  995. #endif
  996. {
  997. SUM_LIGHT_TRANSLUCENCY( light );
  998. }
  999. }
  1000. #endif
  1001. LIGHT_LOOP_BEGIN( pixelLightCount )
  1002. Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
  1003. #ifdef _LIGHT_LAYERS
  1004. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  1005. #endif
  1006. {
  1007. SUM_LIGHT_TRANSLUCENCY( light );
  1008. }
  1009. LIGHT_LOOP_END
  1010. #endif
  1011. }
  1012. #endif
  1013. #ifdef ASE_REFRACTION
  1014. float4 projScreenPos = ScreenPos / ScreenPos.w;
  1015. float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) );
  1016. projScreenPos.xy += refractionOffset.xy;
  1017. float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor;
  1018. color.rgb = lerp( refraction, color.rgb, color.a );
  1019. color.a = 1;
  1020. #endif
  1021. #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
  1022. color.rgb *= color.a;
  1023. #endif
  1024. #ifdef ASE_FOG
  1025. #ifdef TERRAIN_SPLAT_ADDPASS
  1026. color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x );
  1027. #else
  1028. color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x);
  1029. #endif
  1030. #endif
  1031. #ifdef ASE_DEPTH_WRITE_ON
  1032. outputDepth = DepthValue;
  1033. #endif
  1034. #ifdef _WRITE_RENDERING_LAYERS
  1035. uint renderingLayers = GetMeshRenderingLayer();
  1036. outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
  1037. #endif
  1038. return color;
  1039. }
  1040. ENDHLSL
  1041. }
  1042. Pass
  1043. {
  1044. Name "DepthOnly"
  1045. Tags { "LightMode"="DepthOnly" }
  1046. ZWrite On
  1047. ColorMask R
  1048. AlphaToMask Off
  1049. HLSLPROGRAM
  1050. #define _NORMAL_DROPOFF_TS 1
  1051. #pragma multi_compile_instancing
  1052. #pragma multi_compile _ LOD_FADE_CROSSFADE
  1053. #define ASE_FOG 1
  1054. #define ASE_PHONG_TESSELLATION
  1055. #define ASE_DEPTH_WRITE_ON
  1056. #define _SURFACE_TYPE_TRANSPARENT 1
  1057. #define ASE_TESSELLATION 1
  1058. #pragma require tessellation tessHW
  1059. #pragma hull HullFunction
  1060. #pragma domain DomainFunction
  1061. #define ASE_TRANSLUCENCY 1
  1062. #define ASE_LENGTH_TESSELLATION
  1063. #define _EMISSION
  1064. #define _ALPHATEST_ON 1
  1065. #define ASE_SRP_VERSION 140004
  1066. #define REQUIRE_DEPTH_TEXTURE 1
  1067. #pragma multi_compile _ DOTS_INSTANCING_ON
  1068. #pragma vertex vert
  1069. #pragma fragment frag
  1070. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  1071. #define _SPECULAR_COLOR 1
  1072. #endif
  1073. #define SHADERPASS SHADERPASS_DEPTHONLY
  1074. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1075. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1076. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1077. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1078. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  1079. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1080. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1081. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1082. #if defined(LOD_FADE_CROSSFADE)
  1083. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  1084. #endif
  1085. #define ASE_NEEDS_VERT_POSITION
  1086. #define ASE_NEEDS_VERT_NORMAL
  1087. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  1088. #define ASE_SV_DEPTH SV_DepthLessEqual
  1089. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  1090. #else
  1091. #define ASE_SV_DEPTH SV_Depth
  1092. #define ASE_SV_POSITION_QUALIFIERS
  1093. #endif
  1094. struct VertexInput
  1095. {
  1096. float4 positionOS : POSITION;
  1097. float3 normalOS : NORMAL;
  1098. float4 ase_color : COLOR;
  1099. UNITY_VERTEX_INPUT_INSTANCE_ID
  1100. };
  1101. struct VertexOutput
  1102. {
  1103. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  1104. float4 clipPosV : TEXCOORD0;
  1105. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1106. float3 positionWS : TEXCOORD1;
  1107. #endif
  1108. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1109. float4 shadowCoord : TEXCOORD2;
  1110. #endif
  1111. float4 ase_texcoord3 : TEXCOORD3;
  1112. float4 ase_color : COLOR;
  1113. UNITY_VERTEX_INPUT_INSTANCE_ID
  1114. UNITY_VERTEX_OUTPUT_STEREO
  1115. };
  1116. CBUFFER_START(UnityPerMaterial)
  1117. float4 _TranslucencyColor;
  1118. float4 _EmmissiveColor;
  1119. float4 _BaseColor;
  1120. float4 _Mask1;
  1121. float4 _Mask0;
  1122. float3 _NoiseScale3D;
  1123. float3 _WindDirection;
  1124. float3 _AdditionalNoiseDir;
  1125. float3 _AdditionalVoronoiDir;
  1126. float _EmmissiveNoiseColor;
  1127. float _VertexColorStrength;
  1128. float _NoiseColorStrength;
  1129. float _NoiseColorMix;
  1130. float _DepthDistance;
  1131. float _VoronoiStrength;
  1132. float _EmmissiveDepthFade;
  1133. float _VorSpeed;
  1134. float _VoronoiScale;
  1135. float _NoiseStrength;
  1136. float _NoiseScale;
  1137. float _WindSpeed;
  1138. float _NoiseSpeed;
  1139. float _NoiseDisplacement;
  1140. float _Scale;
  1141. #ifdef ASE_TRANSMISSION
  1142. float _TransmissionShadow;
  1143. #endif
  1144. #ifdef ASE_TRANSLUCENCY
  1145. float _TransStrength;
  1146. float _TransNormal;
  1147. float _TransScattering;
  1148. float _TransDirect;
  1149. float _TransAmbient;
  1150. float _TransShadow;
  1151. #endif
  1152. #ifdef ASE_TESSELLATION
  1153. float _TessPhongStrength;
  1154. float _TessValue;
  1155. float _TessMin;
  1156. float _TessMax;
  1157. float _TessEdgeLength;
  1158. float _TessMaxDisp;
  1159. #endif
  1160. CBUFFER_END
  1161. #ifdef SCENEPICKINGPASS
  1162. float4 _SelectionID;
  1163. #endif
  1164. #ifdef SCENESELECTIONPASS
  1165. int _ObjectId;
  1166. int _PassValue;
  1167. #endif
  1168. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  1169. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  1170. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  1171. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  1172. float snoise( float3 v )
  1173. {
  1174. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  1175. float3 i = floor( v + dot( v, C.yyy ) );
  1176. float3 x0 = v - i + dot( i, C.xxx );
  1177. float3 g = step( x0.yzx, x0.xyz );
  1178. float3 l = 1.0 - g;
  1179. float3 i1 = min( g.xyz, l.zxy );
  1180. float3 i2 = max( g.xyz, l.zxy );
  1181. float3 x1 = x0 - i1 + C.xxx;
  1182. float3 x2 = x0 - i2 + C.yyy;
  1183. float3 x3 = x0 - 0.5;
  1184. i = mod3D289( i);
  1185. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  1186. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  1187. float4 x_ = floor( j / 7.0 );
  1188. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  1189. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  1190. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  1191. float4 h = 1.0 - abs( x ) - abs( y );
  1192. float4 b0 = float4( x.xy, y.xy );
  1193. float4 b1 = float4( x.zw, y.zw );
  1194. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  1195. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  1196. float4 sh = -step( h, 0.0 );
  1197. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  1198. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  1199. float3 g0 = float3( a0.xy, h.x );
  1200. float3 g1 = float3( a0.zw, h.y );
  1201. float3 g2 = float3( a1.xy, h.z );
  1202. float3 g3 = float3( a1.zw, h.w );
  1203. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  1204. g0 *= norm.x;
  1205. g1 *= norm.y;
  1206. g2 *= norm.z;
  1207. g3 *= norm.w;
  1208. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  1209. m = m* m;
  1210. m = m* m;
  1211. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  1212. return 42.0 * dot( m, px);
  1213. }
  1214. float2 voronoihash97( float2 p )
  1215. {
  1216. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  1217. return frac( sin( p ) *43758.5453);
  1218. }
  1219. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  1220. {
  1221. float2 n = floor( v );
  1222. float2 f = frac( v );
  1223. float F1 = 8.0;
  1224. float F2 = 8.0; float2 mg = 0;
  1225. for ( int j = -1; j <= 1; j++ )
  1226. {
  1227. for ( int i = -1; i <= 1; i++ )
  1228. {
  1229. float2 g = float2( i, j );
  1230. float2 o = voronoihash97( n + g );
  1231. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  1232. float d = 0.5 * dot( r, r );
  1233. if( d<F1 ) {
  1234. F2 = F1;
  1235. F1 = d; mg = g; mr = r; id = o;
  1236. } else if( d<F2 ) {
  1237. F2 = d;
  1238. }
  1239. }
  1240. }
  1241. return F1;
  1242. }
  1243. float2 voronoihash96( float2 p )
  1244. {
  1245. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  1246. return frac( sin( p ) *43758.5453);
  1247. }
  1248. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  1249. {
  1250. float2 n = floor( v );
  1251. float2 f = frac( v );
  1252. float F1 = 8.0;
  1253. float F2 = 8.0; float2 mg = 0;
  1254. for ( int j = -1; j <= 1; j++ )
  1255. {
  1256. for ( int i = -1; i <= 1; i++ )
  1257. {
  1258. float2 g = float2( i, j );
  1259. float2 o = voronoihash96( n + g );
  1260. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  1261. float d = 0.5 * dot( r, r );
  1262. if( d<F1 ) {
  1263. F2 = F1;
  1264. F1 = d; mg = g; mr = r; id = o;
  1265. } else if( d<F2 ) {
  1266. F2 = d;
  1267. }
  1268. }
  1269. }
  1270. return F1;
  1271. }
  1272. float2 voronoihash89( float2 p )
  1273. {
  1274. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  1275. return frac( sin( p ) *43758.5453);
  1276. }
  1277. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  1278. {
  1279. float2 n = floor( v );
  1280. float2 f = frac( v );
  1281. float F1 = 8.0;
  1282. float F2 = 8.0; float2 mg = 0;
  1283. for ( int j = -1; j <= 1; j++ )
  1284. {
  1285. for ( int i = -1; i <= 1; i++ )
  1286. {
  1287. float2 g = float2( i, j );
  1288. float2 o = voronoihash89( n + g );
  1289. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  1290. float d = 0.5 * dot( r, r );
  1291. if( d<F1 ) {
  1292. F2 = F1;
  1293. F1 = d; mg = g; mr = r; id = o;
  1294. } else if( d<F2 ) {
  1295. F2 = d;
  1296. }
  1297. }
  1298. }
  1299. return F1;
  1300. }
  1301. VertexOutput VertexFunction( VertexInput v )
  1302. {
  1303. VertexOutput o = (VertexOutput)0;
  1304. UNITY_SETUP_INSTANCE_ID(v);
  1305. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1306. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1307. #if ( SHADER_TARGET >= 50 )
  1308. float recip367 = rcp( _Scale );
  1309. #else
  1310. float recip367 = 1.0 / _Scale;
  1311. #endif
  1312. float Scale228 = recip367;
  1313. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  1314. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  1315. float3 break332 = WindDir317;
  1316. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  1317. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  1318. float4 WindDirWeights341 = appendResult340;
  1319. float4 break344 = abs( WindDirWeights341 );
  1320. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  1321. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  1322. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  1323. float4 temp_output_71_0 = (transform70).xyzw;
  1324. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  1325. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  1326. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  1327. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  1328. float time97 = 0.0;
  1329. float2 voronoiSmoothId97 = 0;
  1330. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  1331. float2 appendResult85 = (float2(break84.z , break84.y));
  1332. float2 coords97 = appendResult85 * temp_output_198_0;
  1333. float2 id97 = 0;
  1334. float2 uv97 = 0;
  1335. float fade97 = 0.5;
  1336. float voroi97 = 0;
  1337. float rest97 = 0;
  1338. for( int it97 = 0; it97 <3; it97++ ){
  1339. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  1340. rest97 += fade97;
  1341. coords97 *= 2;
  1342. fade97 *= 0.5;
  1343. }//Voronoi97
  1344. voroi97 /= rest97;
  1345. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  1346. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  1347. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  1348. float3 break104 = ( temp_output_93_0 / dotResult94 );
  1349. float time96 = 217.0;
  1350. float2 voronoiSmoothId96 = 0;
  1351. float2 appendResult86 = (float2(break84.z , break84.x));
  1352. float2 coords96 = appendResult86 * temp_output_198_0;
  1353. float2 id96 = 0;
  1354. float2 uv96 = 0;
  1355. float fade96 = 0.5;
  1356. float voroi96 = 0;
  1357. float rest96 = 0;
  1358. for( int it96 = 0; it96 <3; it96++ ){
  1359. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  1360. rest96 += fade96;
  1361. coords96 *= 2;
  1362. fade96 *= 0.5;
  1363. }//Voronoi96
  1364. voroi96 /= rest96;
  1365. float time89 = 137.0;
  1366. float2 voronoiSmoothId89 = 0;
  1367. float2 appendResult87 = (float2(break84.x , break84.y));
  1368. float2 coords89 = appendResult87 * temp_output_198_0;
  1369. float2 id89 = 0;
  1370. float2 uv89 = 0;
  1371. float fade89 = 0.5;
  1372. float voroi89 = 0;
  1373. float rest89 = 0;
  1374. for( int it89 = 0; it89 <3; it89++ ){
  1375. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  1376. rest89 += fade89;
  1377. coords89 *= 2;
  1378. fade89 *= 0.5;
  1379. }//Voronoi89
  1380. voroi89 /= rest89;
  1381. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  1382. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  1383. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  1384. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  1385. float4 temp_output_2_0_g146 = _Mask0;
  1386. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  1387. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  1388. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  1389. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  1390. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  1391. float4 temp_output_2_0_g153 = _Mask1;
  1392. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  1393. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  1394. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  1395. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  1396. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  1397. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  1398. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  1399. o.ase_texcoord3 = screenPos38;
  1400. o.ase_color = v.ase_color;
  1401. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1402. float3 defaultVertexValue = v.positionOS.xyz;
  1403. #else
  1404. float3 defaultVertexValue = float3(0, 0, 0);
  1405. #endif
  1406. float3 vertexValue = VertexOffset305;
  1407. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1408. v.positionOS.xyz = vertexValue;
  1409. #else
  1410. v.positionOS.xyz += vertexValue;
  1411. #endif
  1412. v.normalOS = v.normalOS;
  1413. VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
  1414. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1415. o.positionWS = vertexInput.positionWS;
  1416. #endif
  1417. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1418. o.shadowCoord = GetShadowCoord( vertexInput );
  1419. #endif
  1420. o.positionCS = vertexInput.positionCS;
  1421. o.clipPosV = vertexInput.positionCS;
  1422. return o;
  1423. }
  1424. #if defined(ASE_TESSELLATION)
  1425. struct VertexControl
  1426. {
  1427. float4 vertex : INTERNALTESSPOS;
  1428. float3 normalOS : NORMAL;
  1429. float4 ase_color : COLOR;
  1430. UNITY_VERTEX_INPUT_INSTANCE_ID
  1431. };
  1432. struct TessellationFactors
  1433. {
  1434. float edge[3] : SV_TessFactor;
  1435. float inside : SV_InsideTessFactor;
  1436. };
  1437. VertexControl vert ( VertexInput v )
  1438. {
  1439. VertexControl o;
  1440. UNITY_SETUP_INSTANCE_ID(v);
  1441. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1442. o.vertex = v.positionOS;
  1443. o.normalOS = v.normalOS;
  1444. o.ase_color = v.ase_color;
  1445. return o;
  1446. }
  1447. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1448. {
  1449. TessellationFactors o;
  1450. float4 tf = 1;
  1451. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1452. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1453. #if defined(ASE_FIXED_TESSELLATION)
  1454. tf = FixedTess( tessValue );
  1455. #elif defined(ASE_DISTANCE_TESSELLATION)
  1456. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1457. #elif defined(ASE_LENGTH_TESSELLATION)
  1458. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1459. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1460. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1461. #endif
  1462. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1463. return o;
  1464. }
  1465. [domain("tri")]
  1466. [partitioning("fractional_odd")]
  1467. [outputtopology("triangle_cw")]
  1468. [patchconstantfunc("TessellationFunction")]
  1469. [outputcontrolpoints(3)]
  1470. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1471. {
  1472. return patch[id];
  1473. }
  1474. [domain("tri")]
  1475. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1476. {
  1477. VertexInput o = (VertexInput) 0;
  1478. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1479. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  1480. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1481. #if defined(ASE_PHONG_TESSELLATION)
  1482. float3 pp[3];
  1483. for (int i = 0; i < 3; ++i)
  1484. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  1485. float phongStrength = _TessPhongStrength;
  1486. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  1487. #endif
  1488. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1489. return VertexFunction(o);
  1490. }
  1491. #else
  1492. VertexOutput vert ( VertexInput v )
  1493. {
  1494. return VertexFunction( v );
  1495. }
  1496. #endif
  1497. half4 frag( VertexOutput IN
  1498. #ifdef ASE_DEPTH_WRITE_ON
  1499. ,out float outputDepth : ASE_SV_DEPTH
  1500. #endif
  1501. ) : SV_TARGET
  1502. {
  1503. UNITY_SETUP_INSTANCE_ID(IN);
  1504. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  1505. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1506. float3 WorldPosition = IN.positionWS;
  1507. #endif
  1508. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  1509. float4 ClipPos = IN.clipPosV;
  1510. float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
  1511. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1512. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  1513. ShadowCoords = IN.shadowCoord;
  1514. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  1515. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  1516. #endif
  1517. #endif
  1518. float4 screenPos38 = IN.ase_texcoord3;
  1519. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  1520. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  1521. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  1522. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  1523. float temp_output_1_0_g154 = distanceDepth38;
  1524. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  1525. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  1526. float4 temp_output_2_0_g155 = lerpResult161;
  1527. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  1528. float Alpha = ( DepthFade43 * BaseColorAlpha162 );
  1529. float AlphaClipThreshold = 0.0;
  1530. #ifdef ASE_DEPTH_WRITE_ON
  1531. float DepthValue = IN.positionCS.z;
  1532. #endif
  1533. #ifdef _ALPHATEST_ON
  1534. clip(Alpha - AlphaClipThreshold);
  1535. #endif
  1536. #if defined(LOD_FADE_CROSSFADE)
  1537. LODFadeCrossFade( IN.positionCS );
  1538. #endif
  1539. #ifdef ASE_DEPTH_WRITE_ON
  1540. outputDepth = DepthValue;
  1541. #endif
  1542. return 0;
  1543. }
  1544. ENDHLSL
  1545. }
  1546. Pass
  1547. {
  1548. Name "Meta"
  1549. Tags { "LightMode"="Meta" }
  1550. Cull Off
  1551. HLSLPROGRAM
  1552. #define _NORMAL_DROPOFF_TS 1
  1553. #define ASE_FOG 1
  1554. #define ASE_PHONG_TESSELLATION
  1555. #define ASE_DEPTH_WRITE_ON
  1556. #define _SURFACE_TYPE_TRANSPARENT 1
  1557. #define ASE_TESSELLATION 1
  1558. #pragma require tessellation tessHW
  1559. #pragma hull HullFunction
  1560. #pragma domain DomainFunction
  1561. #define ASE_TRANSLUCENCY 1
  1562. #define ASE_LENGTH_TESSELLATION
  1563. #define _EMISSION
  1564. #define _ALPHATEST_ON 1
  1565. #define ASE_SRP_VERSION 140004
  1566. #define REQUIRE_DEPTH_TEXTURE 1
  1567. #pragma shader_feature EDITOR_VISUALIZATION
  1568. #pragma vertex vert
  1569. #pragma fragment frag
  1570. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  1571. #define _SPECULAR_COLOR 1
  1572. #endif
  1573. #define SHADERPASS SHADERPASS_META
  1574. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1575. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1576. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1577. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1578. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  1579. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1580. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1581. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
  1582. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1583. #define ASE_NEEDS_VERT_POSITION
  1584. #define ASE_NEEDS_VERT_NORMAL
  1585. struct VertexInput
  1586. {
  1587. float4 positionOS : POSITION;
  1588. float3 normalOS : NORMAL;
  1589. float4 texcoord0 : TEXCOORD0;
  1590. float4 texcoord1 : TEXCOORD1;
  1591. float4 texcoord2 : TEXCOORD2;
  1592. float4 ase_color : COLOR;
  1593. UNITY_VERTEX_INPUT_INSTANCE_ID
  1594. };
  1595. struct VertexOutput
  1596. {
  1597. float4 positionCS : SV_POSITION;
  1598. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1599. float3 positionWS : TEXCOORD0;
  1600. #endif
  1601. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1602. float4 shadowCoord : TEXCOORD1;
  1603. #endif
  1604. #ifdef EDITOR_VISUALIZATION
  1605. float4 VizUV : TEXCOORD2;
  1606. float4 LightCoord : TEXCOORD3;
  1607. #endif
  1608. float4 ase_texcoord4 : TEXCOORD4;
  1609. float4 ase_texcoord5 : TEXCOORD5;
  1610. float3 ase_normal : NORMAL;
  1611. float4 ase_color : COLOR;
  1612. UNITY_VERTEX_INPUT_INSTANCE_ID
  1613. UNITY_VERTEX_OUTPUT_STEREO
  1614. };
  1615. CBUFFER_START(UnityPerMaterial)
  1616. float4 _TranslucencyColor;
  1617. float4 _EmmissiveColor;
  1618. float4 _BaseColor;
  1619. float4 _Mask1;
  1620. float4 _Mask0;
  1621. float3 _NoiseScale3D;
  1622. float3 _WindDirection;
  1623. float3 _AdditionalNoiseDir;
  1624. float3 _AdditionalVoronoiDir;
  1625. float _EmmissiveNoiseColor;
  1626. float _VertexColorStrength;
  1627. float _NoiseColorStrength;
  1628. float _NoiseColorMix;
  1629. float _DepthDistance;
  1630. float _VoronoiStrength;
  1631. float _EmmissiveDepthFade;
  1632. float _VorSpeed;
  1633. float _VoronoiScale;
  1634. float _NoiseStrength;
  1635. float _NoiseScale;
  1636. float _WindSpeed;
  1637. float _NoiseSpeed;
  1638. float _NoiseDisplacement;
  1639. float _Scale;
  1640. #ifdef ASE_TRANSMISSION
  1641. float _TransmissionShadow;
  1642. #endif
  1643. #ifdef ASE_TRANSLUCENCY
  1644. float _TransStrength;
  1645. float _TransNormal;
  1646. float _TransScattering;
  1647. float _TransDirect;
  1648. float _TransAmbient;
  1649. float _TransShadow;
  1650. #endif
  1651. #ifdef ASE_TESSELLATION
  1652. float _TessPhongStrength;
  1653. float _TessValue;
  1654. float _TessMin;
  1655. float _TessMax;
  1656. float _TessEdgeLength;
  1657. float _TessMaxDisp;
  1658. #endif
  1659. CBUFFER_END
  1660. #ifdef SCENEPICKINGPASS
  1661. float4 _SelectionID;
  1662. #endif
  1663. #ifdef SCENESELECTIONPASS
  1664. int _ObjectId;
  1665. int _PassValue;
  1666. #endif
  1667. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  1668. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  1669. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  1670. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  1671. float snoise( float3 v )
  1672. {
  1673. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  1674. float3 i = floor( v + dot( v, C.yyy ) );
  1675. float3 x0 = v - i + dot( i, C.xxx );
  1676. float3 g = step( x0.yzx, x0.xyz );
  1677. float3 l = 1.0 - g;
  1678. float3 i1 = min( g.xyz, l.zxy );
  1679. float3 i2 = max( g.xyz, l.zxy );
  1680. float3 x1 = x0 - i1 + C.xxx;
  1681. float3 x2 = x0 - i2 + C.yyy;
  1682. float3 x3 = x0 - 0.5;
  1683. i = mod3D289( i);
  1684. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  1685. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  1686. float4 x_ = floor( j / 7.0 );
  1687. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  1688. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  1689. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  1690. float4 h = 1.0 - abs( x ) - abs( y );
  1691. float4 b0 = float4( x.xy, y.xy );
  1692. float4 b1 = float4( x.zw, y.zw );
  1693. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  1694. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  1695. float4 sh = -step( h, 0.0 );
  1696. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  1697. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  1698. float3 g0 = float3( a0.xy, h.x );
  1699. float3 g1 = float3( a0.zw, h.y );
  1700. float3 g2 = float3( a1.xy, h.z );
  1701. float3 g3 = float3( a1.zw, h.w );
  1702. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  1703. g0 *= norm.x;
  1704. g1 *= norm.y;
  1705. g2 *= norm.z;
  1706. g3 *= norm.w;
  1707. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  1708. m = m* m;
  1709. m = m* m;
  1710. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  1711. return 42.0 * dot( m, px);
  1712. }
  1713. float2 voronoihash97( float2 p )
  1714. {
  1715. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  1716. return frac( sin( p ) *43758.5453);
  1717. }
  1718. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  1719. {
  1720. float2 n = floor( v );
  1721. float2 f = frac( v );
  1722. float F1 = 8.0;
  1723. float F2 = 8.0; float2 mg = 0;
  1724. for ( int j = -1; j <= 1; j++ )
  1725. {
  1726. for ( int i = -1; i <= 1; i++ )
  1727. {
  1728. float2 g = float2( i, j );
  1729. float2 o = voronoihash97( n + g );
  1730. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  1731. float d = 0.5 * dot( r, r );
  1732. if( d<F1 ) {
  1733. F2 = F1;
  1734. F1 = d; mg = g; mr = r; id = o;
  1735. } else if( d<F2 ) {
  1736. F2 = d;
  1737. }
  1738. }
  1739. }
  1740. return F1;
  1741. }
  1742. float2 voronoihash96( float2 p )
  1743. {
  1744. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  1745. return frac( sin( p ) *43758.5453);
  1746. }
  1747. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  1748. {
  1749. float2 n = floor( v );
  1750. float2 f = frac( v );
  1751. float F1 = 8.0;
  1752. float F2 = 8.0; float2 mg = 0;
  1753. for ( int j = -1; j <= 1; j++ )
  1754. {
  1755. for ( int i = -1; i <= 1; i++ )
  1756. {
  1757. float2 g = float2( i, j );
  1758. float2 o = voronoihash96( n + g );
  1759. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  1760. float d = 0.5 * dot( r, r );
  1761. if( d<F1 ) {
  1762. F2 = F1;
  1763. F1 = d; mg = g; mr = r; id = o;
  1764. } else if( d<F2 ) {
  1765. F2 = d;
  1766. }
  1767. }
  1768. }
  1769. return F1;
  1770. }
  1771. float2 voronoihash89( float2 p )
  1772. {
  1773. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  1774. return frac( sin( p ) *43758.5453);
  1775. }
  1776. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  1777. {
  1778. float2 n = floor( v );
  1779. float2 f = frac( v );
  1780. float F1 = 8.0;
  1781. float F2 = 8.0; float2 mg = 0;
  1782. for ( int j = -1; j <= 1; j++ )
  1783. {
  1784. for ( int i = -1; i <= 1; i++ )
  1785. {
  1786. float2 g = float2( i, j );
  1787. float2 o = voronoihash89( n + g );
  1788. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  1789. float d = 0.5 * dot( r, r );
  1790. if( d<F1 ) {
  1791. F2 = F1;
  1792. F1 = d; mg = g; mr = r; id = o;
  1793. } else if( d<F2 ) {
  1794. F2 = d;
  1795. }
  1796. }
  1797. }
  1798. return F1;
  1799. }
  1800. VertexOutput VertexFunction( VertexInput v )
  1801. {
  1802. VertexOutput o = (VertexOutput)0;
  1803. UNITY_SETUP_INSTANCE_ID(v);
  1804. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1805. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1806. #if ( SHADER_TARGET >= 50 )
  1807. float recip367 = rcp( _Scale );
  1808. #else
  1809. float recip367 = 1.0 / _Scale;
  1810. #endif
  1811. float Scale228 = recip367;
  1812. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  1813. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  1814. float3 break332 = WindDir317;
  1815. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  1816. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  1817. float4 WindDirWeights341 = appendResult340;
  1818. float4 break344 = abs( WindDirWeights341 );
  1819. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  1820. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  1821. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  1822. float4 temp_output_71_0 = (transform70).xyzw;
  1823. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  1824. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  1825. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  1826. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  1827. float time97 = 0.0;
  1828. float2 voronoiSmoothId97 = 0;
  1829. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  1830. float2 appendResult85 = (float2(break84.z , break84.y));
  1831. float2 coords97 = appendResult85 * temp_output_198_0;
  1832. float2 id97 = 0;
  1833. float2 uv97 = 0;
  1834. float fade97 = 0.5;
  1835. float voroi97 = 0;
  1836. float rest97 = 0;
  1837. for( int it97 = 0; it97 <3; it97++ ){
  1838. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  1839. rest97 += fade97;
  1840. coords97 *= 2;
  1841. fade97 *= 0.5;
  1842. }//Voronoi97
  1843. voroi97 /= rest97;
  1844. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  1845. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  1846. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  1847. float3 break104 = ( temp_output_93_0 / dotResult94 );
  1848. float time96 = 217.0;
  1849. float2 voronoiSmoothId96 = 0;
  1850. float2 appendResult86 = (float2(break84.z , break84.x));
  1851. float2 coords96 = appendResult86 * temp_output_198_0;
  1852. float2 id96 = 0;
  1853. float2 uv96 = 0;
  1854. float fade96 = 0.5;
  1855. float voroi96 = 0;
  1856. float rest96 = 0;
  1857. for( int it96 = 0; it96 <3; it96++ ){
  1858. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  1859. rest96 += fade96;
  1860. coords96 *= 2;
  1861. fade96 *= 0.5;
  1862. }//Voronoi96
  1863. voroi96 /= rest96;
  1864. float time89 = 137.0;
  1865. float2 voronoiSmoothId89 = 0;
  1866. float2 appendResult87 = (float2(break84.x , break84.y));
  1867. float2 coords89 = appendResult87 * temp_output_198_0;
  1868. float2 id89 = 0;
  1869. float2 uv89 = 0;
  1870. float fade89 = 0.5;
  1871. float voroi89 = 0;
  1872. float rest89 = 0;
  1873. for( int it89 = 0; it89 <3; it89++ ){
  1874. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  1875. rest89 += fade89;
  1876. coords89 *= 2;
  1877. fade89 *= 0.5;
  1878. }//Voronoi89
  1879. voroi89 /= rest89;
  1880. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  1881. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  1882. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  1883. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  1884. float4 temp_output_2_0_g146 = _Mask0;
  1885. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  1886. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  1887. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  1888. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  1889. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  1890. float4 temp_output_2_0_g153 = _Mask1;
  1891. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  1892. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  1893. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  1894. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  1895. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  1896. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  1897. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  1898. o.ase_texcoord4 = screenPos38;
  1899. o.ase_texcoord5 = v.positionOS;
  1900. o.ase_normal = v.normalOS;
  1901. o.ase_color = v.ase_color;
  1902. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1903. float3 defaultVertexValue = v.positionOS.xyz;
  1904. #else
  1905. float3 defaultVertexValue = float3(0, 0, 0);
  1906. #endif
  1907. float3 vertexValue = VertexOffset305;
  1908. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1909. v.positionOS.xyz = vertexValue;
  1910. #else
  1911. v.positionOS.xyz += vertexValue;
  1912. #endif
  1913. v.normalOS = v.normalOS;
  1914. float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
  1915. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1916. o.positionWS = positionWS;
  1917. #endif
  1918. o.positionCS = MetaVertexPosition( v.positionOS, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
  1919. #ifdef EDITOR_VISUALIZATION
  1920. float2 VizUV = 0;
  1921. float4 LightCoord = 0;
  1922. UnityEditorVizData(v.positionOS.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord);
  1923. o.VizUV = float4(VizUV, 0, 0);
  1924. o.LightCoord = LightCoord;
  1925. #endif
  1926. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1927. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  1928. vertexInput.positionWS = positionWS;
  1929. vertexInput.positionCS = o.positionCS;
  1930. o.shadowCoord = GetShadowCoord( vertexInput );
  1931. #endif
  1932. return o;
  1933. }
  1934. #if defined(ASE_TESSELLATION)
  1935. struct VertexControl
  1936. {
  1937. float4 vertex : INTERNALTESSPOS;
  1938. float3 normalOS : NORMAL;
  1939. float4 texcoord0 : TEXCOORD0;
  1940. float4 texcoord1 : TEXCOORD1;
  1941. float4 texcoord2 : TEXCOORD2;
  1942. float4 ase_color : COLOR;
  1943. UNITY_VERTEX_INPUT_INSTANCE_ID
  1944. };
  1945. struct TessellationFactors
  1946. {
  1947. float edge[3] : SV_TessFactor;
  1948. float inside : SV_InsideTessFactor;
  1949. };
  1950. VertexControl vert ( VertexInput v )
  1951. {
  1952. VertexControl o;
  1953. UNITY_SETUP_INSTANCE_ID(v);
  1954. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1955. o.vertex = v.positionOS;
  1956. o.normalOS = v.normalOS;
  1957. o.texcoord0 = v.texcoord0;
  1958. o.texcoord1 = v.texcoord1;
  1959. o.texcoord2 = v.texcoord2;
  1960. o.ase_color = v.ase_color;
  1961. return o;
  1962. }
  1963. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1964. {
  1965. TessellationFactors o;
  1966. float4 tf = 1;
  1967. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1968. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1969. #if defined(ASE_FIXED_TESSELLATION)
  1970. tf = FixedTess( tessValue );
  1971. #elif defined(ASE_DISTANCE_TESSELLATION)
  1972. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1973. #elif defined(ASE_LENGTH_TESSELLATION)
  1974. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1975. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1976. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1977. #endif
  1978. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1979. return o;
  1980. }
  1981. [domain("tri")]
  1982. [partitioning("fractional_odd")]
  1983. [outputtopology("triangle_cw")]
  1984. [patchconstantfunc("TessellationFunction")]
  1985. [outputcontrolpoints(3)]
  1986. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1987. {
  1988. return patch[id];
  1989. }
  1990. [domain("tri")]
  1991. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1992. {
  1993. VertexInput o = (VertexInput) 0;
  1994. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1995. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  1996. o.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z;
  1997. o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
  1998. o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
  1999. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  2000. #if defined(ASE_PHONG_TESSELLATION)
  2001. float3 pp[3];
  2002. for (int i = 0; i < 3; ++i)
  2003. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  2004. float phongStrength = _TessPhongStrength;
  2005. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  2006. #endif
  2007. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  2008. return VertexFunction(o);
  2009. }
  2010. #else
  2011. VertexOutput vert ( VertexInput v )
  2012. {
  2013. return VertexFunction( v );
  2014. }
  2015. #endif
  2016. half4 frag(VertexOutput IN ) : SV_TARGET
  2017. {
  2018. UNITY_SETUP_INSTANCE_ID(IN);
  2019. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  2020. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  2021. float3 WorldPosition = IN.positionWS;
  2022. #endif
  2023. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  2024. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  2025. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  2026. ShadowCoords = IN.shadowCoord;
  2027. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  2028. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  2029. #endif
  2030. #endif
  2031. float4 screenPos38 = IN.ase_texcoord4;
  2032. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  2033. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  2034. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  2035. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  2036. float temp_output_1_0_g154 = distanceDepth38;
  2037. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  2038. #if ( SHADER_TARGET >= 50 )
  2039. float recip367 = rcp( _Scale );
  2040. #else
  2041. float recip367 = 1.0 / _Scale;
  2042. #endif
  2043. float Scale228 = recip367;
  2044. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  2045. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  2046. float3 break332 = WindDir317;
  2047. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  2048. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  2049. float4 WindDirWeights341 = appendResult340;
  2050. float4 break344 = abs( WindDirWeights341 );
  2051. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  2052. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  2053. float4 transform70 = mul(GetObjectToWorldMatrix(),IN.ase_texcoord5);
  2054. float4 temp_output_71_0 = (transform70).xyzw;
  2055. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  2056. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  2057. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  2058. float NoiseColor3D151 = temp_output_118_0;
  2059. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  2060. float time97 = 0.0;
  2061. float2 voronoiSmoothId97 = 0;
  2062. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  2063. float2 appendResult85 = (float2(break84.z , break84.y));
  2064. float2 coords97 = appendResult85 * temp_output_198_0;
  2065. float2 id97 = 0;
  2066. float2 uv97 = 0;
  2067. float fade97 = 0.5;
  2068. float voroi97 = 0;
  2069. float rest97 = 0;
  2070. for( int it97 = 0; it97 <3; it97++ ){
  2071. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  2072. rest97 += fade97;
  2073. coords97 *= 2;
  2074. fade97 *= 0.5;
  2075. }//Voronoi97
  2076. voroi97 /= rest97;
  2077. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( IN.ase_normal, 0 ) ).xyz;
  2078. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  2079. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  2080. float3 break104 = ( temp_output_93_0 / dotResult94 );
  2081. float time96 = 217.0;
  2082. float2 voronoiSmoothId96 = 0;
  2083. float2 appendResult86 = (float2(break84.z , break84.x));
  2084. float2 coords96 = appendResult86 * temp_output_198_0;
  2085. float2 id96 = 0;
  2086. float2 uv96 = 0;
  2087. float fade96 = 0.5;
  2088. float voroi96 = 0;
  2089. float rest96 = 0;
  2090. for( int it96 = 0; it96 <3; it96++ ){
  2091. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  2092. rest96 += fade96;
  2093. coords96 *= 2;
  2094. fade96 *= 0.5;
  2095. }//Voronoi96
  2096. voroi96 /= rest96;
  2097. float time89 = 137.0;
  2098. float2 voronoiSmoothId89 = 0;
  2099. float2 appendResult87 = (float2(break84.x , break84.y));
  2100. float2 coords89 = appendResult87 * temp_output_198_0;
  2101. float2 id89 = 0;
  2102. float2 uv89 = 0;
  2103. float fade89 = 0.5;
  2104. float voroi89 = 0;
  2105. float rest89 = 0;
  2106. for( int it89 = 0; it89 <3; it89++ ){
  2107. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  2108. rest89 += fade89;
  2109. coords89 *= 2;
  2110. fade89 *= 0.5;
  2111. }//Voronoi89
  2112. voroi89 /= rest89;
  2113. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  2114. float NoiseColorVoronoi152 = temp_output_190_0;
  2115. float lerpResult157 = lerp( NoiseColor3D151 , NoiseColorVoronoi152 , _NoiseColorMix);
  2116. float NoiseColorMix158 = lerpResult157;
  2117. float3 temp_cast_3 = (NoiseColorMix158).xxx;
  2118. float temp_output_2_0_g158 = _NoiseColorStrength;
  2119. float temp_output_3_0_g158 = ( 1.0 - temp_output_2_0_g158 );
  2120. float3 appendResult7_g158 = (float3(temp_output_3_0_g158 , temp_output_3_0_g158 , temp_output_3_0_g158));
  2121. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  2122. float4 Albedo30 = saturate( ( float4( ( DepthFade43 * ( ( temp_cast_3 * temp_output_2_0_g158 ) + appendResult7_g158 ) ) , 0.0 ) * lerpResult161 ) );
  2123. float3 temp_cast_6 = (NoiseColorMix158).xxx;
  2124. float temp_output_2_0_g156 = _EmmissiveNoiseColor;
  2125. float temp_output_3_0_g156 = ( 1.0 - temp_output_2_0_g156 );
  2126. float3 appendResult7_g156 = (float3(temp_output_3_0_g156 , temp_output_3_0_g156 , temp_output_3_0_g156));
  2127. float3 temp_cast_8 = (DepthFade43).xxx;
  2128. float temp_output_2_0_g157 = _EmmissiveDepthFade;
  2129. float temp_output_3_0_g157 = ( 1.0 - temp_output_2_0_g157 );
  2130. float3 appendResult7_g157 = (float3(temp_output_3_0_g157 , temp_output_3_0_g157 , temp_output_3_0_g157));
  2131. float4 temp_output_2_0_g155 = lerpResult161;
  2132. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  2133. float3 BaseColor = Albedo30.rgb;
  2134. float3 Emission = ( ( _EmmissiveColor * float4( ( ( temp_cast_6 * temp_output_2_0_g156 ) + appendResult7_g156 ) , 0.0 ) ) * float4( ( ( temp_cast_8 * temp_output_2_0_g157 ) + appendResult7_g157 ) , 0.0 ) ).rgb;
  2135. float Alpha = ( DepthFade43 * BaseColorAlpha162 );
  2136. float AlphaClipThreshold = 0.0;
  2137. #ifdef _ALPHATEST_ON
  2138. clip(Alpha - AlphaClipThreshold);
  2139. #endif
  2140. MetaInput metaInput = (MetaInput)0;
  2141. metaInput.Albedo = BaseColor;
  2142. metaInput.Emission = Emission;
  2143. #ifdef EDITOR_VISUALIZATION
  2144. metaInput.VizUV = IN.VizUV.xy;
  2145. metaInput.LightCoord = IN.LightCoord;
  2146. #endif
  2147. return UnityMetaFragment(metaInput);
  2148. }
  2149. ENDHLSL
  2150. }
  2151. Pass
  2152. {
  2153. Name "Universal2D"
  2154. Tags { "LightMode"="Universal2D" }
  2155. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  2156. ZWrite On
  2157. ZTest LEqual
  2158. Offset 0 , 0
  2159. ColorMask RGBA
  2160. HLSLPROGRAM
  2161. #define _NORMAL_DROPOFF_TS 1
  2162. #define ASE_FOG 1
  2163. #define ASE_PHONG_TESSELLATION
  2164. #define ASE_DEPTH_WRITE_ON
  2165. #define _SURFACE_TYPE_TRANSPARENT 1
  2166. #define ASE_TESSELLATION 1
  2167. #pragma require tessellation tessHW
  2168. #pragma hull HullFunction
  2169. #pragma domain DomainFunction
  2170. #define ASE_TRANSLUCENCY 1
  2171. #define ASE_LENGTH_TESSELLATION
  2172. #define _EMISSION
  2173. #define _ALPHATEST_ON 1
  2174. #define ASE_SRP_VERSION 140004
  2175. #define REQUIRE_DEPTH_TEXTURE 1
  2176. #pragma vertex vert
  2177. #pragma fragment frag
  2178. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  2179. #define _SPECULAR_COLOR 1
  2180. #endif
  2181. #define SHADERPASS SHADERPASS_2D
  2182. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  2183. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  2184. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  2185. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  2186. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  2187. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  2188. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  2189. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  2190. #define ASE_NEEDS_VERT_POSITION
  2191. #define ASE_NEEDS_VERT_NORMAL
  2192. struct VertexInput
  2193. {
  2194. float4 positionOS : POSITION;
  2195. float3 normalOS : NORMAL;
  2196. float4 ase_color : COLOR;
  2197. UNITY_VERTEX_INPUT_INSTANCE_ID
  2198. };
  2199. struct VertexOutput
  2200. {
  2201. float4 positionCS : SV_POSITION;
  2202. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  2203. float3 positionWS : TEXCOORD0;
  2204. #endif
  2205. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  2206. float4 shadowCoord : TEXCOORD1;
  2207. #endif
  2208. float4 ase_texcoord2 : TEXCOORD2;
  2209. float4 ase_texcoord3 : TEXCOORD3;
  2210. float3 ase_normal : NORMAL;
  2211. float4 ase_color : COLOR;
  2212. UNITY_VERTEX_INPUT_INSTANCE_ID
  2213. UNITY_VERTEX_OUTPUT_STEREO
  2214. };
  2215. CBUFFER_START(UnityPerMaterial)
  2216. float4 _TranslucencyColor;
  2217. float4 _EmmissiveColor;
  2218. float4 _BaseColor;
  2219. float4 _Mask1;
  2220. float4 _Mask0;
  2221. float3 _NoiseScale3D;
  2222. float3 _WindDirection;
  2223. float3 _AdditionalNoiseDir;
  2224. float3 _AdditionalVoronoiDir;
  2225. float _EmmissiveNoiseColor;
  2226. float _VertexColorStrength;
  2227. float _NoiseColorStrength;
  2228. float _NoiseColorMix;
  2229. float _DepthDistance;
  2230. float _VoronoiStrength;
  2231. float _EmmissiveDepthFade;
  2232. float _VorSpeed;
  2233. float _VoronoiScale;
  2234. float _NoiseStrength;
  2235. float _NoiseScale;
  2236. float _WindSpeed;
  2237. float _NoiseSpeed;
  2238. float _NoiseDisplacement;
  2239. float _Scale;
  2240. #ifdef ASE_TRANSMISSION
  2241. float _TransmissionShadow;
  2242. #endif
  2243. #ifdef ASE_TRANSLUCENCY
  2244. float _TransStrength;
  2245. float _TransNormal;
  2246. float _TransScattering;
  2247. float _TransDirect;
  2248. float _TransAmbient;
  2249. float _TransShadow;
  2250. #endif
  2251. #ifdef ASE_TESSELLATION
  2252. float _TessPhongStrength;
  2253. float _TessValue;
  2254. float _TessMin;
  2255. float _TessMax;
  2256. float _TessEdgeLength;
  2257. float _TessMaxDisp;
  2258. #endif
  2259. CBUFFER_END
  2260. #ifdef SCENEPICKINGPASS
  2261. float4 _SelectionID;
  2262. #endif
  2263. #ifdef SCENESELECTIONPASS
  2264. int _ObjectId;
  2265. int _PassValue;
  2266. #endif
  2267. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  2268. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  2269. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  2270. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  2271. float snoise( float3 v )
  2272. {
  2273. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  2274. float3 i = floor( v + dot( v, C.yyy ) );
  2275. float3 x0 = v - i + dot( i, C.xxx );
  2276. float3 g = step( x0.yzx, x0.xyz );
  2277. float3 l = 1.0 - g;
  2278. float3 i1 = min( g.xyz, l.zxy );
  2279. float3 i2 = max( g.xyz, l.zxy );
  2280. float3 x1 = x0 - i1 + C.xxx;
  2281. float3 x2 = x0 - i2 + C.yyy;
  2282. float3 x3 = x0 - 0.5;
  2283. i = mod3D289( i);
  2284. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  2285. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  2286. float4 x_ = floor( j / 7.0 );
  2287. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  2288. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  2289. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  2290. float4 h = 1.0 - abs( x ) - abs( y );
  2291. float4 b0 = float4( x.xy, y.xy );
  2292. float4 b1 = float4( x.zw, y.zw );
  2293. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  2294. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  2295. float4 sh = -step( h, 0.0 );
  2296. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  2297. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  2298. float3 g0 = float3( a0.xy, h.x );
  2299. float3 g1 = float3( a0.zw, h.y );
  2300. float3 g2 = float3( a1.xy, h.z );
  2301. float3 g3 = float3( a1.zw, h.w );
  2302. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  2303. g0 *= norm.x;
  2304. g1 *= norm.y;
  2305. g2 *= norm.z;
  2306. g3 *= norm.w;
  2307. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  2308. m = m* m;
  2309. m = m* m;
  2310. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  2311. return 42.0 * dot( m, px);
  2312. }
  2313. float2 voronoihash97( float2 p )
  2314. {
  2315. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  2316. return frac( sin( p ) *43758.5453);
  2317. }
  2318. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  2319. {
  2320. float2 n = floor( v );
  2321. float2 f = frac( v );
  2322. float F1 = 8.0;
  2323. float F2 = 8.0; float2 mg = 0;
  2324. for ( int j = -1; j <= 1; j++ )
  2325. {
  2326. for ( int i = -1; i <= 1; i++ )
  2327. {
  2328. float2 g = float2( i, j );
  2329. float2 o = voronoihash97( n + g );
  2330. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  2331. float d = 0.5 * dot( r, r );
  2332. if( d<F1 ) {
  2333. F2 = F1;
  2334. F1 = d; mg = g; mr = r; id = o;
  2335. } else if( d<F2 ) {
  2336. F2 = d;
  2337. }
  2338. }
  2339. }
  2340. return F1;
  2341. }
  2342. float2 voronoihash96( float2 p )
  2343. {
  2344. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  2345. return frac( sin( p ) *43758.5453);
  2346. }
  2347. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  2348. {
  2349. float2 n = floor( v );
  2350. float2 f = frac( v );
  2351. float F1 = 8.0;
  2352. float F2 = 8.0; float2 mg = 0;
  2353. for ( int j = -1; j <= 1; j++ )
  2354. {
  2355. for ( int i = -1; i <= 1; i++ )
  2356. {
  2357. float2 g = float2( i, j );
  2358. float2 o = voronoihash96( n + g );
  2359. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  2360. float d = 0.5 * dot( r, r );
  2361. if( d<F1 ) {
  2362. F2 = F1;
  2363. F1 = d; mg = g; mr = r; id = o;
  2364. } else if( d<F2 ) {
  2365. F2 = d;
  2366. }
  2367. }
  2368. }
  2369. return F1;
  2370. }
  2371. float2 voronoihash89( float2 p )
  2372. {
  2373. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  2374. return frac( sin( p ) *43758.5453);
  2375. }
  2376. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  2377. {
  2378. float2 n = floor( v );
  2379. float2 f = frac( v );
  2380. float F1 = 8.0;
  2381. float F2 = 8.0; float2 mg = 0;
  2382. for ( int j = -1; j <= 1; j++ )
  2383. {
  2384. for ( int i = -1; i <= 1; i++ )
  2385. {
  2386. float2 g = float2( i, j );
  2387. float2 o = voronoihash89( n + g );
  2388. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  2389. float d = 0.5 * dot( r, r );
  2390. if( d<F1 ) {
  2391. F2 = F1;
  2392. F1 = d; mg = g; mr = r; id = o;
  2393. } else if( d<F2 ) {
  2394. F2 = d;
  2395. }
  2396. }
  2397. }
  2398. return F1;
  2399. }
  2400. VertexOutput VertexFunction( VertexInput v )
  2401. {
  2402. VertexOutput o = (VertexOutput)0;
  2403. UNITY_SETUP_INSTANCE_ID( v );
  2404. UNITY_TRANSFER_INSTANCE_ID( v, o );
  2405. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
  2406. #if ( SHADER_TARGET >= 50 )
  2407. float recip367 = rcp( _Scale );
  2408. #else
  2409. float recip367 = 1.0 / _Scale;
  2410. #endif
  2411. float Scale228 = recip367;
  2412. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  2413. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  2414. float3 break332 = WindDir317;
  2415. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  2416. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  2417. float4 WindDirWeights341 = appendResult340;
  2418. float4 break344 = abs( WindDirWeights341 );
  2419. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  2420. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  2421. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  2422. float4 temp_output_71_0 = (transform70).xyzw;
  2423. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  2424. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  2425. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  2426. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  2427. float time97 = 0.0;
  2428. float2 voronoiSmoothId97 = 0;
  2429. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  2430. float2 appendResult85 = (float2(break84.z , break84.y));
  2431. float2 coords97 = appendResult85 * temp_output_198_0;
  2432. float2 id97 = 0;
  2433. float2 uv97 = 0;
  2434. float fade97 = 0.5;
  2435. float voroi97 = 0;
  2436. float rest97 = 0;
  2437. for( int it97 = 0; it97 <3; it97++ ){
  2438. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  2439. rest97 += fade97;
  2440. coords97 *= 2;
  2441. fade97 *= 0.5;
  2442. }//Voronoi97
  2443. voroi97 /= rest97;
  2444. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  2445. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  2446. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  2447. float3 break104 = ( temp_output_93_0 / dotResult94 );
  2448. float time96 = 217.0;
  2449. float2 voronoiSmoothId96 = 0;
  2450. float2 appendResult86 = (float2(break84.z , break84.x));
  2451. float2 coords96 = appendResult86 * temp_output_198_0;
  2452. float2 id96 = 0;
  2453. float2 uv96 = 0;
  2454. float fade96 = 0.5;
  2455. float voroi96 = 0;
  2456. float rest96 = 0;
  2457. for( int it96 = 0; it96 <3; it96++ ){
  2458. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  2459. rest96 += fade96;
  2460. coords96 *= 2;
  2461. fade96 *= 0.5;
  2462. }//Voronoi96
  2463. voroi96 /= rest96;
  2464. float time89 = 137.0;
  2465. float2 voronoiSmoothId89 = 0;
  2466. float2 appendResult87 = (float2(break84.x , break84.y));
  2467. float2 coords89 = appendResult87 * temp_output_198_0;
  2468. float2 id89 = 0;
  2469. float2 uv89 = 0;
  2470. float fade89 = 0.5;
  2471. float voroi89 = 0;
  2472. float rest89 = 0;
  2473. for( int it89 = 0; it89 <3; it89++ ){
  2474. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  2475. rest89 += fade89;
  2476. coords89 *= 2;
  2477. fade89 *= 0.5;
  2478. }//Voronoi89
  2479. voroi89 /= rest89;
  2480. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  2481. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  2482. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  2483. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  2484. float4 temp_output_2_0_g146 = _Mask0;
  2485. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  2486. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  2487. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  2488. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  2489. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  2490. float4 temp_output_2_0_g153 = _Mask1;
  2491. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  2492. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  2493. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  2494. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  2495. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  2496. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  2497. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  2498. o.ase_texcoord2 = screenPos38;
  2499. o.ase_texcoord3 = v.positionOS;
  2500. o.ase_normal = v.normalOS;
  2501. o.ase_color = v.ase_color;
  2502. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2503. float3 defaultVertexValue = v.positionOS.xyz;
  2504. #else
  2505. float3 defaultVertexValue = float3(0, 0, 0);
  2506. #endif
  2507. float3 vertexValue = VertexOffset305;
  2508. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2509. v.positionOS.xyz = vertexValue;
  2510. #else
  2511. v.positionOS.xyz += vertexValue;
  2512. #endif
  2513. v.normalOS = v.normalOS;
  2514. VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
  2515. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  2516. o.positionWS = vertexInput.positionWS;
  2517. #endif
  2518. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  2519. o.shadowCoord = GetShadowCoord( vertexInput );
  2520. #endif
  2521. o.positionCS = vertexInput.positionCS;
  2522. return o;
  2523. }
  2524. #if defined(ASE_TESSELLATION)
  2525. struct VertexControl
  2526. {
  2527. float4 vertex : INTERNALTESSPOS;
  2528. float3 normalOS : NORMAL;
  2529. float4 ase_color : COLOR;
  2530. UNITY_VERTEX_INPUT_INSTANCE_ID
  2531. };
  2532. struct TessellationFactors
  2533. {
  2534. float edge[3] : SV_TessFactor;
  2535. float inside : SV_InsideTessFactor;
  2536. };
  2537. VertexControl vert ( VertexInput v )
  2538. {
  2539. VertexControl o;
  2540. UNITY_SETUP_INSTANCE_ID(v);
  2541. UNITY_TRANSFER_INSTANCE_ID(v, o);
  2542. o.vertex = v.positionOS;
  2543. o.normalOS = v.normalOS;
  2544. o.ase_color = v.ase_color;
  2545. return o;
  2546. }
  2547. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  2548. {
  2549. TessellationFactors o;
  2550. float4 tf = 1;
  2551. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  2552. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  2553. #if defined(ASE_FIXED_TESSELLATION)
  2554. tf = FixedTess( tessValue );
  2555. #elif defined(ASE_DISTANCE_TESSELLATION)
  2556. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  2557. #elif defined(ASE_LENGTH_TESSELLATION)
  2558. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  2559. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  2560. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  2561. #endif
  2562. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  2563. return o;
  2564. }
  2565. [domain("tri")]
  2566. [partitioning("fractional_odd")]
  2567. [outputtopology("triangle_cw")]
  2568. [patchconstantfunc("TessellationFunction")]
  2569. [outputcontrolpoints(3)]
  2570. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  2571. {
  2572. return patch[id];
  2573. }
  2574. [domain("tri")]
  2575. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  2576. {
  2577. VertexInput o = (VertexInput) 0;
  2578. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  2579. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  2580. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  2581. #if defined(ASE_PHONG_TESSELLATION)
  2582. float3 pp[3];
  2583. for (int i = 0; i < 3; ++i)
  2584. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  2585. float phongStrength = _TessPhongStrength;
  2586. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  2587. #endif
  2588. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  2589. return VertexFunction(o);
  2590. }
  2591. #else
  2592. VertexOutput vert ( VertexInput v )
  2593. {
  2594. return VertexFunction( v );
  2595. }
  2596. #endif
  2597. half4 frag(VertexOutput IN ) : SV_TARGET
  2598. {
  2599. UNITY_SETUP_INSTANCE_ID( IN );
  2600. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  2601. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  2602. float3 WorldPosition = IN.positionWS;
  2603. #endif
  2604. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  2605. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  2606. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  2607. ShadowCoords = IN.shadowCoord;
  2608. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  2609. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  2610. #endif
  2611. #endif
  2612. float4 screenPos38 = IN.ase_texcoord2;
  2613. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  2614. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  2615. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  2616. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  2617. float temp_output_1_0_g154 = distanceDepth38;
  2618. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  2619. #if ( SHADER_TARGET >= 50 )
  2620. float recip367 = rcp( _Scale );
  2621. #else
  2622. float recip367 = 1.0 / _Scale;
  2623. #endif
  2624. float Scale228 = recip367;
  2625. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  2626. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  2627. float3 break332 = WindDir317;
  2628. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  2629. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  2630. float4 WindDirWeights341 = appendResult340;
  2631. float4 break344 = abs( WindDirWeights341 );
  2632. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  2633. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  2634. float4 transform70 = mul(GetObjectToWorldMatrix(),IN.ase_texcoord3);
  2635. float4 temp_output_71_0 = (transform70).xyzw;
  2636. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  2637. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  2638. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  2639. float NoiseColor3D151 = temp_output_118_0;
  2640. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  2641. float time97 = 0.0;
  2642. float2 voronoiSmoothId97 = 0;
  2643. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  2644. float2 appendResult85 = (float2(break84.z , break84.y));
  2645. float2 coords97 = appendResult85 * temp_output_198_0;
  2646. float2 id97 = 0;
  2647. float2 uv97 = 0;
  2648. float fade97 = 0.5;
  2649. float voroi97 = 0;
  2650. float rest97 = 0;
  2651. for( int it97 = 0; it97 <3; it97++ ){
  2652. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  2653. rest97 += fade97;
  2654. coords97 *= 2;
  2655. fade97 *= 0.5;
  2656. }//Voronoi97
  2657. voroi97 /= rest97;
  2658. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( IN.ase_normal, 0 ) ).xyz;
  2659. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  2660. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  2661. float3 break104 = ( temp_output_93_0 / dotResult94 );
  2662. float time96 = 217.0;
  2663. float2 voronoiSmoothId96 = 0;
  2664. float2 appendResult86 = (float2(break84.z , break84.x));
  2665. float2 coords96 = appendResult86 * temp_output_198_0;
  2666. float2 id96 = 0;
  2667. float2 uv96 = 0;
  2668. float fade96 = 0.5;
  2669. float voroi96 = 0;
  2670. float rest96 = 0;
  2671. for( int it96 = 0; it96 <3; it96++ ){
  2672. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  2673. rest96 += fade96;
  2674. coords96 *= 2;
  2675. fade96 *= 0.5;
  2676. }//Voronoi96
  2677. voroi96 /= rest96;
  2678. float time89 = 137.0;
  2679. float2 voronoiSmoothId89 = 0;
  2680. float2 appendResult87 = (float2(break84.x , break84.y));
  2681. float2 coords89 = appendResult87 * temp_output_198_0;
  2682. float2 id89 = 0;
  2683. float2 uv89 = 0;
  2684. float fade89 = 0.5;
  2685. float voroi89 = 0;
  2686. float rest89 = 0;
  2687. for( int it89 = 0; it89 <3; it89++ ){
  2688. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  2689. rest89 += fade89;
  2690. coords89 *= 2;
  2691. fade89 *= 0.5;
  2692. }//Voronoi89
  2693. voroi89 /= rest89;
  2694. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  2695. float NoiseColorVoronoi152 = temp_output_190_0;
  2696. float lerpResult157 = lerp( NoiseColor3D151 , NoiseColorVoronoi152 , _NoiseColorMix);
  2697. float NoiseColorMix158 = lerpResult157;
  2698. float3 temp_cast_3 = (NoiseColorMix158).xxx;
  2699. float temp_output_2_0_g158 = _NoiseColorStrength;
  2700. float temp_output_3_0_g158 = ( 1.0 - temp_output_2_0_g158 );
  2701. float3 appendResult7_g158 = (float3(temp_output_3_0_g158 , temp_output_3_0_g158 , temp_output_3_0_g158));
  2702. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  2703. float4 Albedo30 = saturate( ( float4( ( DepthFade43 * ( ( temp_cast_3 * temp_output_2_0_g158 ) + appendResult7_g158 ) ) , 0.0 ) * lerpResult161 ) );
  2704. float4 temp_output_2_0_g155 = lerpResult161;
  2705. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  2706. float3 BaseColor = Albedo30.rgb;
  2707. float Alpha = ( DepthFade43 * BaseColorAlpha162 );
  2708. float AlphaClipThreshold = 0.0;
  2709. half4 color = half4(BaseColor, Alpha );
  2710. #ifdef _ALPHATEST_ON
  2711. clip(Alpha - AlphaClipThreshold);
  2712. #endif
  2713. return color;
  2714. }
  2715. ENDHLSL
  2716. }
  2717. Pass
  2718. {
  2719. Name "DepthNormals"
  2720. Tags { "LightMode"="DepthNormalsOnly" }
  2721. ZWrite On
  2722. Blend One Zero
  2723. ZTest LEqual
  2724. ZWrite On
  2725. HLSLPROGRAM
  2726. #define _NORMAL_DROPOFF_TS 1
  2727. #pragma multi_compile_instancing
  2728. #pragma multi_compile _ LOD_FADE_CROSSFADE
  2729. #define ASE_FOG 1
  2730. #define ASE_PHONG_TESSELLATION
  2731. #define ASE_DEPTH_WRITE_ON
  2732. #define _SURFACE_TYPE_TRANSPARENT 1
  2733. #define ASE_TESSELLATION 1
  2734. #pragma require tessellation tessHW
  2735. #pragma hull HullFunction
  2736. #pragma domain DomainFunction
  2737. #define ASE_TRANSLUCENCY 1
  2738. #define ASE_LENGTH_TESSELLATION
  2739. #define _EMISSION
  2740. #define _ALPHATEST_ON 1
  2741. #define ASE_SRP_VERSION 140004
  2742. #define REQUIRE_DEPTH_TEXTURE 1
  2743. #pragma multi_compile _ DOTS_INSTANCING_ON
  2744. #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS
  2745. #pragma vertex vert
  2746. #pragma fragment frag
  2747. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  2748. #define _SPECULAR_COLOR 1
  2749. #endif
  2750. #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
  2751. //#define SHADERPASS SHADERPASS_DEPTHNORMALS
  2752. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  2753. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  2754. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  2755. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  2756. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  2757. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  2758. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  2759. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  2760. #if defined(LOD_FADE_CROSSFADE)
  2761. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  2762. #endif
  2763. #define ASE_NEEDS_VERT_POSITION
  2764. #define ASE_NEEDS_VERT_NORMAL
  2765. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  2766. #define ASE_SV_DEPTH SV_DepthLessEqual
  2767. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  2768. #else
  2769. #define ASE_SV_DEPTH SV_Depth
  2770. #define ASE_SV_POSITION_QUALIFIERS
  2771. #endif
  2772. struct VertexInput
  2773. {
  2774. float4 positionOS : POSITION;
  2775. float3 normalOS : NORMAL;
  2776. float4 tangentOS : TANGENT;
  2777. float4 ase_color : COLOR;
  2778. UNITY_VERTEX_INPUT_INSTANCE_ID
  2779. };
  2780. struct VertexOutput
  2781. {
  2782. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  2783. float4 clipPosV : TEXCOORD0;
  2784. float3 worldNormal : TEXCOORD1;
  2785. float4 worldTangent : TEXCOORD2;
  2786. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  2787. float3 positionWS : TEXCOORD3;
  2788. #endif
  2789. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  2790. float4 shadowCoord : TEXCOORD4;
  2791. #endif
  2792. float4 ase_texcoord5 : TEXCOORD5;
  2793. float4 ase_color : COLOR;
  2794. UNITY_VERTEX_INPUT_INSTANCE_ID
  2795. UNITY_VERTEX_OUTPUT_STEREO
  2796. };
  2797. CBUFFER_START(UnityPerMaterial)
  2798. float4 _TranslucencyColor;
  2799. float4 _EmmissiveColor;
  2800. float4 _BaseColor;
  2801. float4 _Mask1;
  2802. float4 _Mask0;
  2803. float3 _NoiseScale3D;
  2804. float3 _WindDirection;
  2805. float3 _AdditionalNoiseDir;
  2806. float3 _AdditionalVoronoiDir;
  2807. float _EmmissiveNoiseColor;
  2808. float _VertexColorStrength;
  2809. float _NoiseColorStrength;
  2810. float _NoiseColorMix;
  2811. float _DepthDistance;
  2812. float _VoronoiStrength;
  2813. float _EmmissiveDepthFade;
  2814. float _VorSpeed;
  2815. float _VoronoiScale;
  2816. float _NoiseStrength;
  2817. float _NoiseScale;
  2818. float _WindSpeed;
  2819. float _NoiseSpeed;
  2820. float _NoiseDisplacement;
  2821. float _Scale;
  2822. #ifdef ASE_TRANSMISSION
  2823. float _TransmissionShadow;
  2824. #endif
  2825. #ifdef ASE_TRANSLUCENCY
  2826. float _TransStrength;
  2827. float _TransNormal;
  2828. float _TransScattering;
  2829. float _TransDirect;
  2830. float _TransAmbient;
  2831. float _TransShadow;
  2832. #endif
  2833. #ifdef ASE_TESSELLATION
  2834. float _TessPhongStrength;
  2835. float _TessValue;
  2836. float _TessMin;
  2837. float _TessMax;
  2838. float _TessEdgeLength;
  2839. float _TessMaxDisp;
  2840. #endif
  2841. CBUFFER_END
  2842. #ifdef SCENEPICKINGPASS
  2843. float4 _SelectionID;
  2844. #endif
  2845. #ifdef SCENESELECTIONPASS
  2846. int _ObjectId;
  2847. int _PassValue;
  2848. #endif
  2849. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  2850. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  2851. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  2852. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  2853. float snoise( float3 v )
  2854. {
  2855. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  2856. float3 i = floor( v + dot( v, C.yyy ) );
  2857. float3 x0 = v - i + dot( i, C.xxx );
  2858. float3 g = step( x0.yzx, x0.xyz );
  2859. float3 l = 1.0 - g;
  2860. float3 i1 = min( g.xyz, l.zxy );
  2861. float3 i2 = max( g.xyz, l.zxy );
  2862. float3 x1 = x0 - i1 + C.xxx;
  2863. float3 x2 = x0 - i2 + C.yyy;
  2864. float3 x3 = x0 - 0.5;
  2865. i = mod3D289( i);
  2866. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  2867. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  2868. float4 x_ = floor( j / 7.0 );
  2869. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  2870. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  2871. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  2872. float4 h = 1.0 - abs( x ) - abs( y );
  2873. float4 b0 = float4( x.xy, y.xy );
  2874. float4 b1 = float4( x.zw, y.zw );
  2875. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  2876. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  2877. float4 sh = -step( h, 0.0 );
  2878. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  2879. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  2880. float3 g0 = float3( a0.xy, h.x );
  2881. float3 g1 = float3( a0.zw, h.y );
  2882. float3 g2 = float3( a1.xy, h.z );
  2883. float3 g3 = float3( a1.zw, h.w );
  2884. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  2885. g0 *= norm.x;
  2886. g1 *= norm.y;
  2887. g2 *= norm.z;
  2888. g3 *= norm.w;
  2889. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  2890. m = m* m;
  2891. m = m* m;
  2892. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  2893. return 42.0 * dot( m, px);
  2894. }
  2895. float2 voronoihash97( float2 p )
  2896. {
  2897. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  2898. return frac( sin( p ) *43758.5453);
  2899. }
  2900. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  2901. {
  2902. float2 n = floor( v );
  2903. float2 f = frac( v );
  2904. float F1 = 8.0;
  2905. float F2 = 8.0; float2 mg = 0;
  2906. for ( int j = -1; j <= 1; j++ )
  2907. {
  2908. for ( int i = -1; i <= 1; i++ )
  2909. {
  2910. float2 g = float2( i, j );
  2911. float2 o = voronoihash97( n + g );
  2912. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  2913. float d = 0.5 * dot( r, r );
  2914. if( d<F1 ) {
  2915. F2 = F1;
  2916. F1 = d; mg = g; mr = r; id = o;
  2917. } else if( d<F2 ) {
  2918. F2 = d;
  2919. }
  2920. }
  2921. }
  2922. return F1;
  2923. }
  2924. float2 voronoihash96( float2 p )
  2925. {
  2926. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  2927. return frac( sin( p ) *43758.5453);
  2928. }
  2929. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  2930. {
  2931. float2 n = floor( v );
  2932. float2 f = frac( v );
  2933. float F1 = 8.0;
  2934. float F2 = 8.0; float2 mg = 0;
  2935. for ( int j = -1; j <= 1; j++ )
  2936. {
  2937. for ( int i = -1; i <= 1; i++ )
  2938. {
  2939. float2 g = float2( i, j );
  2940. float2 o = voronoihash96( n + g );
  2941. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  2942. float d = 0.5 * dot( r, r );
  2943. if( d<F1 ) {
  2944. F2 = F1;
  2945. F1 = d; mg = g; mr = r; id = o;
  2946. } else if( d<F2 ) {
  2947. F2 = d;
  2948. }
  2949. }
  2950. }
  2951. return F1;
  2952. }
  2953. float2 voronoihash89( float2 p )
  2954. {
  2955. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  2956. return frac( sin( p ) *43758.5453);
  2957. }
  2958. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  2959. {
  2960. float2 n = floor( v );
  2961. float2 f = frac( v );
  2962. float F1 = 8.0;
  2963. float F2 = 8.0; float2 mg = 0;
  2964. for ( int j = -1; j <= 1; j++ )
  2965. {
  2966. for ( int i = -1; i <= 1; i++ )
  2967. {
  2968. float2 g = float2( i, j );
  2969. float2 o = voronoihash89( n + g );
  2970. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  2971. float d = 0.5 * dot( r, r );
  2972. if( d<F1 ) {
  2973. F2 = F1;
  2974. F1 = d; mg = g; mr = r; id = o;
  2975. } else if( d<F2 ) {
  2976. F2 = d;
  2977. }
  2978. }
  2979. }
  2980. return F1;
  2981. }
  2982. VertexOutput VertexFunction( VertexInput v )
  2983. {
  2984. VertexOutput o = (VertexOutput)0;
  2985. UNITY_SETUP_INSTANCE_ID(v);
  2986. UNITY_TRANSFER_INSTANCE_ID(v, o);
  2987. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  2988. #if ( SHADER_TARGET >= 50 )
  2989. float recip367 = rcp( _Scale );
  2990. #else
  2991. float recip367 = 1.0 / _Scale;
  2992. #endif
  2993. float Scale228 = recip367;
  2994. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  2995. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  2996. float3 break332 = WindDir317;
  2997. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  2998. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  2999. float4 WindDirWeights341 = appendResult340;
  3000. float4 break344 = abs( WindDirWeights341 );
  3001. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  3002. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  3003. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  3004. float4 temp_output_71_0 = (transform70).xyzw;
  3005. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  3006. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  3007. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  3008. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  3009. float time97 = 0.0;
  3010. float2 voronoiSmoothId97 = 0;
  3011. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  3012. float2 appendResult85 = (float2(break84.z , break84.y));
  3013. float2 coords97 = appendResult85 * temp_output_198_0;
  3014. float2 id97 = 0;
  3015. float2 uv97 = 0;
  3016. float fade97 = 0.5;
  3017. float voroi97 = 0;
  3018. float rest97 = 0;
  3019. for( int it97 = 0; it97 <3; it97++ ){
  3020. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  3021. rest97 += fade97;
  3022. coords97 *= 2;
  3023. fade97 *= 0.5;
  3024. }//Voronoi97
  3025. voroi97 /= rest97;
  3026. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  3027. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  3028. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  3029. float3 break104 = ( temp_output_93_0 / dotResult94 );
  3030. float time96 = 217.0;
  3031. float2 voronoiSmoothId96 = 0;
  3032. float2 appendResult86 = (float2(break84.z , break84.x));
  3033. float2 coords96 = appendResult86 * temp_output_198_0;
  3034. float2 id96 = 0;
  3035. float2 uv96 = 0;
  3036. float fade96 = 0.5;
  3037. float voroi96 = 0;
  3038. float rest96 = 0;
  3039. for( int it96 = 0; it96 <3; it96++ ){
  3040. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  3041. rest96 += fade96;
  3042. coords96 *= 2;
  3043. fade96 *= 0.5;
  3044. }//Voronoi96
  3045. voroi96 /= rest96;
  3046. float time89 = 137.0;
  3047. float2 voronoiSmoothId89 = 0;
  3048. float2 appendResult87 = (float2(break84.x , break84.y));
  3049. float2 coords89 = appendResult87 * temp_output_198_0;
  3050. float2 id89 = 0;
  3051. float2 uv89 = 0;
  3052. float fade89 = 0.5;
  3053. float voroi89 = 0;
  3054. float rest89 = 0;
  3055. for( int it89 = 0; it89 <3; it89++ ){
  3056. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  3057. rest89 += fade89;
  3058. coords89 *= 2;
  3059. fade89 *= 0.5;
  3060. }//Voronoi89
  3061. voroi89 /= rest89;
  3062. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  3063. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  3064. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  3065. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  3066. float4 temp_output_2_0_g146 = _Mask0;
  3067. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  3068. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  3069. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  3070. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  3071. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  3072. float4 temp_output_2_0_g153 = _Mask1;
  3073. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  3074. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  3075. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  3076. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  3077. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  3078. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  3079. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  3080. o.ase_texcoord5 = screenPos38;
  3081. o.ase_color = v.ase_color;
  3082. #ifdef ASE_ABSOLUTE_VERTEX_POS
  3083. float3 defaultVertexValue = v.positionOS.xyz;
  3084. #else
  3085. float3 defaultVertexValue = float3(0, 0, 0);
  3086. #endif
  3087. float3 vertexValue = VertexOffset305;
  3088. #ifdef ASE_ABSOLUTE_VERTEX_POS
  3089. v.positionOS.xyz = vertexValue;
  3090. #else
  3091. v.positionOS.xyz += vertexValue;
  3092. #endif
  3093. v.normalOS = v.normalOS;
  3094. v.tangentOS = v.tangentOS;
  3095. VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
  3096. float3 normalWS = TransformObjectToWorldNormal( v.normalOS );
  3097. float4 tangentWS = float4( TransformObjectToWorldDir( v.tangentOS.xyz ), v.tangentOS.w );
  3098. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  3099. o.positionWS = vertexInput.positionWS;
  3100. #endif
  3101. o.worldNormal = normalWS;
  3102. o.worldTangent = tangentWS;
  3103. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  3104. o.shadowCoord = GetShadowCoord( vertexInput );
  3105. #endif
  3106. o.positionCS = vertexInput.positionCS;
  3107. o.clipPosV = vertexInput.positionCS;
  3108. return o;
  3109. }
  3110. #if defined(ASE_TESSELLATION)
  3111. struct VertexControl
  3112. {
  3113. float4 vertex : INTERNALTESSPOS;
  3114. float3 normalOS : NORMAL;
  3115. float4 tangentOS : TANGENT;
  3116. float4 ase_color : COLOR;
  3117. UNITY_VERTEX_INPUT_INSTANCE_ID
  3118. };
  3119. struct TessellationFactors
  3120. {
  3121. float edge[3] : SV_TessFactor;
  3122. float inside : SV_InsideTessFactor;
  3123. };
  3124. VertexControl vert ( VertexInput v )
  3125. {
  3126. VertexControl o;
  3127. UNITY_SETUP_INSTANCE_ID(v);
  3128. UNITY_TRANSFER_INSTANCE_ID(v, o);
  3129. o.vertex = v.positionOS;
  3130. o.normalOS = v.normalOS;
  3131. o.tangentOS = v.tangentOS;
  3132. o.ase_color = v.ase_color;
  3133. return o;
  3134. }
  3135. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  3136. {
  3137. TessellationFactors o;
  3138. float4 tf = 1;
  3139. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  3140. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  3141. #if defined(ASE_FIXED_TESSELLATION)
  3142. tf = FixedTess( tessValue );
  3143. #elif defined(ASE_DISTANCE_TESSELLATION)
  3144. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  3145. #elif defined(ASE_LENGTH_TESSELLATION)
  3146. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  3147. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  3148. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  3149. #endif
  3150. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  3151. return o;
  3152. }
  3153. [domain("tri")]
  3154. [partitioning("fractional_odd")]
  3155. [outputtopology("triangle_cw")]
  3156. [patchconstantfunc("TessellationFunction")]
  3157. [outputcontrolpoints(3)]
  3158. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  3159. {
  3160. return patch[id];
  3161. }
  3162. [domain("tri")]
  3163. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  3164. {
  3165. VertexInput o = (VertexInput) 0;
  3166. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  3167. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  3168. o.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
  3169. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  3170. #if defined(ASE_PHONG_TESSELLATION)
  3171. float3 pp[3];
  3172. for (int i = 0; i < 3; ++i)
  3173. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  3174. float phongStrength = _TessPhongStrength;
  3175. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  3176. #endif
  3177. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  3178. return VertexFunction(o);
  3179. }
  3180. #else
  3181. VertexOutput vert ( VertexInput v )
  3182. {
  3183. return VertexFunction( v );
  3184. }
  3185. #endif
  3186. void frag( VertexOutput IN
  3187. , out half4 outNormalWS : SV_Target0
  3188. #ifdef ASE_DEPTH_WRITE_ON
  3189. ,out float outputDepth : ASE_SV_DEPTH
  3190. #endif
  3191. #ifdef _WRITE_RENDERING_LAYERS
  3192. , out float4 outRenderingLayers : SV_Target1
  3193. #endif
  3194. )
  3195. {
  3196. UNITY_SETUP_INSTANCE_ID(IN);
  3197. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  3198. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  3199. float3 WorldPosition = IN.positionWS;
  3200. #endif
  3201. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  3202. float3 WorldNormal = IN.worldNormal;
  3203. float4 WorldTangent = IN.worldTangent;
  3204. float4 ClipPos = IN.clipPosV;
  3205. float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
  3206. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  3207. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  3208. ShadowCoords = IN.shadowCoord;
  3209. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  3210. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  3211. #endif
  3212. #endif
  3213. float4 screenPos38 = IN.ase_texcoord5;
  3214. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  3215. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  3216. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  3217. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  3218. float temp_output_1_0_g154 = distanceDepth38;
  3219. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  3220. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  3221. float4 temp_output_2_0_g155 = lerpResult161;
  3222. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  3223. float3 Normal = float3(0, 0, 1);
  3224. float Alpha = ( DepthFade43 * BaseColorAlpha162 );
  3225. float AlphaClipThreshold = 0.0;
  3226. #ifdef ASE_DEPTH_WRITE_ON
  3227. float DepthValue = IN.positionCS.z;
  3228. #endif
  3229. #ifdef _ALPHATEST_ON
  3230. clip(Alpha - AlphaClipThreshold);
  3231. #endif
  3232. #if defined(LOD_FADE_CROSSFADE)
  3233. LODFadeCrossFade( IN.positionCS );
  3234. #endif
  3235. #ifdef ASE_DEPTH_WRITE_ON
  3236. outputDepth = DepthValue;
  3237. #endif
  3238. #if defined(_GBUFFER_NORMALS_OCT)
  3239. float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal);
  3240. float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5);
  3241. half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS);
  3242. outNormalWS = half4(packedNormalWS, 0.0);
  3243. #else
  3244. #if defined(_NORMALMAP)
  3245. #if _NORMAL_DROPOFF_TS
  3246. float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
  3247. float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz);
  3248. float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz));
  3249. #elif _NORMAL_DROPOFF_OS
  3250. float3 normalWS = TransformObjectToWorldNormal(Normal);
  3251. #elif _NORMAL_DROPOFF_WS
  3252. float3 normalWS = Normal;
  3253. #endif
  3254. #else
  3255. float3 normalWS = WorldNormal;
  3256. #endif
  3257. outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0);
  3258. #endif
  3259. #ifdef _WRITE_RENDERING_LAYERS
  3260. uint renderingLayers = GetMeshRenderingLayer();
  3261. outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
  3262. #endif
  3263. }
  3264. ENDHLSL
  3265. }
  3266. Pass
  3267. {
  3268. Name "SceneSelectionPass"
  3269. Tags { "LightMode"="SceneSelectionPass" }
  3270. Cull Off
  3271. AlphaToMask Off
  3272. HLSLPROGRAM
  3273. #define _NORMAL_DROPOFF_TS 1
  3274. #define ASE_FOG 1
  3275. #define ASE_PHONG_TESSELLATION
  3276. #define ASE_DEPTH_WRITE_ON
  3277. #define _SURFACE_TYPE_TRANSPARENT 1
  3278. #define ASE_TESSELLATION 1
  3279. #pragma require tessellation tessHW
  3280. #pragma hull HullFunction
  3281. #pragma domain DomainFunction
  3282. #define ASE_TRANSLUCENCY 1
  3283. #define ASE_LENGTH_TESSELLATION
  3284. #define _EMISSION
  3285. #define _ALPHATEST_ON 1
  3286. #define ASE_SRP_VERSION 140004
  3287. #define REQUIRE_DEPTH_TEXTURE 1
  3288. #pragma multi_compile _ DOTS_INSTANCING_ON
  3289. #pragma vertex vert
  3290. #pragma fragment frag
  3291. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  3292. #define _SPECULAR_COLOR 1
  3293. #endif
  3294. #define SCENESELECTIONPASS 1
  3295. #define ATTRIBUTES_NEED_NORMAL
  3296. #define ATTRIBUTES_NEED_TANGENT
  3297. #define SHADERPASS SHADERPASS_DEPTHONLY
  3298. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  3299. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  3300. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  3301. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  3302. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  3303. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  3304. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  3305. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  3306. #define ASE_NEEDS_VERT_POSITION
  3307. #define ASE_NEEDS_VERT_NORMAL
  3308. struct VertexInput
  3309. {
  3310. float4 positionOS : POSITION;
  3311. float3 normalOS : NORMAL;
  3312. float4 ase_color : COLOR;
  3313. UNITY_VERTEX_INPUT_INSTANCE_ID
  3314. };
  3315. struct VertexOutput
  3316. {
  3317. float4 positionCS : SV_POSITION;
  3318. float4 ase_texcoord : TEXCOORD0;
  3319. float4 ase_color : COLOR;
  3320. UNITY_VERTEX_INPUT_INSTANCE_ID
  3321. UNITY_VERTEX_OUTPUT_STEREO
  3322. };
  3323. CBUFFER_START(UnityPerMaterial)
  3324. float4 _TranslucencyColor;
  3325. float4 _EmmissiveColor;
  3326. float4 _BaseColor;
  3327. float4 _Mask1;
  3328. float4 _Mask0;
  3329. float3 _NoiseScale3D;
  3330. float3 _WindDirection;
  3331. float3 _AdditionalNoiseDir;
  3332. float3 _AdditionalVoronoiDir;
  3333. float _EmmissiveNoiseColor;
  3334. float _VertexColorStrength;
  3335. float _NoiseColorStrength;
  3336. float _NoiseColorMix;
  3337. float _DepthDistance;
  3338. float _VoronoiStrength;
  3339. float _EmmissiveDepthFade;
  3340. float _VorSpeed;
  3341. float _VoronoiScale;
  3342. float _NoiseStrength;
  3343. float _NoiseScale;
  3344. float _WindSpeed;
  3345. float _NoiseSpeed;
  3346. float _NoiseDisplacement;
  3347. float _Scale;
  3348. #ifdef ASE_TRANSMISSION
  3349. float _TransmissionShadow;
  3350. #endif
  3351. #ifdef ASE_TRANSLUCENCY
  3352. float _TransStrength;
  3353. float _TransNormal;
  3354. float _TransScattering;
  3355. float _TransDirect;
  3356. float _TransAmbient;
  3357. float _TransShadow;
  3358. #endif
  3359. #ifdef ASE_TESSELLATION
  3360. float _TessPhongStrength;
  3361. float _TessValue;
  3362. float _TessMin;
  3363. float _TessMax;
  3364. float _TessEdgeLength;
  3365. float _TessMaxDisp;
  3366. #endif
  3367. CBUFFER_END
  3368. #ifdef SCENEPICKINGPASS
  3369. float4 _SelectionID;
  3370. #endif
  3371. #ifdef SCENESELECTIONPASS
  3372. int _ObjectId;
  3373. int _PassValue;
  3374. #endif
  3375. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  3376. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  3377. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  3378. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  3379. float snoise( float3 v )
  3380. {
  3381. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  3382. float3 i = floor( v + dot( v, C.yyy ) );
  3383. float3 x0 = v - i + dot( i, C.xxx );
  3384. float3 g = step( x0.yzx, x0.xyz );
  3385. float3 l = 1.0 - g;
  3386. float3 i1 = min( g.xyz, l.zxy );
  3387. float3 i2 = max( g.xyz, l.zxy );
  3388. float3 x1 = x0 - i1 + C.xxx;
  3389. float3 x2 = x0 - i2 + C.yyy;
  3390. float3 x3 = x0 - 0.5;
  3391. i = mod3D289( i);
  3392. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  3393. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  3394. float4 x_ = floor( j / 7.0 );
  3395. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  3396. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  3397. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  3398. float4 h = 1.0 - abs( x ) - abs( y );
  3399. float4 b0 = float4( x.xy, y.xy );
  3400. float4 b1 = float4( x.zw, y.zw );
  3401. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  3402. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  3403. float4 sh = -step( h, 0.0 );
  3404. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  3405. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  3406. float3 g0 = float3( a0.xy, h.x );
  3407. float3 g1 = float3( a0.zw, h.y );
  3408. float3 g2 = float3( a1.xy, h.z );
  3409. float3 g3 = float3( a1.zw, h.w );
  3410. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  3411. g0 *= norm.x;
  3412. g1 *= norm.y;
  3413. g2 *= norm.z;
  3414. g3 *= norm.w;
  3415. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  3416. m = m* m;
  3417. m = m* m;
  3418. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  3419. return 42.0 * dot( m, px);
  3420. }
  3421. float2 voronoihash97( float2 p )
  3422. {
  3423. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  3424. return frac( sin( p ) *43758.5453);
  3425. }
  3426. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  3427. {
  3428. float2 n = floor( v );
  3429. float2 f = frac( v );
  3430. float F1 = 8.0;
  3431. float F2 = 8.0; float2 mg = 0;
  3432. for ( int j = -1; j <= 1; j++ )
  3433. {
  3434. for ( int i = -1; i <= 1; i++ )
  3435. {
  3436. float2 g = float2( i, j );
  3437. float2 o = voronoihash97( n + g );
  3438. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  3439. float d = 0.5 * dot( r, r );
  3440. if( d<F1 ) {
  3441. F2 = F1;
  3442. F1 = d; mg = g; mr = r; id = o;
  3443. } else if( d<F2 ) {
  3444. F2 = d;
  3445. }
  3446. }
  3447. }
  3448. return F1;
  3449. }
  3450. float2 voronoihash96( float2 p )
  3451. {
  3452. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  3453. return frac( sin( p ) *43758.5453);
  3454. }
  3455. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  3456. {
  3457. float2 n = floor( v );
  3458. float2 f = frac( v );
  3459. float F1 = 8.0;
  3460. float F2 = 8.0; float2 mg = 0;
  3461. for ( int j = -1; j <= 1; j++ )
  3462. {
  3463. for ( int i = -1; i <= 1; i++ )
  3464. {
  3465. float2 g = float2( i, j );
  3466. float2 o = voronoihash96( n + g );
  3467. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  3468. float d = 0.5 * dot( r, r );
  3469. if( d<F1 ) {
  3470. F2 = F1;
  3471. F1 = d; mg = g; mr = r; id = o;
  3472. } else if( d<F2 ) {
  3473. F2 = d;
  3474. }
  3475. }
  3476. }
  3477. return F1;
  3478. }
  3479. float2 voronoihash89( float2 p )
  3480. {
  3481. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  3482. return frac( sin( p ) *43758.5453);
  3483. }
  3484. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  3485. {
  3486. float2 n = floor( v );
  3487. float2 f = frac( v );
  3488. float F1 = 8.0;
  3489. float F2 = 8.0; float2 mg = 0;
  3490. for ( int j = -1; j <= 1; j++ )
  3491. {
  3492. for ( int i = -1; i <= 1; i++ )
  3493. {
  3494. float2 g = float2( i, j );
  3495. float2 o = voronoihash89( n + g );
  3496. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  3497. float d = 0.5 * dot( r, r );
  3498. if( d<F1 ) {
  3499. F2 = F1;
  3500. F1 = d; mg = g; mr = r; id = o;
  3501. } else if( d<F2 ) {
  3502. F2 = d;
  3503. }
  3504. }
  3505. }
  3506. return F1;
  3507. }
  3508. struct SurfaceDescription
  3509. {
  3510. float Alpha;
  3511. float AlphaClipThreshold;
  3512. };
  3513. VertexOutput VertexFunction(VertexInput v )
  3514. {
  3515. VertexOutput o;
  3516. ZERO_INITIALIZE(VertexOutput, o);
  3517. UNITY_SETUP_INSTANCE_ID(v);
  3518. UNITY_TRANSFER_INSTANCE_ID(v, o);
  3519. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  3520. #if ( SHADER_TARGET >= 50 )
  3521. float recip367 = rcp( _Scale );
  3522. #else
  3523. float recip367 = 1.0 / _Scale;
  3524. #endif
  3525. float Scale228 = recip367;
  3526. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  3527. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  3528. float3 break332 = WindDir317;
  3529. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  3530. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  3531. float4 WindDirWeights341 = appendResult340;
  3532. float4 break344 = abs( WindDirWeights341 );
  3533. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  3534. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  3535. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  3536. float4 temp_output_71_0 = (transform70).xyzw;
  3537. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  3538. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  3539. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  3540. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  3541. float time97 = 0.0;
  3542. float2 voronoiSmoothId97 = 0;
  3543. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  3544. float2 appendResult85 = (float2(break84.z , break84.y));
  3545. float2 coords97 = appendResult85 * temp_output_198_0;
  3546. float2 id97 = 0;
  3547. float2 uv97 = 0;
  3548. float fade97 = 0.5;
  3549. float voroi97 = 0;
  3550. float rest97 = 0;
  3551. for( int it97 = 0; it97 <3; it97++ ){
  3552. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  3553. rest97 += fade97;
  3554. coords97 *= 2;
  3555. fade97 *= 0.5;
  3556. }//Voronoi97
  3557. voroi97 /= rest97;
  3558. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  3559. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  3560. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  3561. float3 break104 = ( temp_output_93_0 / dotResult94 );
  3562. float time96 = 217.0;
  3563. float2 voronoiSmoothId96 = 0;
  3564. float2 appendResult86 = (float2(break84.z , break84.x));
  3565. float2 coords96 = appendResult86 * temp_output_198_0;
  3566. float2 id96 = 0;
  3567. float2 uv96 = 0;
  3568. float fade96 = 0.5;
  3569. float voroi96 = 0;
  3570. float rest96 = 0;
  3571. for( int it96 = 0; it96 <3; it96++ ){
  3572. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  3573. rest96 += fade96;
  3574. coords96 *= 2;
  3575. fade96 *= 0.5;
  3576. }//Voronoi96
  3577. voroi96 /= rest96;
  3578. float time89 = 137.0;
  3579. float2 voronoiSmoothId89 = 0;
  3580. float2 appendResult87 = (float2(break84.x , break84.y));
  3581. float2 coords89 = appendResult87 * temp_output_198_0;
  3582. float2 id89 = 0;
  3583. float2 uv89 = 0;
  3584. float fade89 = 0.5;
  3585. float voroi89 = 0;
  3586. float rest89 = 0;
  3587. for( int it89 = 0; it89 <3; it89++ ){
  3588. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  3589. rest89 += fade89;
  3590. coords89 *= 2;
  3591. fade89 *= 0.5;
  3592. }//Voronoi89
  3593. voroi89 /= rest89;
  3594. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  3595. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  3596. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  3597. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  3598. float4 temp_output_2_0_g146 = _Mask0;
  3599. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  3600. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  3601. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  3602. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  3603. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  3604. float4 temp_output_2_0_g153 = _Mask1;
  3605. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  3606. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  3607. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  3608. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  3609. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  3610. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  3611. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  3612. o.ase_texcoord = screenPos38;
  3613. o.ase_color = v.ase_color;
  3614. #ifdef ASE_ABSOLUTE_VERTEX_POS
  3615. float3 defaultVertexValue = v.positionOS.xyz;
  3616. #else
  3617. float3 defaultVertexValue = float3(0, 0, 0);
  3618. #endif
  3619. float3 vertexValue = VertexOffset305;
  3620. #ifdef ASE_ABSOLUTE_VERTEX_POS
  3621. v.positionOS.xyz = vertexValue;
  3622. #else
  3623. v.positionOS.xyz += vertexValue;
  3624. #endif
  3625. v.normalOS = v.normalOS;
  3626. float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
  3627. o.positionCS = TransformWorldToHClip(positionWS);
  3628. return o;
  3629. }
  3630. #if defined(ASE_TESSELLATION)
  3631. struct VertexControl
  3632. {
  3633. float4 vertex : INTERNALTESSPOS;
  3634. float3 normalOS : NORMAL;
  3635. float4 ase_color : COLOR;
  3636. UNITY_VERTEX_INPUT_INSTANCE_ID
  3637. };
  3638. struct TessellationFactors
  3639. {
  3640. float edge[3] : SV_TessFactor;
  3641. float inside : SV_InsideTessFactor;
  3642. };
  3643. VertexControl vert ( VertexInput v )
  3644. {
  3645. VertexControl o;
  3646. UNITY_SETUP_INSTANCE_ID(v);
  3647. UNITY_TRANSFER_INSTANCE_ID(v, o);
  3648. o.vertex = v.positionOS;
  3649. o.normalOS = v.normalOS;
  3650. o.ase_color = v.ase_color;
  3651. return o;
  3652. }
  3653. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  3654. {
  3655. TessellationFactors o;
  3656. float4 tf = 1;
  3657. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  3658. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  3659. #if defined(ASE_FIXED_TESSELLATION)
  3660. tf = FixedTess( tessValue );
  3661. #elif defined(ASE_DISTANCE_TESSELLATION)
  3662. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  3663. #elif defined(ASE_LENGTH_TESSELLATION)
  3664. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  3665. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  3666. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  3667. #endif
  3668. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  3669. return o;
  3670. }
  3671. [domain("tri")]
  3672. [partitioning("fractional_odd")]
  3673. [outputtopology("triangle_cw")]
  3674. [patchconstantfunc("TessellationFunction")]
  3675. [outputcontrolpoints(3)]
  3676. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  3677. {
  3678. return patch[id];
  3679. }
  3680. [domain("tri")]
  3681. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  3682. {
  3683. VertexInput o = (VertexInput) 0;
  3684. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  3685. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  3686. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  3687. #if defined(ASE_PHONG_TESSELLATION)
  3688. float3 pp[3];
  3689. for (int i = 0; i < 3; ++i)
  3690. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  3691. float phongStrength = _TessPhongStrength;
  3692. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  3693. #endif
  3694. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  3695. return VertexFunction(o);
  3696. }
  3697. #else
  3698. VertexOutput vert ( VertexInput v )
  3699. {
  3700. return VertexFunction( v );
  3701. }
  3702. #endif
  3703. half4 frag(VertexOutput IN ) : SV_TARGET
  3704. {
  3705. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  3706. float4 screenPos38 = IN.ase_texcoord;
  3707. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  3708. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  3709. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  3710. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  3711. float temp_output_1_0_g154 = distanceDepth38;
  3712. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  3713. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  3714. float4 temp_output_2_0_g155 = lerpResult161;
  3715. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  3716. surfaceDescription.Alpha = ( DepthFade43 * BaseColorAlpha162 );
  3717. surfaceDescription.AlphaClipThreshold = 0.0;
  3718. #if _ALPHATEST_ON
  3719. float alphaClipThreshold = 0.01f;
  3720. #if ALPHA_CLIP_THRESHOLD
  3721. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  3722. #endif
  3723. clip(surfaceDescription.Alpha - alphaClipThreshold);
  3724. #endif
  3725. half4 outColor = 0;
  3726. #ifdef SCENESELECTIONPASS
  3727. outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  3728. #elif defined(SCENEPICKINGPASS)
  3729. outColor = _SelectionID;
  3730. #endif
  3731. return outColor;
  3732. }
  3733. ENDHLSL
  3734. }
  3735. Pass
  3736. {
  3737. Name "ScenePickingPass"
  3738. Tags { "LightMode"="Picking" }
  3739. AlphaToMask Off
  3740. HLSLPROGRAM
  3741. #define _NORMAL_DROPOFF_TS 1
  3742. #define ASE_FOG 1
  3743. #define ASE_PHONG_TESSELLATION
  3744. #define ASE_DEPTH_WRITE_ON
  3745. #define _SURFACE_TYPE_TRANSPARENT 1
  3746. #define ASE_TESSELLATION 1
  3747. #pragma require tessellation tessHW
  3748. #pragma hull HullFunction
  3749. #pragma domain DomainFunction
  3750. #define ASE_TRANSLUCENCY 1
  3751. #define ASE_LENGTH_TESSELLATION
  3752. #define _EMISSION
  3753. #define _ALPHATEST_ON 1
  3754. #define ASE_SRP_VERSION 140004
  3755. #define REQUIRE_DEPTH_TEXTURE 1
  3756. #pragma multi_compile _ DOTS_INSTANCING_ON
  3757. #pragma vertex vert
  3758. #pragma fragment frag
  3759. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  3760. #define _SPECULAR_COLOR 1
  3761. #endif
  3762. #define SCENEPICKINGPASS 1
  3763. #define ATTRIBUTES_NEED_NORMAL
  3764. #define ATTRIBUTES_NEED_TANGENT
  3765. #define SHADERPASS SHADERPASS_DEPTHONLY
  3766. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  3767. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  3768. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  3769. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  3770. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  3771. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  3772. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  3773. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  3774. #define ASE_NEEDS_VERT_POSITION
  3775. #define ASE_NEEDS_VERT_NORMAL
  3776. struct VertexInput
  3777. {
  3778. float4 positionOS : POSITION;
  3779. float3 normalOS : NORMAL;
  3780. float4 ase_color : COLOR;
  3781. UNITY_VERTEX_INPUT_INSTANCE_ID
  3782. };
  3783. struct VertexOutput
  3784. {
  3785. float4 positionCS : SV_POSITION;
  3786. float4 ase_texcoord : TEXCOORD0;
  3787. float4 ase_color : COLOR;
  3788. UNITY_VERTEX_INPUT_INSTANCE_ID
  3789. UNITY_VERTEX_OUTPUT_STEREO
  3790. };
  3791. CBUFFER_START(UnityPerMaterial)
  3792. float4 _TranslucencyColor;
  3793. float4 _EmmissiveColor;
  3794. float4 _BaseColor;
  3795. float4 _Mask1;
  3796. float4 _Mask0;
  3797. float3 _NoiseScale3D;
  3798. float3 _WindDirection;
  3799. float3 _AdditionalNoiseDir;
  3800. float3 _AdditionalVoronoiDir;
  3801. float _EmmissiveNoiseColor;
  3802. float _VertexColorStrength;
  3803. float _NoiseColorStrength;
  3804. float _NoiseColorMix;
  3805. float _DepthDistance;
  3806. float _VoronoiStrength;
  3807. float _EmmissiveDepthFade;
  3808. float _VorSpeed;
  3809. float _VoronoiScale;
  3810. float _NoiseStrength;
  3811. float _NoiseScale;
  3812. float _WindSpeed;
  3813. float _NoiseSpeed;
  3814. float _NoiseDisplacement;
  3815. float _Scale;
  3816. #ifdef ASE_TRANSMISSION
  3817. float _TransmissionShadow;
  3818. #endif
  3819. #ifdef ASE_TRANSLUCENCY
  3820. float _TransStrength;
  3821. float _TransNormal;
  3822. float _TransScattering;
  3823. float _TransDirect;
  3824. float _TransAmbient;
  3825. float _TransShadow;
  3826. #endif
  3827. #ifdef ASE_TESSELLATION
  3828. float _TessPhongStrength;
  3829. float _TessValue;
  3830. float _TessMin;
  3831. float _TessMax;
  3832. float _TessEdgeLength;
  3833. float _TessMaxDisp;
  3834. #endif
  3835. CBUFFER_END
  3836. #ifdef SCENEPICKINGPASS
  3837. float4 _SelectionID;
  3838. #endif
  3839. #ifdef SCENESELECTIONPASS
  3840. int _ObjectId;
  3841. int _PassValue;
  3842. #endif
  3843. float3 mod3D289( float3 x ) { return x - floor( x / 289.0 ) * 289.0; }
  3844. float4 mod3D289( float4 x ) { return x - floor( x / 289.0 ) * 289.0; }
  3845. float4 permute( float4 x ) { return mod3D289( ( x * 34.0 + 1.0 ) * x ); }
  3846. float4 taylorInvSqrt( float4 r ) { return 1.79284291400159 - r * 0.85373472095314; }
  3847. float snoise( float3 v )
  3848. {
  3849. const float2 C = float2( 1.0 / 6.0, 1.0 / 3.0 );
  3850. float3 i = floor( v + dot( v, C.yyy ) );
  3851. float3 x0 = v - i + dot( i, C.xxx );
  3852. float3 g = step( x0.yzx, x0.xyz );
  3853. float3 l = 1.0 - g;
  3854. float3 i1 = min( g.xyz, l.zxy );
  3855. float3 i2 = max( g.xyz, l.zxy );
  3856. float3 x1 = x0 - i1 + C.xxx;
  3857. float3 x2 = x0 - i2 + C.yyy;
  3858. float3 x3 = x0 - 0.5;
  3859. i = mod3D289( i);
  3860. float4 p = permute( permute( permute( i.z + float4( 0.0, i1.z, i2.z, 1.0 ) ) + i.y + float4( 0.0, i1.y, i2.y, 1.0 ) ) + i.x + float4( 0.0, i1.x, i2.x, 1.0 ) );
  3861. float4 j = p - 49.0 * floor( p / 49.0 ); // mod(p,7*7)
  3862. float4 x_ = floor( j / 7.0 );
  3863. float4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)
  3864. float4 x = ( x_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  3865. float4 y = ( y_ * 2.0 + 0.5 ) / 7.0 - 1.0;
  3866. float4 h = 1.0 - abs( x ) - abs( y );
  3867. float4 b0 = float4( x.xy, y.xy );
  3868. float4 b1 = float4( x.zw, y.zw );
  3869. float4 s0 = floor( b0 ) * 2.0 + 1.0;
  3870. float4 s1 = floor( b1 ) * 2.0 + 1.0;
  3871. float4 sh = -step( h, 0.0 );
  3872. float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;
  3873. float4 a1 = b1.xzyw + s1.xzyw * sh.zzww;
  3874. float3 g0 = float3( a0.xy, h.x );
  3875. float3 g1 = float3( a0.zw, h.y );
  3876. float3 g2 = float3( a1.xy, h.z );
  3877. float3 g3 = float3( a1.zw, h.w );
  3878. float4 norm = taylorInvSqrt( float4( dot( g0, g0 ), dot( g1, g1 ), dot( g2, g2 ), dot( g3, g3 ) ) );
  3879. g0 *= norm.x;
  3880. g1 *= norm.y;
  3881. g2 *= norm.z;
  3882. g3 *= norm.w;
  3883. float4 m = max( 0.6 - float4( dot( x0, x0 ), dot( x1, x1 ), dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );
  3884. m = m* m;
  3885. m = m* m;
  3886. float4 px = float4( dot( x0, g0 ), dot( x1, g1 ), dot( x2, g2 ), dot( x3, g3 ) );
  3887. return 42.0 * dot( m, px);
  3888. }
  3889. float2 voronoihash97( float2 p )
  3890. {
  3891. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  3892. return frac( sin( p ) *43758.5453);
  3893. }
  3894. float voronoi97( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  3895. {
  3896. float2 n = floor( v );
  3897. float2 f = frac( v );
  3898. float F1 = 8.0;
  3899. float F2 = 8.0; float2 mg = 0;
  3900. for ( int j = -1; j <= 1; j++ )
  3901. {
  3902. for ( int i = -1; i <= 1; i++ )
  3903. {
  3904. float2 g = float2( i, j );
  3905. float2 o = voronoihash97( n + g );
  3906. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  3907. float d = 0.5 * dot( r, r );
  3908. if( d<F1 ) {
  3909. F2 = F1;
  3910. F1 = d; mg = g; mr = r; id = o;
  3911. } else if( d<F2 ) {
  3912. F2 = d;
  3913. }
  3914. }
  3915. }
  3916. return F1;
  3917. }
  3918. float2 voronoihash96( float2 p )
  3919. {
  3920. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  3921. return frac( sin( p ) *43758.5453);
  3922. }
  3923. float voronoi96( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  3924. {
  3925. float2 n = floor( v );
  3926. float2 f = frac( v );
  3927. float F1 = 8.0;
  3928. float F2 = 8.0; float2 mg = 0;
  3929. for ( int j = -1; j <= 1; j++ )
  3930. {
  3931. for ( int i = -1; i <= 1; i++ )
  3932. {
  3933. float2 g = float2( i, j );
  3934. float2 o = voronoihash96( n + g );
  3935. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  3936. float d = 0.5 * dot( r, r );
  3937. if( d<F1 ) {
  3938. F2 = F1;
  3939. F1 = d; mg = g; mr = r; id = o;
  3940. } else if( d<F2 ) {
  3941. F2 = d;
  3942. }
  3943. }
  3944. }
  3945. return F1;
  3946. }
  3947. float2 voronoihash89( float2 p )
  3948. {
  3949. p = float2( dot( p, float2( 127.1, 311.7 ) ), dot( p, float2( 269.5, 183.3 ) ) );
  3950. return frac( sin( p ) *43758.5453);
  3951. }
  3952. float voronoi89( float2 v, float time, inout float2 id, inout float2 mr, float smoothness, inout float2 smoothId )
  3953. {
  3954. float2 n = floor( v );
  3955. float2 f = frac( v );
  3956. float F1 = 8.0;
  3957. float F2 = 8.0; float2 mg = 0;
  3958. for ( int j = -1; j <= 1; j++ )
  3959. {
  3960. for ( int i = -1; i <= 1; i++ )
  3961. {
  3962. float2 g = float2( i, j );
  3963. float2 o = voronoihash89( n + g );
  3964. o = ( sin( time + o * 6.2831 ) * 0.5 + 0.5 ); float2 r = f - g - o;
  3965. float d = 0.5 * dot( r, r );
  3966. if( d<F1 ) {
  3967. F2 = F1;
  3968. F1 = d; mg = g; mr = r; id = o;
  3969. } else if( d<F2 ) {
  3970. F2 = d;
  3971. }
  3972. }
  3973. }
  3974. return F1;
  3975. }
  3976. struct SurfaceDescription
  3977. {
  3978. float Alpha;
  3979. float AlphaClipThreshold;
  3980. };
  3981. VertexOutput VertexFunction(VertexInput v )
  3982. {
  3983. VertexOutput o;
  3984. ZERO_INITIALIZE(VertexOutput, o);
  3985. UNITY_SETUP_INSTANCE_ID(v);
  3986. UNITY_TRANSFER_INSTANCE_ID(v, o);
  3987. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  3988. #if ( SHADER_TARGET >= 50 )
  3989. float recip367 = rcp( _Scale );
  3990. #else
  3991. float recip367 = 1.0 / _Scale;
  3992. #endif
  3993. float Scale228 = recip367;
  3994. float4 appendResult329 = (float4(_NoiseScale3D.x , _NoiseScale3D.y , _NoiseScale3D.z , 0.0));
  3995. float3 WindDir317 = ( ( float3( 1, 1, 1 ) * -2 + 1 ) * _WindDirection );
  3996. float3 break332 = WindDir317;
  3997. float temp_output_333_0 = ( abs( break332.x ) + abs( break332.y ) + abs( break332.z ) );
  3998. float4 appendResult340 = (float4(( break332.x / temp_output_333_0 ) , ( break332.y / temp_output_333_0 ) , ( break332.z / temp_output_333_0 ) , 0.0));
  3999. float4 WindDirWeights341 = appendResult340;
  4000. float4 break344 = abs( WindDirWeights341 );
  4001. float4 appendResult330 = (float4(_NoiseScale3D.y , _NoiseScale3D.x , _NoiseScale3D.z , 0.0));
  4002. float4 appendResult331 = (float4(_NoiseScale3D.y , _NoiseScale3D.z , _NoiseScale3D.x , 0.0));
  4003. float4 transform70 = mul(GetObjectToWorldMatrix(),v.positionOS);
  4004. float4 temp_output_71_0 = (transform70).xyzw;
  4005. float simplePerlin3D112 = snoise( ( Scale228 * ( ( ( appendResult329 * break344.x ) + ( appendResult330 * break344.y ) + ( appendResult331 * break344.z ) ) * (temp_output_71_0*1.0 + float4( ( ( WindDir317 + _AdditionalNoiseDir ) * ( _NoiseSpeed * _TimeParameters.x * _WindSpeed ) ) , 0.0 )) ) ).xyz*_NoiseScale );
  4006. simplePerlin3D112 = simplePerlin3D112*0.5 + 0.5;
  4007. float temp_output_118_0 = saturate( (0.0 + (simplePerlin3D112 - 0.0) * (1.0 - 0.0) / (1.0 - 0.0)) );
  4008. float temp_output_198_0 = ( Scale228 * _VoronoiScale );
  4009. float time97 = 0.0;
  4010. float2 voronoiSmoothId97 = 0;
  4011. float4 break84 = (temp_output_71_0*1.0 + float4( ( ( _TimeParameters.x * _VorSpeed * _WindSpeed ) * ( WindDir317 + _AdditionalVoronoiDir ) ) , 0.0 ));
  4012. float2 appendResult85 = (float2(break84.z , break84.y));
  4013. float2 coords97 = appendResult85 * temp_output_198_0;
  4014. float2 id97 = 0;
  4015. float2 uv97 = 0;
  4016. float fade97 = 0.5;
  4017. float voroi97 = 0;
  4018. float rest97 = 0;
  4019. for( int it97 = 0; it97 <3; it97++ ){
  4020. voroi97 += fade97 * voronoi97( coords97, time97, id97, uv97, 0,voronoiSmoothId97 );
  4021. rest97 += fade97;
  4022. coords97 *= 2;
  4023. fade97 *= 0.5;
  4024. }//Voronoi97
  4025. voroi97 /= rest97;
  4026. float3 objToWorldDir91 = mul( GetObjectToWorldMatrix(), float4( v.normalOS, 0 ) ).xyz;
  4027. float3 temp_output_93_0 = pow( abs( objToWorldDir91 ) , 5.0 );
  4028. float dotResult94 = dot( temp_output_93_0 , float3( 1,1,1 ) );
  4029. float3 break104 = ( temp_output_93_0 / dotResult94 );
  4030. float time96 = 217.0;
  4031. float2 voronoiSmoothId96 = 0;
  4032. float2 appendResult86 = (float2(break84.z , break84.x));
  4033. float2 coords96 = appendResult86 * temp_output_198_0;
  4034. float2 id96 = 0;
  4035. float2 uv96 = 0;
  4036. float fade96 = 0.5;
  4037. float voroi96 = 0;
  4038. float rest96 = 0;
  4039. for( int it96 = 0; it96 <3; it96++ ){
  4040. voroi96 += fade96 * voronoi96( coords96, time96, id96, uv96, 0,voronoiSmoothId96 );
  4041. rest96 += fade96;
  4042. coords96 *= 2;
  4043. fade96 *= 0.5;
  4044. }//Voronoi96
  4045. voroi96 /= rest96;
  4046. float time89 = 137.0;
  4047. float2 voronoiSmoothId89 = 0;
  4048. float2 appendResult87 = (float2(break84.x , break84.y));
  4049. float2 coords89 = appendResult87 * temp_output_198_0;
  4050. float2 id89 = 0;
  4051. float2 uv89 = 0;
  4052. float fade89 = 0.5;
  4053. float voroi89 = 0;
  4054. float rest89 = 0;
  4055. for( int it89 = 0; it89 <3; it89++ ){
  4056. voroi89 += fade89 * voronoi89( coords89, time89, id89, uv89, 0,voronoiSmoothId89 );
  4057. rest89 += fade89;
  4058. coords89 *= 2;
  4059. fade89 *= 0.5;
  4060. }//Voronoi89
  4061. voroi89 /= rest89;
  4062. float temp_output_190_0 = saturate( (0.0 + (( 1.0 - ( ( ( voroi97 * break104.x ) + ( voroi96 * break104.y ) ) + ( voroi89 * break104.z ) ) ) - 0.65) * (1.0 - 0.0) / (1.0 - 0.65)) );
  4063. float temp_output_122_0 = saturate( ( ( temp_output_118_0 * _NoiseStrength ) + ( temp_output_190_0 * _VoronoiStrength ) ) );
  4064. float3 ase_objectScale = float3( length( GetObjectToWorldMatrix()[ 0 ].xyz ), length( GetObjectToWorldMatrix()[ 1 ].xyz ), length( GetObjectToWorldMatrix()[ 2 ].xyz ) );
  4065. float3 temp_output_184_0 = ( ( ( temp_output_122_0 - 0.5 ) * v.normalOS * ( _NoiseDisplacement / Scale228 ) ) / ase_objectScale );
  4066. float4 temp_output_2_0_g146 = _Mask0;
  4067. float3 worldToObj306 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g146).xyz, 1 ) ).xyz;
  4068. float3 ase_objectPosition = GetAbsolutePositionWS( UNITY_MATRIX_M._m03_m13_m23 );
  4069. float4 appendResult313 = (float4((temp_output_2_0_g146).w , 0.0 , 0.0 , 0.0));
  4070. float3 worldToObj307 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult313 ).xyz, 1 ) ).xyz;
  4071. float3 temp_output_304_0 = ( temp_output_184_0 + ( min( ( distance( ( temp_output_184_0 + v.positionOS.xyz ) , worldToObj306 ) - length( worldToObj307 ) ) , 0.0 ) * v.normalOS ) );
  4072. float4 temp_output_2_0_g153 = _Mask1;
  4073. float3 worldToObj357 = mul( GetWorldToObjectMatrix(), float4( (temp_output_2_0_g153).xyz, 1 ) ).xyz;
  4074. float4 appendResult354 = (float4((temp_output_2_0_g153).w , 0.0 , 0.0 , 0.0));
  4075. float3 worldToObj358 = mul( GetWorldToObjectMatrix(), float4( ( float4( ase_objectPosition , 0.0 ) + appendResult354 ).xyz, 1 ) ).xyz;
  4076. float3 VertexOffset305 = ( temp_output_304_0 + ( min( ( distance( ( temp_output_304_0 + v.positionOS.xyz ) , worldToObj357 ) - length( worldToObj358 ) ) , 0.0 ) * v.normalOS ) );
  4077. float3 vertexPos38 = ( VertexOffset305 + v.positionOS.xyz );
  4078. float4 ase_clipPos38 = TransformObjectToHClip((vertexPos38).xyz);
  4079. float4 screenPos38 = ComputeScreenPos(ase_clipPos38);
  4080. o.ase_texcoord = screenPos38;
  4081. o.ase_color = v.ase_color;
  4082. #ifdef ASE_ABSOLUTE_VERTEX_POS
  4083. float3 defaultVertexValue = v.positionOS.xyz;
  4084. #else
  4085. float3 defaultVertexValue = float3(0, 0, 0);
  4086. #endif
  4087. float3 vertexValue = VertexOffset305;
  4088. #ifdef ASE_ABSOLUTE_VERTEX_POS
  4089. v.positionOS.xyz = vertexValue;
  4090. #else
  4091. v.positionOS.xyz += vertexValue;
  4092. #endif
  4093. v.normalOS = v.normalOS;
  4094. float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
  4095. o.positionCS = TransformWorldToHClip(positionWS);
  4096. return o;
  4097. }
  4098. #if defined(ASE_TESSELLATION)
  4099. struct VertexControl
  4100. {
  4101. float4 vertex : INTERNALTESSPOS;
  4102. float3 normalOS : NORMAL;
  4103. float4 ase_color : COLOR;
  4104. UNITY_VERTEX_INPUT_INSTANCE_ID
  4105. };
  4106. struct TessellationFactors
  4107. {
  4108. float edge[3] : SV_TessFactor;
  4109. float inside : SV_InsideTessFactor;
  4110. };
  4111. VertexControl vert ( VertexInput v )
  4112. {
  4113. VertexControl o;
  4114. UNITY_SETUP_INSTANCE_ID(v);
  4115. UNITY_TRANSFER_INSTANCE_ID(v, o);
  4116. o.vertex = v.positionOS;
  4117. o.normalOS = v.normalOS;
  4118. o.ase_color = v.ase_color;
  4119. return o;
  4120. }
  4121. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  4122. {
  4123. TessellationFactors o;
  4124. float4 tf = 1;
  4125. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  4126. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  4127. #if defined(ASE_FIXED_TESSELLATION)
  4128. tf = FixedTess( tessValue );
  4129. #elif defined(ASE_DISTANCE_TESSELLATION)
  4130. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  4131. #elif defined(ASE_LENGTH_TESSELLATION)
  4132. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  4133. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  4134. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  4135. #endif
  4136. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  4137. return o;
  4138. }
  4139. [domain("tri")]
  4140. [partitioning("fractional_odd")]
  4141. [outputtopology("triangle_cw")]
  4142. [patchconstantfunc("TessellationFunction")]
  4143. [outputcontrolpoints(3)]
  4144. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  4145. {
  4146. return patch[id];
  4147. }
  4148. [domain("tri")]
  4149. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  4150. {
  4151. VertexInput o = (VertexInput) 0;
  4152. o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  4153. o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  4154. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  4155. #if defined(ASE_PHONG_TESSELLATION)
  4156. float3 pp[3];
  4157. for (int i = 0; i < 3; ++i)
  4158. pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  4159. float phongStrength = _TessPhongStrength;
  4160. o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
  4161. #endif
  4162. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  4163. return VertexFunction(o);
  4164. }
  4165. #else
  4166. VertexOutput vert ( VertexInput v )
  4167. {
  4168. return VertexFunction( v );
  4169. }
  4170. #endif
  4171. half4 frag(VertexOutput IN ) : SV_TARGET
  4172. {
  4173. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  4174. float4 screenPos38 = IN.ase_texcoord;
  4175. float4 ase_screenPosNorm38 = screenPos38 / screenPos38.w;
  4176. ase_screenPosNorm38.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm38.z : ase_screenPosNorm38.z * 0.5 + 0.5;
  4177. float screenDepth38 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm38.xy ),_ZBufferParams);
  4178. float distanceDepth38 = abs( ( screenDepth38 - LinearEyeDepth( ase_screenPosNorm38.z,_ZBufferParams ) ) / ( _DepthDistance ) );
  4179. float temp_output_1_0_g154 = distanceDepth38;
  4180. float DepthFade43 = saturate( ( ( ( pow( temp_output_1_0_g154 , 5.0 ) * 6.0 ) - ( pow( temp_output_1_0_g154 , 4.0 ) * 15.0 ) ) + ( pow( temp_output_1_0_g154 , 3.0 ) * 10.0 ) ) );
  4181. float4 lerpResult161 = lerp( _BaseColor , IN.ase_color , _VertexColorStrength);
  4182. float4 temp_output_2_0_g155 = lerpResult161;
  4183. float BaseColorAlpha162 = (temp_output_2_0_g155).a;
  4184. surfaceDescription.Alpha = ( DepthFade43 * BaseColorAlpha162 );
  4185. surfaceDescription.AlphaClipThreshold = 0.0;
  4186. #if _ALPHATEST_ON
  4187. float alphaClipThreshold = 0.01f;
  4188. #if ALPHA_CLIP_THRESHOLD
  4189. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  4190. #endif
  4191. clip(surfaceDescription.Alpha - alphaClipThreshold);
  4192. #endif
  4193. half4 outColor = 0;
  4194. #ifdef SCENESELECTIONPASS
  4195. outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  4196. #elif defined(SCENEPICKINGPASS)
  4197. outColor = _SelectionID;
  4198. #endif
  4199. return outColor;
  4200. }
  4201. ENDHLSL
  4202. }
  4203. }
  4204. CustomEditor "UnityEditor.ShaderGraphLitGUI"
  4205. FallBack "Hidden/Shader Graph/FallbackError"
  4206. Fallback Off
  4207. }
  4208. /*ASEBEGIN
  4209. Version=19603
  4210. Node;AmplifyShaderEditor.Vector3Node;316;-1488,1952;Inherit;False;Property;_WindDirection;WindDirection;4;0;Create;True;0;0;0;False;0;False;-1,-0.3,-0.3;-1,-0.3,-0.3;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4211. Node;AmplifyShaderEditor.FlipNode;328;-1232,1952;Inherit;False;True;True;True;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  4212. Node;AmplifyShaderEditor.RegisterLocalVarNode;317;-1040,1952;Inherit;False;WindDir;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  4213. Node;AmplifyShaderEditor.GetLocalVarNode;326;-1968,1600;Inherit;False;317;WindDir;1;0;OBJECT;;False;1;FLOAT3;0
  4214. Node;AmplifyShaderEditor.BreakToComponentsNode;332;-1776,1600;Inherit;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
  4215. Node;AmplifyShaderEditor.AbsOpNode;334;-1616,1568;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4216. Node;AmplifyShaderEditor.AbsOpNode;335;-1616,1648;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4217. Node;AmplifyShaderEditor.AbsOpNode;336;-1616,1728;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4218. Node;AmplifyShaderEditor.CommentaryNode;130;-768,1424;Inherit;False;4809.925;1890.271;;80;342;344;343;348;346;347;330;331;143;114;152;151;128;127;239;238;184;183;123;124;232;181;229;125;122;121;115;120;119;116;118;190;191;117;112;192;196;113;111;195;145;109;110;78;89;108;107;77;96;97;87;322;198;74;85;86;320;76;84;88;197;72;228;79;227;83;71;323;91;80;70;134;325;82;90;81;69;329;345;367;Tri Planar Noise;1,1,1,1;0;0
  4219. Node;AmplifyShaderEditor.SimpleAddOpNode;333;-1472,1616;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  4220. Node;AmplifyShaderEditor.SimpleTimeNode;73;-1008,2240;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
  4221. Node;AmplifyShaderEditor.SimpleDivideOpNode;337;-1344,1568;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4222. Node;AmplifyShaderEditor.SimpleDivideOpNode;338;-1344,1664;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4223. Node;AmplifyShaderEditor.SimpleDivideOpNode;339;-1344,1760;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4224. Node;AmplifyShaderEditor.GetLocalVarNode;325;-624,2656;Inherit;False;317;WindDir;1;0;OBJECT;;False;1;FLOAT3;0
  4225. Node;AmplifyShaderEditor.RangedFloatNode;319;-1008,2144;Inherit;False;Property;_WindSpeed;WindSpeed;5;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
  4226. Node;AmplifyShaderEditor.RangedFloatNode;81;-672,2544;Inherit;False;Property;_VorSpeed;Vor Speed;12;0;Create;True;0;0;0;False;0;False;0.05;0.05;0;0;0;1;FLOAT;0
  4227. Node;AmplifyShaderEditor.Vector3Node;82;-656,2736;Inherit;False;Property;_AdditionalVoronoiDir;AdditionalVoronoiDir;14;0;Create;True;0;0;0;False;0;False;0.7,-0.3,-0.3;0.7,-0.3,-0.3;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4228. Node;AmplifyShaderEditor.NormalVertexDataNode;90;-400,3088;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4229. Node;AmplifyShaderEditor.PosVertexDataNode;69;-656,2208;Inherit;False;1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4230. Node;AmplifyShaderEditor.CommentaryNode;134;48,2800;Inherit;False;999.4751;434.6895;Smooth Axis Fade ;5;93;92;104;95;94;;1,1,1,1;0;0
  4231. Node;AmplifyShaderEditor.DynamicAppendNode;340;-1184,1632;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  4232. Node;AmplifyShaderEditor.ObjectToWorldTransfNode;70;-448,2208;Inherit;False;1;0;FLOAT4;0,0,0,1;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4233. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;80;-448,2448;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  4234. Node;AmplifyShaderEditor.TransformDirectionNode;91;-208,3088;Inherit;False;Object;World;False;Fast;False;1;0;FLOAT3;0,0,0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4235. Node;AmplifyShaderEditor.SimpleAddOpNode;323;-400,2640;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4236. Node;AmplifyShaderEditor.RangedFloatNode;227;-464,1632;Inherit;False;Property;_Scale;Scale;3;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
  4237. Node;AmplifyShaderEditor.RegisterLocalVarNode;341;-1024,1632;Inherit;False;WindDirWeights;-1;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4238. Node;AmplifyShaderEditor.ComponentMaskNode;71;-192,2208;Inherit;False;True;True;True;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4239. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;83;-224,2448;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4240. Node;AmplifyShaderEditor.AbsOpNode;92;64,2880;Inherit;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  4241. Node;AmplifyShaderEditor.ReciprocalOpNode;367;-304,1632;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4242. Node;AmplifyShaderEditor.PowerNode;93;272,2928;Inherit;False;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;5;False;1;FLOAT3;0
  4243. Node;AmplifyShaderEditor.ScaleAndOffsetNode;79;144,2368;Inherit;False;3;0;FLOAT4;0,0,0,0;False;1;FLOAT;1;False;2;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4244. Node;AmplifyShaderEditor.RegisterLocalVarNode;228;-144,1632;Inherit;False;Scale;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4245. Node;AmplifyShaderEditor.GetLocalVarNode;342;112,1808;Inherit;False;341;WindDirWeights;1;0;OBJECT;;False;1;FLOAT4;0
  4246. Node;AmplifyShaderEditor.DotProductOpNode;94;448,3008;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;1,1,1;False;1;FLOAT;0
  4247. Node;AmplifyShaderEditor.GetLocalVarNode;197;464,2096;Inherit;False;228;Scale;1;0;OBJECT;;False;1;FLOAT;0
  4248. Node;AmplifyShaderEditor.BreakToComponentsNode;84;400,2368;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
  4249. Node;AmplifyShaderEditor.GetLocalVarNode;320;-608,1824;Inherit;False;317;WindDir;1;0;OBJECT;;False;1;FLOAT3;0
  4250. Node;AmplifyShaderEditor.AbsOpNode;343;320,1808;Inherit;False;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4251. Node;AmplifyShaderEditor.RangedFloatNode;72;-656,2064;Inherit;False;Property;_NoiseSpeed;Noise Speed;11;0;Create;True;0;0;0;False;0;False;0.2;0.2;0;0;0;1;FLOAT;0
  4252. Node;AmplifyShaderEditor.Vector3Node;76;-640,1904;Inherit;False;Property;_AdditionalNoiseDir;Additional Noise Dir;13;0;Create;True;0;0;0;False;0;False;0,0,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4253. Node;AmplifyShaderEditor.RangedFloatNode;88;464,2176;Inherit;False;Property;_VoronoiScale;Voronoi Scale;15;0;Create;True;0;0;0;False;0;False;1.4;1.4;0;0;0;1;FLOAT;0
  4254. Node;AmplifyShaderEditor.Vector3Node;143;400,1648;Inherit;False;Property;_NoiseScale3D;Noise Scale 3D;20;0;Create;True;0;0;0;False;0;False;1,0.2,0.6;1,0.2,0.6;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4255. Node;AmplifyShaderEditor.DynamicAppendNode;86;608,2400;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  4256. Node;AmplifyShaderEditor.DynamicAppendNode;85;608,2304;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  4257. Node;AmplifyShaderEditor.SimpleDivideOpNode;95;608,2928;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  4258. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;74;-448,2064;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  4259. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;198;656,2096;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4260. Node;AmplifyShaderEditor.SimpleAddOpNode;322;-368,1936;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4261. Node;AmplifyShaderEditor.DynamicAppendNode;331;624,1808;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  4262. Node;AmplifyShaderEditor.DynamicAppendNode;329;624,1504;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  4263. Node;AmplifyShaderEditor.DynamicAppendNode;330;624,1648;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  4264. Node;AmplifyShaderEditor.BreakToComponentsNode;344;432,1808;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
  4265. Node;AmplifyShaderEditor.DynamicAppendNode;87;608,2496;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  4266. Node;AmplifyShaderEditor.BreakToComponentsNode;104;832,2992;Inherit;True;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
  4267. Node;AmplifyShaderEditor.VoronoiNode;97;912,1968;Inherit;True;0;0;1;0;3;False;1;False;False;False;4;0;FLOAT2;0,0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;3;FLOAT;0;FLOAT2;1;FLOAT2;2
  4268. Node;AmplifyShaderEditor.VoronoiNode;96;912,2240;Inherit;True;0;0;1;0;3;False;1;False;False;False;4;0;FLOAT2;0,0;False;1;FLOAT;217;False;2;FLOAT;1;False;3;FLOAT;0;False;3;FLOAT;0;FLOAT2;1;FLOAT2;2
  4269. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;77;-224,2000;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  4270. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;347;784,1808;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0
  4271. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;346;784,1648;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0
  4272. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;345;784,1504;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0
  4273. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;107;1232,2032;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4274. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;108;1216,2192;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4275. Node;AmplifyShaderEditor.VoronoiNode;89;912,2512;Inherit;True;0;0;1;0;3;False;1;False;False;False;4;0;FLOAT2;0,0;False;1;FLOAT;137;False;2;FLOAT;1;False;3;FLOAT;0;False;3;FLOAT;0;FLOAT2;1;FLOAT2;2
  4276. Node;AmplifyShaderEditor.ScaleAndOffsetNode;78;144,2016;Inherit;False;3;0;FLOAT4;0,0,0,0;False;1;FLOAT;1;False;2;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4277. Node;AmplifyShaderEditor.SimpleAddOpNode;348;976,1616;Inherit;False;3;3;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4278. Node;AmplifyShaderEditor.SimpleAddOpNode;110;1408,2128;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4279. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;109;1184,2448;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4280. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;145;1328,1712;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4281. Node;AmplifyShaderEditor.GetLocalVarNode;195;1296,1632;Inherit;False;228;Scale;1;0;OBJECT;;False;1;FLOAT;0
  4282. Node;AmplifyShaderEditor.SimpleAddOpNode;111;1568,2256;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4283. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;196;1536,1680;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4284. Node;AmplifyShaderEditor.RangedFloatNode;113;1536,1840;Inherit;False;Property;_NoiseScale;Noise Scale;16;0;Create;True;0;0;0;False;0;False;20;20;0;0;0;1;FLOAT;0
  4285. Node;AmplifyShaderEditor.NoiseGeneratorNode;112;1760,1712;Inherit;True;Simplex3D;True;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;1;False;1;FLOAT;0
  4286. Node;AmplifyShaderEditor.OneMinusNode;192;1792,2144;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4287. Node;AmplifyShaderEditor.TFHCRemapNode;117;2064,1728;Inherit;True;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
  4288. Node;AmplifyShaderEditor.TFHCRemapNode;191;1824,2288;Inherit;True;5;0;FLOAT;0;False;1;FLOAT;0.65;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
  4289. Node;AmplifyShaderEditor.SaturateNode;190;2112,2304;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  4290. Node;AmplifyShaderEditor.SaturateNode;118;2352,1728;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4291. Node;AmplifyShaderEditor.RangedFloatNode;119;2336,1824;Inherit;False;Property;_NoiseStrength;Noise Strength;18;0;Create;True;0;0;0;False;0;False;0.03;0.04;0;0;0;1;FLOAT;0
  4292. Node;AmplifyShaderEditor.RangedFloatNode;116;2272,2192;Inherit;False;Property;_VoronoiStrength;Voronoi Strength;17;0;Create;True;0;0;0;False;0;False;0.9;0.8;0;0;0;1;FLOAT;0
  4293. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;120;2544,1760;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4294. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;115;2544,2000;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4295. Node;AmplifyShaderEditor.CommentaryNode;293;4112,1984;Inherit;False;1979.398;736.2354;;10;306;296;294;315;304;303;299;301;298;297;Sphere Mask 0;1,1,1,1;0;0
  4296. Node;AmplifyShaderEditor.SimpleAddOpNode;121;2800,1904;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4297. Node;AmplifyShaderEditor.SaturateNode;122;3024,1904;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  4298. Node;AmplifyShaderEditor.GetLocalVarNode;229;3056,2272;Inherit;False;228;Scale;1;0;OBJECT;;False;1;FLOAT;0
  4299. Node;AmplifyShaderEditor.RangedFloatNode;125;3024,2192;Inherit;False;Property;_NoiseDisplacement;Noise Displacement;19;0;Create;True;0;0;0;False;0;False;0.5;0.5;0;0;0;1;FLOAT;0
  4300. Node;AmplifyShaderEditor.Vector4Node;294;4160,2224;Inherit;False;Property;_Mask0;Mask0;6;0;Create;True;0;0;0;False;0;False;1.985208,0.440832,0.2055923,1.2;-3.25,0.81,0.08,0.7;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4301. Node;AmplifyShaderEditor.CommentaryNode;315;4368,2416;Inherit;False;932;266.2;Radius to object space;5;314;307;312;311;313;;1,1,1,1;0;0
  4302. Node;AmplifyShaderEditor.SimpleSubtractOpNode;181;3264,1904;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0.5;False;1;FLOAT;0
  4303. Node;AmplifyShaderEditor.SimpleDivideOpNode;232;3264,2192;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4304. Node;AmplifyShaderEditor.NormalVertexDataNode;124;3232,2016;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4305. Node;AmplifyShaderEditor.FunctionNode;296;4432,2224;Inherit;False;Alpha Split;-1;;146;07dab7960105b86429ac8eebd729ed6d;0;1;2;FLOAT4;0,0,0,0;False;2;FLOAT3;0;FLOAT;6
  4306. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;123;3456,1920;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
  4307. Node;AmplifyShaderEditor.ObjectScaleNode;183;3472,2096;Inherit;False;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4308. Node;AmplifyShaderEditor.DynamicAppendNode;313;4624,2496;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  4309. Node;AmplifyShaderEditor.ObjectPositionNode;311;4416,2464;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4310. Node;AmplifyShaderEditor.SimpleDivideOpNode;184;3648,2000;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4311. Node;AmplifyShaderEditor.PosVertexDataNode;238;3696,2160;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4312. Node;AmplifyShaderEditor.SimpleAddOpNode;312;4784,2464;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4313. Node;AmplifyShaderEditor.SimpleAddOpNode;239;3920,2112;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4314. Node;AmplifyShaderEditor.TransformPositionNode;306;4656,2224;Inherit;False;World;Object;False;Fast;True;1;0;FLOAT3;0,0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4315. Node;AmplifyShaderEditor.TransformPositionNode;307;4912,2464;Inherit;False;World;Object;False;Fast;True;1;0;FLOAT3;0,0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4316. Node;AmplifyShaderEditor.CommentaryNode;350;6464,2000;Inherit;False;1780.413;726.1177;;10;365;364;363;362;361;359;357;353;352;351;Sphere Mask 1;1,1,1,1;0;0
  4317. Node;AmplifyShaderEditor.DistanceOpNode;297;4880,2128;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
  4318. Node;AmplifyShaderEditor.LengthOpNode;314;5120,2464;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT;0
  4319. Node;AmplifyShaderEditor.SimpleSubtractOpNode;298;5168,2112;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
  4320. Node;AmplifyShaderEditor.Vector4Node;351;6512,2240;Inherit;False;Property;_Mask1;Mask1;7;0;Create;True;0;0;0;False;0;False;1.985208,0.440832,0.2055923,1.2;-1.926,-0.28,-0.223,0.7;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4321. Node;AmplifyShaderEditor.CommentaryNode;352;6720,2432;Inherit;False;932;266.2;Radius to object space;5;360;358;356;355;354;;1,1,1,1;0;0
  4322. Node;AmplifyShaderEditor.SimpleMinOpNode;301;5328,2112;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4323. Node;AmplifyShaderEditor.NormalVertexDataNode;299;5264,2240;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4324. Node;AmplifyShaderEditor.FunctionNode;353;6784,2240;Inherit;False;Alpha Split;-1;;153;07dab7960105b86429ac8eebd729ed6d;0;1;2;FLOAT4;0,0,0,0;False;2;FLOAT3;0;FLOAT;6
  4325. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;303;5456,2112;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;-1,0,0;False;1;FLOAT3;0
  4326. Node;AmplifyShaderEditor.DynamicAppendNode;354;6976,2512;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
  4327. Node;AmplifyShaderEditor.ObjectPositionNode;355;6768,2480;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  4328. Node;AmplifyShaderEditor.SimpleAddOpNode;304;5632,2048;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4329. Node;AmplifyShaderEditor.PosVertexDataNode;349;6128,2208;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4330. Node;AmplifyShaderEditor.SimpleAddOpNode;356;7136,2480;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  4331. Node;AmplifyShaderEditor.SimpleAddOpNode;366;6336,2144;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4332. Node;AmplifyShaderEditor.TransformPositionNode;357;7008,2240;Inherit;False;World;Object;False;Fast;True;1;0;FLOAT3;0,0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4333. Node;AmplifyShaderEditor.TransformPositionNode;358;7264,2480;Inherit;False;World;Object;False;Fast;True;1;0;FLOAT3;0,0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4334. Node;AmplifyShaderEditor.DistanceOpNode;359;7232,2144;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
  4335. Node;AmplifyShaderEditor.LengthOpNode;360;7472,2480;Inherit;False;1;0;FLOAT3;0,0,0;False;1;FLOAT;0
  4336. Node;AmplifyShaderEditor.SimpleSubtractOpNode;361;7648,2144;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
  4337. Node;AmplifyShaderEditor.SimpleMinOpNode;362;7808,2144;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4338. Node;AmplifyShaderEditor.NormalVertexDataNode;363;7744,2272;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4339. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;364;7936,2144;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;-1,0,0;False;1;FLOAT3;0
  4340. Node;AmplifyShaderEditor.SimpleAddOpNode;365;8112,2080;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4341. Node;AmplifyShaderEditor.CommentaryNode;44;880,784;Inherit;False;1119.002;389.2855;;7;43;135;36;38;35;33;34;Depth Fade;1,1,1,1;0;0
  4342. Node;AmplifyShaderEditor.RegisterLocalVarNode;305;8336,2080;Inherit;False;VertexOffset;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  4343. Node;AmplifyShaderEditor.CommentaryNode;31;1388.116,-224;Inherit;False;1507.612;770.0389;;15;1;162;13;16;160;161;20;19;146;147;21;30;28;29;163;Albedo;1,1,1,1;0;0
  4344. Node;AmplifyShaderEditor.PosVertexDataNode;34;912,928;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4345. Node;AmplifyShaderEditor.GetLocalVarNode;33;912,848;Inherit;False;305;VertexOffset;1;0;OBJECT;;False;1;FLOAT3;0
  4346. Node;AmplifyShaderEditor.SimpleAddOpNode;35;1136,848;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4347. Node;AmplifyShaderEditor.VertexColorNode;16;1664,288;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  4348. Node;AmplifyShaderEditor.RangedFloatNode;36;912,1088;Inherit;False;Property;_DepthDistance;Depth Distance;8;0;Create;True;0;0;0;False;0;False;0.4;0.4;0;0;0;1;FLOAT;0
  4349. Node;AmplifyShaderEditor.ColorNode;13;1440,176;Inherit;False;Property;_BaseColor;Base Color;0;0;Create;True;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
  4350. Node;AmplifyShaderEditor.RangedFloatNode;160;1872,368;Inherit;False;Property;_VertexColorStrength;Vertex Color Strength;23;0;Create;True;0;0;0;False;0;False;0.7030082;0.7030082;0;1;0;1;FLOAT;0
  4351. Node;AmplifyShaderEditor.DepthFade;38;1296,848;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
  4352. Node;AmplifyShaderEditor.LerpOp;161;2160,240;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
  4353. Node;AmplifyShaderEditor.FunctionNode;135;1568,848;Inherit;False;SmootherStep;-1;;154;4a9458489eca43748a1c8f13823257ba;0;1;1;FLOAT;0;False;1;FLOAT;0
  4354. Node;AmplifyShaderEditor.FunctionNode;163;2325.137,419.9323;Inherit;False;Alpha Split;-1;;155;07dab7960105b86429ac8eebd729ed6d;0;1;2;COLOR;0,0,0,0;False;2;FLOAT3;0;FLOAT;6
  4355. Node;AmplifyShaderEditor.RegisterLocalVarNode;43;1776,848;Inherit;False;DepthFade;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4356. Node;AmplifyShaderEditor.RegisterLocalVarNode;162;2528,448;Inherit;False;BaseColorAlpha;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4357. Node;AmplifyShaderEditor.CommentaryNode;68;1392,-1504;Inherit;False;1082.072;560.847;;9;150;140;149;141;60;66;62;61;67;Emmission;1,1,1,1;0;0
  4358. Node;AmplifyShaderEditor.CommentaryNode;59;1744,-704;Inherit;False;1151.964;403.8841;;7;56;58;57;55;54;136;137;Translucency;1,1,1,1;0;0
  4359. Node;AmplifyShaderEditor.GetLocalVarNode;164;2608,-976;Inherit;False;162;BaseColorAlpha;1;0;OBJECT;;False;1;FLOAT;0
  4360. Node;AmplifyShaderEditor.GetLocalVarNode;133;2640,-1056;Inherit;False;43;DepthFade;1;0;OBJECT;;False;1;FLOAT;0
  4361. Node;AmplifyShaderEditor.SaturateNode;29;2496,224;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  4362. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;2336,224;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  4363. Node;AmplifyShaderEditor.FresnelNode;54;1792,-656;Inherit;False;Standard;WorldNormal;ViewDir;False;False;5;0;FLOAT3;0,0,1;False;4;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;1;FLOAT;0
  4364. Node;AmplifyShaderEditor.SimpleAddOpNode;55;2208,-656;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4365. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;57;2432,-656;Inherit;True;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  4366. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;136;2672,-656;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
  4367. Node;AmplifyShaderEditor.GetLocalVarNode;137;2464,-416;Inherit;False;43;DepthFade;1;0;OBJECT;;False;1;FLOAT;0
  4368. Node;AmplifyShaderEditor.RegisterLocalVarNode;30;2672,224;Inherit;False;Albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  4369. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;147;2224,80;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  4370. Node;AmplifyShaderEditor.GetLocalVarNode;146;2048,-32;Inherit;False;43;DepthFade;1;0;OBJECT;;False;1;FLOAT;0
  4371. Node;AmplifyShaderEditor.LerpOp;157;2608,944;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  4372. Node;AmplifyShaderEditor.RegisterLocalVarNode;158;2768,944;Inherit;True;NoiseColorMix;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4373. Node;AmplifyShaderEditor.GetLocalVarNode;154;2336,720;Inherit;True;151;NoiseColor3D;1;0;OBJECT;;False;1;FLOAT;0
  4374. Node;AmplifyShaderEditor.GetLocalVarNode;155;2304,912;Inherit;True;152;NoiseColorVoronoi;1;0;OBJECT;;False;1;FLOAT;0
  4375. Node;AmplifyShaderEditor.OneMinusNode;127;3232,1776;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  4376. Node;AmplifyShaderEditor.RegisterLocalVarNode;128;3408,1776;Inherit;False;NoiseColor;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4377. Node;AmplifyShaderEditor.RegisterLocalVarNode;151;2544,1680;Inherit;False;NoiseColor3D;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4378. Node;AmplifyShaderEditor.RegisterLocalVarNode;152;2544,2224;Inherit;False;NoiseColorVoronoi;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  4379. Node;AmplifyShaderEditor.OneMinusNode;114;2272,1952;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
  4380. Node;AmplifyShaderEditor.GetLocalVarNode;53;2832,-832;Inherit;False;305;VertexOffset;1;0;OBJECT;;False;1;FLOAT3;0
  4381. Node;AmplifyShaderEditor.RangedFloatNode;156;2272,1104;Inherit;False;Property;_NoiseColorMix;NoiseColorMix;22;0;Create;True;0;0;0;False;0;False;0.96;0.947578;0;1;0;1;FLOAT;0
  4382. Node;AmplifyShaderEditor.FunctionNode;67;1904,-1232;Inherit;False;Lerp White To;-1;;156;047d7c189c36a62438973bad9d37b1c2;0;2;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
  4383. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;61;2112,-1328;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;COLOR;0
  4384. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;141;2304,-1296;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT3;1,1,1;False;1;COLOR;0
  4385. Node;AmplifyShaderEditor.FunctionNode;149;2112,-1216;Inherit;False;Lerp White To;-1;;157;047d7c189c36a62438973bad9d37b1c2;0;2;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
  4386. Node;AmplifyShaderEditor.GetLocalVarNode;140;1872,-1120;Inherit;False;43;DepthFade;1;0;OBJECT;;False;1;FLOAT;0
  4387. Node;AmplifyShaderEditor.FunctionNode;21;2000,80;Inherit;False;Lerp White To;-1;;158;047d7c189c36a62438973bad9d37b1c2;0;2;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
  4388. Node;AmplifyShaderEditor.GetLocalVarNode;19;1760,32;Inherit;False;158;NoiseColorMix;1;0;OBJECT;;False;1;FLOAT;0
  4389. Node;AmplifyShaderEditor.RangedFloatNode;20;1696,112;Inherit;False;Property;_NoiseColorStrength;Noise Color Strength;9;0;Create;True;0;0;0;False;0;False;0.5565214;0.7018638;0;1;0;1;FLOAT;0
  4390. Node;AmplifyShaderEditor.RangedFloatNode;56;2032,-576;Inherit;False;Constant;_Float0;Float 0;3;0;Create;True;0;0;0;False;0;False;0.5;0;0;0;0;1;FLOAT;0
  4391. Node;AmplifyShaderEditor.RangedFloatNode;66;1552,-1152;Inherit;False;Property;_EmmissiveNoiseColor;Emmissive Noise Color;10;0;Create;True;0;0;0;False;0;False;0.2000003;0.2000003;0;1;0;1;FLOAT;0
  4392. Node;AmplifyShaderEditor.RangedFloatNode;150;1776,-1040;Inherit;False;Property;_EmmissiveDepthFade;Emmissive Depth Fade;21;0;Create;True;0;0;0;False;0;False;0.2086951;0.2086951;0;1;0;1;FLOAT;0
  4393. Node;AmplifyShaderEditor.ColorNode;60;1872,-1440;Inherit;False;Property;_EmmissiveColor;Emmissive Color;2;0;Create;True;0;0;0;False;0;False;0.5490196,0.627451,0.7294118,0;0.5482876,0.6286016,0.7283019,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
  4394. Node;AmplifyShaderEditor.ColorNode;58;2192,-528;Inherit;False;Property;_TranslucencyColor;Translucency Color;1;0;Create;True;0;0;0;False;0;False;1,1,1,0;1,1,1,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
  4395. Node;AmplifyShaderEditor.RangedFloatNode;131;2880,-1104;Inherit;False;Constant;_MetalSmoothness;MetalSmoothness;14;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
  4396. Node;AmplifyShaderEditor.RangedFloatNode;132;2832,-928;Inherit;False;Constant;_AlphaClip;Alpha Clip;18;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
  4397. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;165;2880,-1024;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  4398. Node;AmplifyShaderEditor.GetLocalVarNode;32;2912,-1184;Inherit;False;30;Albedo;1;0;OBJECT;;False;1;COLOR;0
  4399. Node;AmplifyShaderEditor.GetLocalVarNode;62;1616,-1232;Inherit;False;158;NoiseColorMix;1;0;OBJECT;;False;1;FLOAT;0
  4400. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;1472,48;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;;0;0;Standard;0;False;0
  4401. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;3;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;;0;0;Standard;0;False;0
  4402. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;4;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;True;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;;0;0;Standard;0;False;0
  4403. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;5;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;;0;0;Standard;0;False;0
  4404. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;6;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;2;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=Universal2D;False;False;0;;0;0;Standard;0;False;0
  4405. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;7;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;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;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;False;0;;0;0;Standard;0;False;0
  4406. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;8;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;2;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;10;False;;10;False;;10;False;;6;False;;3;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalGBuffer;False;False;0;;0;0;Standard;0;False;0
  4407. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;9;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;False;0;;0;0;Standard;0;False;0
  4408. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;10;48,-176;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;False;0;;0;0;Standard;0;False;0
  4409. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;2;3088,-1184;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;SkyClouds;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;21;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;2;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;True;True;False;10;False;;10;False;;10;False;;6;False;;3;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalForwardOnly;False;False;0;;0;0;Standard;42;Lighting Model;0;0;Workflow;1;638545903288036264;Surface;1;638546043907316520; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Forward Only;1;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;1;638555967056712408; Translucency Strength;1,False,_TransStrength;0; Normal Distortion;0.5,False,_NormalDistortion;0; Scattering;2,False,_Scattering;0; Direct;0.9,False,_Direct;0; Ambient;0.1,False,_Ambient;0; Shadow;0.5,False,_Shadow;0;Cast Shadows;0;638545778176623389; Use Shadow Threshold;0;0;Receive Shadows;1;0;Receive SSAO;0;638545838208863654;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;Tessellation;1;638546589066032097; Phong;1;638545776167988407; Strength;0.5,False,;0; Type;2;638572589216977204; Tess;8,False,_TessellationFactor;638555223982842409; Min;1,False,_TessellationMinDistance;638549165261763217; Max;20,False,_TessellationMaxDistance;638549165187283418; Edge Length;7,False,;638546587549290024; Max Displacement;10,False,;638546587107747633;Write Depth;1;638545930608142192; Early Z;0;638546026961079552;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;False;True;True;True;True;False;True;True;False;;False;0
  4410. WireConnection;328;0;316;0
  4411. WireConnection;317;0;328;0
  4412. WireConnection;332;0;326;0
  4413. WireConnection;334;0;332;0
  4414. WireConnection;335;0;332;1
  4415. WireConnection;336;0;332;2
  4416. WireConnection;333;0;334;0
  4417. WireConnection;333;1;335;0
  4418. WireConnection;333;2;336;0
  4419. WireConnection;337;0;332;0
  4420. WireConnection;337;1;333;0
  4421. WireConnection;338;0;332;1
  4422. WireConnection;338;1;333;0
  4423. WireConnection;339;0;332;2
  4424. WireConnection;339;1;333;0
  4425. WireConnection;340;0;337;0
  4426. WireConnection;340;1;338;0
  4427. WireConnection;340;2;339;0
  4428. WireConnection;70;0;69;0
  4429. WireConnection;80;0;73;0
  4430. WireConnection;80;1;81;0
  4431. WireConnection;80;2;319;0
  4432. WireConnection;91;0;90;0
  4433. WireConnection;323;0;325;0
  4434. WireConnection;323;1;82;0
  4435. WireConnection;341;0;340;0
  4436. WireConnection;71;0;70;0
  4437. WireConnection;83;0;80;0
  4438. WireConnection;83;1;323;0
  4439. WireConnection;92;0;91;0
  4440. WireConnection;367;0;227;0
  4441. WireConnection;93;0;92;0
  4442. WireConnection;79;0;71;0
  4443. WireConnection;79;2;83;0
  4444. WireConnection;228;0;367;0
  4445. WireConnection;94;0;93;0
  4446. WireConnection;84;0;79;0
  4447. WireConnection;343;0;342;0
  4448. WireConnection;86;0;84;2
  4449. WireConnection;86;1;84;0
  4450. WireConnection;85;0;84;2
  4451. WireConnection;85;1;84;1
  4452. WireConnection;95;0;93;0
  4453. WireConnection;95;1;94;0
  4454. WireConnection;74;0;72;0
  4455. WireConnection;74;1;73;0
  4456. WireConnection;74;2;319;0
  4457. WireConnection;198;0;197;0
  4458. WireConnection;198;1;88;0
  4459. WireConnection;322;0;320;0
  4460. WireConnection;322;1;76;0
  4461. WireConnection;331;0;143;2
  4462. WireConnection;331;1;143;3
  4463. WireConnection;331;2;143;1
  4464. WireConnection;329;0;143;1
  4465. WireConnection;329;1;143;2
  4466. WireConnection;329;2;143;3
  4467. WireConnection;330;0;143;2
  4468. WireConnection;330;1;143;1
  4469. WireConnection;330;2;143;3
  4470. WireConnection;344;0;343;0
  4471. WireConnection;87;0;84;0
  4472. WireConnection;87;1;84;1
  4473. WireConnection;104;0;95;0
  4474. WireConnection;97;0;85;0
  4475. WireConnection;97;2;198;0
  4476. WireConnection;96;0;86;0
  4477. WireConnection;96;2;198;0
  4478. WireConnection;77;0;322;0
  4479. WireConnection;77;1;74;0
  4480. WireConnection;347;0;331;0
  4481. WireConnection;347;1;344;2
  4482. WireConnection;346;0;330;0
  4483. WireConnection;346;1;344;1
  4484. WireConnection;345;0;329;0
  4485. WireConnection;345;1;344;0
  4486. WireConnection;107;0;97;0
  4487. WireConnection;107;1;104;0
  4488. WireConnection;108;0;96;0
  4489. WireConnection;108;1;104;1
  4490. WireConnection;89;0;87;0
  4491. WireConnection;89;2;198;0
  4492. WireConnection;78;0;71;0
  4493. WireConnection;78;2;77;0
  4494. WireConnection;348;0;345;0
  4495. WireConnection;348;1;346;0
  4496. WireConnection;348;2;347;0
  4497. WireConnection;110;0;107;0
  4498. WireConnection;110;1;108;0
  4499. WireConnection;109;0;89;0
  4500. WireConnection;109;1;104;2
  4501. WireConnection;145;0;348;0
  4502. WireConnection;145;1;78;0
  4503. WireConnection;111;0;110;0
  4504. WireConnection;111;1;109;0
  4505. WireConnection;196;0;195;0
  4506. WireConnection;196;1;145;0
  4507. WireConnection;112;0;196;0
  4508. WireConnection;112;1;113;0
  4509. WireConnection;192;0;111;0
  4510. WireConnection;117;0;112;0
  4511. WireConnection;191;0;192;0
  4512. WireConnection;190;0;191;0
  4513. WireConnection;118;0;117;0
  4514. WireConnection;120;0;118;0
  4515. WireConnection;120;1;119;0
  4516. WireConnection;115;0;190;0
  4517. WireConnection;115;1;116;0
  4518. WireConnection;121;0;120;0
  4519. WireConnection;121;1;115;0
  4520. WireConnection;122;0;121;0
  4521. WireConnection;181;0;122;0
  4522. WireConnection;232;0;125;0
  4523. WireConnection;232;1;229;0
  4524. WireConnection;296;2;294;0
  4525. WireConnection;123;0;181;0
  4526. WireConnection;123;1;124;0
  4527. WireConnection;123;2;232;0
  4528. WireConnection;313;0;296;6
  4529. WireConnection;184;0;123;0
  4530. WireConnection;184;1;183;0
  4531. WireConnection;312;0;311;0
  4532. WireConnection;312;1;313;0
  4533. WireConnection;239;0;184;0
  4534. WireConnection;239;1;238;0
  4535. WireConnection;306;0;296;0
  4536. WireConnection;307;0;312;0
  4537. WireConnection;297;0;239;0
  4538. WireConnection;297;1;306;0
  4539. WireConnection;314;0;307;0
  4540. WireConnection;298;0;297;0
  4541. WireConnection;298;1;314;0
  4542. WireConnection;301;0;298;0
  4543. WireConnection;353;2;351;0
  4544. WireConnection;303;0;301;0
  4545. WireConnection;303;1;299;0
  4546. WireConnection;354;0;353;6
  4547. WireConnection;304;0;184;0
  4548. WireConnection;304;1;303;0
  4549. WireConnection;356;0;355;0
  4550. WireConnection;356;1;354;0
  4551. WireConnection;366;0;304;0
  4552. WireConnection;366;1;349;0
  4553. WireConnection;357;0;353;0
  4554. WireConnection;358;0;356;0
  4555. WireConnection;359;0;366;0
  4556. WireConnection;359;1;357;0
  4557. WireConnection;360;0;358;0
  4558. WireConnection;361;0;359;0
  4559. WireConnection;361;1;360;0
  4560. WireConnection;362;0;361;0
  4561. WireConnection;364;0;362;0
  4562. WireConnection;364;1;363;0
  4563. WireConnection;365;0;304;0
  4564. WireConnection;365;1;364;0
  4565. WireConnection;305;0;365;0
  4566. WireConnection;35;0;33;0
  4567. WireConnection;35;1;34;0
  4568. WireConnection;38;1;35;0
  4569. WireConnection;38;0;36;0
  4570. WireConnection;161;0;13;0
  4571. WireConnection;161;1;16;0
  4572. WireConnection;161;2;160;0
  4573. WireConnection;135;1;38;0
  4574. WireConnection;163;2;161;0
  4575. WireConnection;43;0;135;0
  4576. WireConnection;162;0;163;6
  4577. WireConnection;29;0;28;0
  4578. WireConnection;28;0;147;0
  4579. WireConnection;28;1;161;0
  4580. WireConnection;55;0;54;0
  4581. WireConnection;55;1;56;0
  4582. WireConnection;57;0;55;0
  4583. WireConnection;57;1;58;0
  4584. WireConnection;136;0;57;0
  4585. WireConnection;136;1;137;0
  4586. WireConnection;30;0;29;0
  4587. WireConnection;147;0;146;0
  4588. WireConnection;147;1;21;0
  4589. WireConnection;157;0;154;0
  4590. WireConnection;157;1;155;0
  4591. WireConnection;157;2;156;0
  4592. WireConnection;158;0;157;0
  4593. WireConnection;127;0;122;0
  4594. WireConnection;128;0;127;0
  4595. WireConnection;151;0;118;0
  4596. WireConnection;152;0;190;0
  4597. WireConnection;114;0;190;0
  4598. WireConnection;67;1;62;0
  4599. WireConnection;67;2;66;0
  4600. WireConnection;61;0;60;0
  4601. WireConnection;61;1;67;0
  4602. WireConnection;141;0;61;0
  4603. WireConnection;141;1;149;0
  4604. WireConnection;149;1;140;0
  4605. WireConnection;149;2;150;0
  4606. WireConnection;21;1;19;0
  4607. WireConnection;21;2;20;0
  4608. WireConnection;165;0;133;0
  4609. WireConnection;165;1;164;0
  4610. WireConnection;2;0;32;0
  4611. WireConnection;2;2;141;0
  4612. WireConnection;2;3;131;0
  4613. WireConnection;2;4;131;0
  4614. WireConnection;2;6;165;0
  4615. WireConnection;2;7;132;0
  4616. WireConnection;2;15;136;0
  4617. WireConnection;2;8;53;0
  4618. ASEEND*/
  4619. //CHKSM=CDD0477C42993796CC3816BEA033745C0843B0AC