Detailed Map Coverage Snow.shader 232 KB

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