SkyClouds_MobileNoTessellation.shader 215 KB

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