Water.shader 170 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014
  1. // Made with Amplify Shader Editor v1.9.7.1
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "Tobyfredson/Water"
  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) Water______________________)][Header(_____________________________________________________)][Header(Refraction Map)][NoScaleOffset][Normal]_NormalMap("Normal Map", 2D) = "bump" {}
  10. [Header(Animated Tiling)]_UV2TilingXYScaleZW("UV2 Tiling (XY) Scale (ZW)", Vector) = (1,1,1,1)
  11. _AnimateUV1XYUV2ZW("Animate UV1 (XY) UV2 (ZW)", Vector) = (0,0,0,0)
  12. [Header(Texture Settings)]_MainColor("Main Color", Color) = (0.7279412,0.7011786,0.7011786,0)
  13. _Smoothness("Smoothness", Range( 0 , 1)) = 1
  14. _EnergyConservation("Energy Conservation", Range( 0 , 1)) = 0
  15. _FresnelPower("Fresnel Power", Range( 0 , 5)) = 1
  16. [Header(Refraction Settings)]_LerpStrength("Lerp Strength ", Range( 0 , 1)) = 0.5
  17. _NS1("NS 1", Float) = 0
  18. _NS2("NS 2", Float) = 0
  19. [Header(Reflection Settings)]_ReflectionIntensity("Reflection Intensity", Range( 0 , 1)) = 0
  20. _ReflectionNormalScale("Reflection Normal Scale", Float) = 0
  21. [Toggle]_AccurateNormalReflection("Accurate Normal Reflection", Float) = 1
  22. [Toggle(_REFLECTIONONOFF_ON)] _ReflectionOnOff("Reflection On/Off", Float) = 1
  23. [Header(Foam Map)][NoScaleOffset]_Foam("Foam", 2D) = "white" {}
  24. _FoamTiling("Foam Tiling", Vector) = (1,1,0,0)
  25. _FoamIntensity("Foam Intensity", Range( 0 , 1)) = 1
  26. _FoamDepth("Foam Depth", Float) = 0
  27. _FoamFalloff("Foam Falloff", Float) = 0
  28. _Edgedistance("Edge distance", Float) = 1
  29. _DephFadeDistance("Deph Fade Distance", Float) = 0
  30. [Header(Waterfall Foam)][NoScaleOffset]_WaterfallFoam("Waterfall Foam", 2D) = "white" {}
  31. [Header(Waterfall Foam)][NoScaleOffset]_WaterfallFoam2("Waterfall Foam 2", 2D) = "white" {}
  32. [Toggle]_WaterfallFoamOnOff("Waterfall Foam On/Off", Float) = 0
  33. _WaterfallColor("Waterfall Color", Color) = (1,1,1,0)
  34. _WaterfallColor2("Waterfall Color 2", Color) = (1,1,1,0)
  35. _WaterfallTiling("Waterfall Tiling", Vector) = (1,1,0,0)
  36. _WaterfallSpeed("Waterfall Speed", Vector) = (0,1,0,0)
  37. //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5
  38. //_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1
  39. //_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5
  40. //_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2
  41. //_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9
  42. //_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1
  43. //_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5
  44. //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
  45. //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
  46. //_TessMin( "Tess Min Distance", Float ) = 10
  47. //_TessMax( "Tess Max Distance", Float ) = 25
  48. //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
  49. //_TessMaxDisp( "Tess Max Displacement", Float ) = 25
  50. [HideInInspector][ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1
  51. [HideInInspector][ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1
  52. [HideInInspector][ToggleOff] _ReceiveShadows("Receive Shadows", Float) = 1.0
  53. [HideInInspector] _QueueOffset("_QueueOffset", Float) = 0
  54. [HideInInspector] _QueueControl("_QueueControl", Float) = -1
  55. [HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
  56. [HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
  57. [HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
  58. //[HideInInspector][ToggleUI] _AddPrecomputedVelocity("Add Precomputed Velocity", Float) = 1
  59. }
  60. SubShader
  61. {
  62. LOD 0
  63. Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" "UniversalMaterialType"="Lit" }
  64. Cull Back
  65. ZWrite Off
  66. ZTest LEqual
  67. Offset 0 , 0
  68. AlphaToMask Off
  69. HLSLINCLUDE
  70. #pragma target 4.5
  71. #pragma prefer_hlslcc gles
  72. // ensure rendering platforms toggle list is visible
  73. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
  74. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
  75. #ifndef ASE_TESS_FUNCS
  76. #define ASE_TESS_FUNCS
  77. float4 FixedTess( float tessValue )
  78. {
  79. return tessValue;
  80. }
  81. float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
  82. {
  83. float3 wpos = mul(o2w,vertex).xyz;
  84. float dist = distance (wpos, cameraPos);
  85. float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
  86. return f;
  87. }
  88. float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
  89. {
  90. float4 tess;
  91. tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
  92. tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
  93. tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
  94. tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
  95. return tess;
  96. }
  97. float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
  98. {
  99. float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
  100. float len = distance(wpos0, wpos1);
  101. float f = max(len * scParams.y / (edgeLen * dist), 1.0);
  102. return f;
  103. }
  104. float DistanceFromPlane (float3 pos, float4 plane)
  105. {
  106. float d = dot (float4(pos,1.0f), plane);
  107. return d;
  108. }
  109. bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
  110. {
  111. float4 planeTest;
  112. planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  113. (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  114. (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
  115. planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  116. (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  117. (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
  118. planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  119. (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  120. (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
  121. planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  122. (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  123. (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
  124. return !all (planeTest);
  125. }
  126. float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
  127. {
  128. float3 f;
  129. f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
  130. f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
  131. f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
  132. return CalcTriEdgeTessFactors (f);
  133. }
  134. float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
  135. {
  136. float3 pos0 = mul(o2w,v0).xyz;
  137. float3 pos1 = mul(o2w,v1).xyz;
  138. float3 pos2 = mul(o2w,v2).xyz;
  139. float4 tess;
  140. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  141. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  142. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  143. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  144. return tess;
  145. }
  146. float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
  147. {
  148. float3 pos0 = mul(o2w,v0).xyz;
  149. float3 pos1 = mul(o2w,v1).xyz;
  150. float3 pos2 = mul(o2w,v2).xyz;
  151. float4 tess;
  152. if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
  153. {
  154. tess = 0.0f;
  155. }
  156. else
  157. {
  158. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  159. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  160. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  161. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  162. }
  163. return tess;
  164. }
  165. #endif //ASE_TESS_FUNCS
  166. ENDHLSL
  167. Pass
  168. {
  169. Name "Forward"
  170. Tags { "LightMode"="UniversalForward" }
  171. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  172. ZWrite On
  173. ZTest LEqual
  174. Offset 0 , 0
  175. ColorMask RGBA
  176. HLSLPROGRAM
  177. #pragma multi_compile_local_fragment _ALPHATEST_ON
  178. #define _NORMAL_DROPOFF_TS 1
  179. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  180. #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
  181. #pragma multi_compile_instancing
  182. #pragma instancing_options renderinglayer
  183. #pragma multi_compile_fog
  184. #define ASE_FOG 1
  185. #define _SURFACE_TYPE_TRANSPARENT 1
  186. #define _NORMALMAP 1
  187. #define ASE_VERSION 19701
  188. #define ASE_SRP_VERSION 170003
  189. #define REQUIRE_DEPTH_TEXTURE 1
  190. #define REQUIRE_OPAQUE_TEXTURE 1
  191. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
  192. #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
  193. #pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
  194. #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
  195. #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
  196. #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
  197. #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
  198. #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  199. #pragma multi_compile _ _LIGHT_LAYERS
  200. #pragma multi_compile_fragment _ _LIGHT_COOKIES
  201. #pragma multi_compile _ _FORWARD_PLUS
  202. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  203. #pragma multi_compile _ SHADOWS_SHADOWMASK
  204. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  205. #pragma multi_compile _ LIGHTMAP_ON
  206. #pragma multi_compile _ DYNAMICLIGHTMAP_ON
  207. #pragma multi_compile _ USE_LEGACY_LIGHTMAPS
  208. #pragma multi_compile_fragment _ DEBUG_DISPLAY
  209. #pragma vertex vert
  210. #pragma fragment frag
  211. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  212. #define _SPECULAR_COLOR 1
  213. #endif
  214. #define SHADERPASS SHADERPASS_FORWARD
  215. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  216. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
  217. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
  218. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  219. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  220. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  221. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  222. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  223. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  224. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  225. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  226. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  227. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
  228. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  229. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  230. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  231. #if defined(LOD_FADE_CROSSFADE)
  232. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  233. #endif
  234. #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
  235. #define ENABLE_TERRAIN_PERPIXEL_NORMAL
  236. #endif
  237. #define ASE_NEEDS_FRAG_SCREEN_POSITION
  238. #define ASE_NEEDS_FRAG_WORLD_POSITION
  239. #define ASE_NEEDS_VERT_POSITION
  240. #pragma shader_feature_local _REFLECTIONONOFF_ON
  241. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  242. #define ASE_SV_DEPTH SV_DepthLessEqual
  243. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  244. #else
  245. #define ASE_SV_DEPTH SV_Depth
  246. #define ASE_SV_POSITION_QUALIFIERS
  247. #endif
  248. struct Attributes
  249. {
  250. float4 positionOS : POSITION;
  251. float3 normalOS : NORMAL;
  252. float4 tangentOS : TANGENT;
  253. float4 texcoord : TEXCOORD0;
  254. float4 texcoord1 : TEXCOORD1;
  255. float4 texcoord2 : TEXCOORD2;
  256. UNITY_VERTEX_INPUT_INSTANCE_ID
  257. };
  258. struct PackedVaryings
  259. {
  260. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  261. float4 clipPosV : TEXCOORD0;
  262. float4 lightmapUVOrVertexSH : TEXCOORD1;
  263. half4 fogFactorAndVertexLight : TEXCOORD2;
  264. float4 tSpace0 : TEXCOORD3;
  265. float4 tSpace1 : TEXCOORD4;
  266. float4 tSpace2 : TEXCOORD5;
  267. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  268. float4 shadowCoord : TEXCOORD6;
  269. #endif
  270. #if defined(DYNAMICLIGHTMAP_ON)
  271. float2 dynamicLightmapUV : TEXCOORD7;
  272. #endif
  273. #if defined(USE_APV_PROBE_OCCLUSION)
  274. float4 probeOcclusion : TEXCOORD8;
  275. #endif
  276. float4 ase_texcoord9 : TEXCOORD9;
  277. float3 ase_normal : NORMAL;
  278. float4 ase_texcoord10 : TEXCOORD10;
  279. UNITY_VERTEX_INPUT_INSTANCE_ID
  280. UNITY_VERTEX_OUTPUT_STEREO
  281. };
  282. CBUFFER_START(UnityPerMaterial)
  283. float4 _WaterfallColor2;
  284. float4 _WaterfallColor;
  285. float4 _AnimateUV1XYUV2ZW;
  286. float4 _UV2TilingXYScaleZW;
  287. float4 _MainColor;
  288. float2 _WaterfallTiling;
  289. float2 _WaterfallSpeed;
  290. float2 _FoamTiling;
  291. float _WaterfallFoamOnOff;
  292. float _ReflectionIntensity;
  293. float _ReflectionNormalScale;
  294. float _AccurateNormalReflection;
  295. float _FresnelPower;
  296. float _LerpStrength;
  297. float _NS2;
  298. float _DephFadeDistance;
  299. float _NS1;
  300. float _FoamIntensity;
  301. float _FoamFalloff;
  302. float _FoamDepth;
  303. float _Edgedistance;
  304. float _EnergyConservation;
  305. float _Smoothness;
  306. #ifdef ASE_TRANSMISSION
  307. float _TransmissionShadow;
  308. #endif
  309. #ifdef ASE_TRANSLUCENCY
  310. float _TransStrength;
  311. float _TransNormal;
  312. float _TransScattering;
  313. float _TransDirect;
  314. float _TransAmbient;
  315. float _TransShadow;
  316. #endif
  317. #ifdef ASE_TESSELLATION
  318. float _TessPhongStrength;
  319. float _TessValue;
  320. float _TessMin;
  321. float _TessMax;
  322. float _TessEdgeLength;
  323. float _TessMaxDisp;
  324. #endif
  325. CBUFFER_END
  326. #ifdef SCENEPICKINGPASS
  327. float4 _SelectionID;
  328. #endif
  329. #ifdef SCENESELECTIONPASS
  330. int _ObjectId;
  331. int _PassValue;
  332. #endif
  333. sampler2D _Foam;
  334. sampler2D _NormalMap;
  335. sampler2D _ReflectionTex;
  336. sampler2D _WaterfallFoam;
  337. sampler2D _WaterfallFoam2;
  338. PackedVaryings VertexFunction( Attributes input )
  339. {
  340. PackedVaryings output = (PackedVaryings)0;
  341. UNITY_SETUP_INSTANCE_ID(input);
  342. UNITY_TRANSFER_INSTANCE_ID(input, output);
  343. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  344. float3 objectToViewPos = TransformWorldToView(TransformObjectToWorld(input.positionOS.xyz));
  345. float eyeDepth = -objectToViewPos.z;
  346. output.ase_texcoord9.x = eyeDepth;
  347. output.ase_normal = input.normalOS;
  348. output.ase_texcoord10 = input.positionOS;
  349. //setting value to unused interpolator channels and avoid initialization warnings
  350. output.ase_texcoord9.yzw = 0;
  351. #ifdef ASE_ABSOLUTE_VERTEX_POS
  352. float3 defaultVertexValue = input.positionOS.xyz;
  353. #else
  354. float3 defaultVertexValue = float3(0, 0, 0);
  355. #endif
  356. float3 vertexValue = defaultVertexValue;
  357. #ifdef ASE_ABSOLUTE_VERTEX_POS
  358. input.positionOS.xyz = vertexValue;
  359. #else
  360. input.positionOS.xyz += vertexValue;
  361. #endif
  362. input.normalOS = input.normalOS;
  363. input.tangentOS = input.tangentOS;
  364. VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
  365. VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS );
  366. output.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x );
  367. output.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y );
  368. output.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z );
  369. #if defined(LIGHTMAP_ON)
  370. OUTPUT_LIGHTMAP_UV( input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy );
  371. #endif
  372. #if defined(DYNAMICLIGHTMAP_ON)
  373. output.dynamicLightmapUV.xy = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
  374. #endif
  375. OUTPUT_SH4( vertexInput.positionWS, normalInput.normalWS.xyz, GetWorldSpaceNormalizeViewDir( vertexInput.positionWS ), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion );
  376. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  377. output.lightmapUVOrVertexSH.zw = input.texcoord.xy;
  378. output.lightmapUVOrVertexSH.xy = input.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
  379. #endif
  380. half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
  381. #ifdef ASE_FOG
  382. half fogFactor = ComputeFogFactor( vertexInput.positionCS.z );
  383. #else
  384. half fogFactor = 0;
  385. #endif
  386. output.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
  387. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  388. output.shadowCoord = GetShadowCoord( vertexInput );
  389. #endif
  390. output.positionCS = vertexInput.positionCS;
  391. output.clipPosV = vertexInput.positionCS;
  392. return output;
  393. }
  394. #if defined(ASE_TESSELLATION)
  395. struct VertexControl
  396. {
  397. float4 vertex : INTERNALTESSPOS;
  398. float3 normalOS : NORMAL;
  399. float4 tangentOS : TANGENT;
  400. float4 texcoord : TEXCOORD0;
  401. float4 texcoord1 : TEXCOORD1;
  402. float4 texcoord2 : TEXCOORD2;
  403. UNITY_VERTEX_INPUT_INSTANCE_ID
  404. };
  405. struct TessellationFactors
  406. {
  407. float edge[3] : SV_TessFactor;
  408. float inside : SV_InsideTessFactor;
  409. };
  410. VertexControl vert ( Attributes input )
  411. {
  412. VertexControl output;
  413. UNITY_SETUP_INSTANCE_ID(input);
  414. UNITY_TRANSFER_INSTANCE_ID(input, output);
  415. output.vertex = input.positionOS;
  416. output.normalOS = input.normalOS;
  417. output.tangentOS = input.tangentOS;
  418. output.texcoord = input.texcoord;
  419. output.texcoord1 = input.texcoord1;
  420. output.texcoord2 = input.texcoord2;
  421. return output;
  422. }
  423. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  424. {
  425. TessellationFactors output;
  426. float4 tf = 1;
  427. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  428. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  429. #if defined(ASE_FIXED_TESSELLATION)
  430. tf = FixedTess( tessValue );
  431. #elif defined(ASE_DISTANCE_TESSELLATION)
  432. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  433. #elif defined(ASE_LENGTH_TESSELLATION)
  434. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  435. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  436. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  437. #endif
  438. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  439. return output;
  440. }
  441. [domain("tri")]
  442. [partitioning("fractional_odd")]
  443. [outputtopology("triangle_cw")]
  444. [patchconstantfunc("TessellationFunction")]
  445. [outputcontrolpoints(3)]
  446. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  447. {
  448. return patch[id];
  449. }
  450. [domain("tri")]
  451. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  452. {
  453. Attributes output = (Attributes) 0;
  454. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  455. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  456. output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
  457. output.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
  458. output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
  459. output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
  460. #if defined(ASE_PHONG_TESSELLATION)
  461. float3 pp[3];
  462. for (int i = 0; i < 3; ++i)
  463. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  464. float phongStrength = _TessPhongStrength;
  465. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  466. #endif
  467. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  468. return VertexFunction(output);
  469. }
  470. #else
  471. PackedVaryings vert ( Attributes input )
  472. {
  473. return VertexFunction( input );
  474. }
  475. #endif
  476. half4 frag ( PackedVaryings input
  477. #ifdef ASE_DEPTH_WRITE_ON
  478. ,out float outputDepth : ASE_SV_DEPTH
  479. #endif
  480. #ifdef _WRITE_RENDERING_LAYERS
  481. , out float4 outRenderingLayers : SV_Target1
  482. #endif
  483. ) : SV_Target
  484. {
  485. UNITY_SETUP_INSTANCE_ID(input);
  486. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  487. #if defined(LOD_FADE_CROSSFADE)
  488. LODFadeCrossFade( input.positionCS );
  489. #endif
  490. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  491. float2 sampleCoords = (input.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
  492. float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
  493. float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
  494. float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
  495. #else
  496. float3 WorldNormal = normalize( input.tSpace0.xyz );
  497. float3 WorldTangent = input.tSpace1.xyz;
  498. float3 WorldBiTangent = input.tSpace2.xyz;
  499. #endif
  500. float3 WorldPosition = float3(input.tSpace0.w,input.tSpace1.w,input.tSpace2.w);
  501. float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
  502. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  503. float4 ClipPos = input.clipPosV;
  504. float4 ScreenPos = ComputeScreenPos( input.clipPosV );
  505. float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
  506. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  507. ShadowCoords = input.shadowCoord;
  508. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  509. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  510. #endif
  511. WorldViewDirection = SafeNormalize( WorldViewDirection );
  512. float4 ase_screenPosNorm = ScreenPos / ScreenPos.w;
  513. ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
  514. float screenDepth127 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  515. float distanceDepth127 = abs( ( screenDepth127 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _Edgedistance ) );
  516. float temp_output_128_0 = ( 1.0 - distanceDepth127 );
  517. float2 appendResult205 = (float2(( _FoamTiling.x * WorldPosition.x ) , ( _FoamTiling.y * WorldPosition.z )));
  518. float2 panner152 = ( 1.0 * _Time.y * float2( -0.01,0.01 ) + appendResult205);
  519. float clampResult132 = clamp( ( ( temp_output_128_0 * 1.0 ) * ( saturate( pow( abs( ( temp_output_128_0 + _FoamDepth ) ) , _FoamFalloff ) ) * tex2D( _Foam, panner152 ).r * _FoamIntensity ) ) , 0.0 , 1.0 );
  520. float Edge131 = clampResult132;
  521. float2 appendResult7 = (float2(ase_screenPosNorm.x , ase_screenPosNorm.y));
  522. float2 temp_output_24_0 = (WorldPosition).xz;
  523. float2 appendResult31 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.x ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.y )));
  524. float4 _UV1TilingXYScaleZW = float4(1,1,1,1);
  525. float2 appendResult36 = (float2(_UV1TilingXYScaleZW.x , _UV1TilingXYScaleZW.y));
  526. float2 appendResult38 = (float2(_UV1TilingXYScaleZW.z , _UV1TilingXYScaleZW.w));
  527. float2 UV140 = ( ( ( temp_output_24_0 + appendResult31 ) * appendResult36 ) / appendResult38 );
  528. float screenDepth78 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  529. float distanceDepth78 = saturate( abs( ( screenDepth78 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DephFadeDistance ) ) );
  530. float DephFade79 = distanceDepth78;
  531. float3 unpack2 = UnpackNormalScale( tex2D( _NormalMap, UV140 ), ( _NS1 * DephFade79 ) );
  532. unpack2.z = lerp( 1, unpack2.z, saturate(( _NS1 * DephFade79 )) );
  533. float2 appendResult43 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.z ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.w )));
  534. float2 appendResult49 = (float2(_UV2TilingXYScaleZW.x , _UV2TilingXYScaleZW.y));
  535. float2 appendResult50 = (float2(_UV2TilingXYScaleZW.z , _UV2TilingXYScaleZW.w));
  536. float2 UV247 = ( ( ( temp_output_24_0 + appendResult43 ) * appendResult49 ) / appendResult50 );
  537. float3 unpack4 = UnpackNormalScale( tex2D( _NormalMap, UV247 ), ( _NS2 * DephFade79 ) );
  538. unpack4.z = lerp( 1, unpack4.z, saturate(( _NS2 * DephFade79 )) );
  539. float3 lerpResult8 = lerp( unpack2 , unpack4 , _LerpStrength);
  540. float3 Normalmap12 = lerpResult8;
  541. float2 ScreenUV20 = ( appendResult7 - ( (Normalmap12).xy * 0.1 ) );
  542. float eyeDepth220 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( float4( ScreenUV20, 0.0 , 0.0 ).xy ),_ZBufferParams);
  543. float eyeDepth = input.ase_texcoord9.x;
  544. float ifLocalVar224 = 0;
  545. if( eyeDepth220 > eyeDepth )
  546. ifLocalVar224 = 1.0;
  547. else if( eyeDepth220 < eyeDepth )
  548. ifLocalVar224 = 0.0;
  549. float4 fetchOpaqueVal1 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( ScreenUV20 * ifLocalVar224 ) ), 1.0 );
  550. float3 ase_viewVectorWS = ( _WorldSpaceCameraPos.xyz - WorldPosition );
  551. float3 ase_viewDirWS = normalize( ase_viewVectorWS );
  552. float dotResult62 = dot( ase_viewDirWS , input.ase_normal );
  553. float Fresnel68 = pow( abs( ( 1.0 - saturate( abs( dotResult62 ) ) ) ) , _FresnelPower );
  554. float4 lerpResult55 = lerp( fetchOpaqueVal1 , _MainColor , ( Fresnel68 * DephFade79 ));
  555. float4 temp_output_134_0 = ( Edge131 + lerpResult55 );
  556. float4 unityObjectToClipPos185 = TransformWorldToHClip(TransformObjectToWorld(( input.ase_texcoord10.xyz + float3( 0,0,0 ) )));
  557. float4 computeScreenPos189 = ComputeScreenPos( unityObjectToClipPos185 );
  558. computeScreenPos189 = computeScreenPos189 / computeScreenPos189.w;
  559. computeScreenPos189.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? computeScreenPos189.z : computeScreenPos189.z* 0.5 + 0.5;
  560. float ReflectionNormalWarp197 = _NS2;
  561. float4 Reflections191 = tex2D( _ReflectionTex, ( computeScreenPos189 + float4( ( Normalmap12 * (( _AccurateNormalReflection )?( ReflectionNormalWarp197 ):( _ReflectionNormalScale )) ) , 0.0 ) ).xy );
  562. float4 lerpResult196 = lerp( temp_output_134_0 , Reflections191 , _ReflectionIntensity);
  563. #ifdef _REFLECTIONONOFF_ON
  564. float4 staticSwitch208 = lerpResult196;
  565. #else
  566. float4 staticSwitch208 = temp_output_134_0;
  567. #endif
  568. float2 appendResult243 = (float2(( _WaterfallTiling.x * WorldPosition.x ) , ( _WaterfallTiling.y * WorldPosition.z )));
  569. float2 panner228 = ( ( _TimeParameters.x ) * _WaterfallSpeed + appendResult243);
  570. float3 BaseColor = (( _WaterfallFoamOnOff )?( ( ( ( _WaterfallColor * tex2D( _WaterfallFoam, panner228 ) ) + ( _WaterfallColor2 * tex2D( _WaterfallFoam2, panner228 ) ) ) + staticSwitch208 ) ):( staticSwitch208 )).rgb;
  571. float3 Normal = Normalmap12;
  572. float3 Emission = 0;
  573. float3 Specular = 0.5;
  574. float Metallic = _EnergyConservation;
  575. float Smoothness = _Smoothness;
  576. float Occlusion = 1;
  577. float Alpha = 1;
  578. float AlphaClipThreshold = 0.5;
  579. float AlphaClipThresholdShadow = 0.5;
  580. float3 BakedGI = 0;
  581. float3 RefractionColor = 1;
  582. float RefractionIndex = 1;
  583. float3 Transmission = 1;
  584. float3 Translucency = 1;
  585. #ifdef ASE_DEPTH_WRITE_ON
  586. float DepthValue = input.positionCS.z;
  587. #endif
  588. #ifdef _CLEARCOAT
  589. float CoatMask = 0;
  590. float CoatSmoothness = 0;
  591. #endif
  592. #ifdef _ALPHATEST_ON
  593. clip(Alpha - AlphaClipThreshold);
  594. #endif
  595. InputData inputData = (InputData)0;
  596. inputData.positionWS = WorldPosition;
  597. inputData.positionCS = input.positionCS;
  598. inputData.viewDirectionWS = WorldViewDirection;
  599. #ifdef _NORMALMAP
  600. #if _NORMAL_DROPOFF_TS
  601. inputData.normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent, WorldBiTangent, WorldNormal));
  602. #elif _NORMAL_DROPOFF_OS
  603. inputData.normalWS = TransformObjectToWorldNormal(Normal);
  604. #elif _NORMAL_DROPOFF_WS
  605. inputData.normalWS = Normal;
  606. #endif
  607. inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
  608. #else
  609. inputData.normalWS = WorldNormal;
  610. #endif
  611. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  612. inputData.shadowCoord = ShadowCoords;
  613. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  614. inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
  615. #else
  616. inputData.shadowCoord = float4(0, 0, 0, 0);
  617. #endif
  618. #ifdef ASE_FOG
  619. inputData.fogCoord = input.fogFactorAndVertexLight.x;
  620. #endif
  621. inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
  622. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  623. float3 SH = SampleSH(inputData.normalWS.xyz);
  624. #else
  625. float3 SH = input.lightmapUVOrVertexSH.xyz;
  626. #endif
  627. #if defined(DYNAMICLIGHTMAP_ON)
  628. inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS);
  629. inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
  630. #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
  631. inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS),
  632. inputData.normalWS,
  633. inputData.viewDirectionWS,
  634. input.positionCS.xy,
  635. input.probeOcclusion,
  636. inputData.shadowMask );
  637. #else
  638. inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
  639. inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
  640. #endif
  641. #ifdef ASE_BAKEDGI
  642. inputData.bakedGI = BakedGI;
  643. #endif
  644. inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
  645. #if defined(DEBUG_DISPLAY)
  646. #if defined(DYNAMICLIGHTMAP_ON)
  647. inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy;
  648. #endif
  649. #if defined(LIGHTMAP_ON)
  650. inputData.staticLightmapUV = input.lightmapUVOrVertexSH.xy;
  651. #else
  652. inputData.vertexSH = SH;
  653. #endif
  654. #if defined(USE_APV_PROBE_OCCLUSION)
  655. inputData.probeOcclusion = input.probeOcclusion;
  656. #endif
  657. #endif
  658. SurfaceData surfaceData;
  659. surfaceData.albedo = BaseColor;
  660. surfaceData.metallic = saturate(Metallic);
  661. surfaceData.specular = Specular;
  662. surfaceData.smoothness = saturate(Smoothness),
  663. surfaceData.occlusion = Occlusion,
  664. surfaceData.emission = Emission,
  665. surfaceData.alpha = saturate(Alpha);
  666. surfaceData.normalTS = Normal;
  667. surfaceData.clearCoatMask = 0;
  668. surfaceData.clearCoatSmoothness = 1;
  669. #ifdef _CLEARCOAT
  670. surfaceData.clearCoatMask = saturate(CoatMask);
  671. surfaceData.clearCoatSmoothness = saturate(CoatSmoothness);
  672. #endif
  673. #ifdef _DBUFFER
  674. ApplyDecalToSurfaceData(input.positionCS, surfaceData, inputData);
  675. #endif
  676. #ifdef _ASE_LIGHTING_SIMPLE
  677. half4 color = UniversalFragmentBlinnPhong( inputData, surfaceData);
  678. #else
  679. half4 color = UniversalFragmentPBR( inputData, surfaceData);
  680. #endif
  681. #ifdef ASE_TRANSMISSION
  682. {
  683. float shadow = _TransmissionShadow;
  684. #define SUM_LIGHT_TRANSMISSION(Light)\
  685. float3 atten = Light.color * Light.distanceAttenuation;\
  686. atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
  687. half3 transmission = max( 0, -dot( inputData.normalWS, Light.direction ) ) * atten * Transmission;\
  688. color.rgb += BaseColor * transmission;
  689. SUM_LIGHT_TRANSMISSION( GetMainLight( inputData.shadowCoord ) );
  690. #if defined(_ADDITIONAL_LIGHTS)
  691. uint meshRenderingLayers = GetMeshRenderingLayer();
  692. uint pixelLightCount = GetAdditionalLightsCount();
  693. #if USE_FORWARD_PLUS
  694. [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
  695. {
  696. FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
  697. Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
  698. #ifdef _LIGHT_LAYERS
  699. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  700. #endif
  701. {
  702. SUM_LIGHT_TRANSMISSION( light );
  703. }
  704. }
  705. #endif
  706. LIGHT_LOOP_BEGIN( pixelLightCount )
  707. Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
  708. #ifdef _LIGHT_LAYERS
  709. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  710. #endif
  711. {
  712. SUM_LIGHT_TRANSMISSION( light );
  713. }
  714. LIGHT_LOOP_END
  715. #endif
  716. }
  717. #endif
  718. #ifdef ASE_TRANSLUCENCY
  719. {
  720. float shadow = _TransShadow;
  721. float normal = _TransNormal;
  722. float scattering = _TransScattering;
  723. float direct = _TransDirect;
  724. float ambient = _TransAmbient;
  725. float strength = _TransStrength;
  726. #define SUM_LIGHT_TRANSLUCENCY(Light)\
  727. float3 atten = Light.color * Light.distanceAttenuation;\
  728. atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
  729. half3 lightDir = Light.direction + inputData.normalWS * normal;\
  730. half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );\
  731. half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;\
  732. color.rgb += BaseColor * translucency * strength;
  733. SUM_LIGHT_TRANSLUCENCY( GetMainLight( inputData.shadowCoord ) );
  734. #if defined(_ADDITIONAL_LIGHTS)
  735. uint meshRenderingLayers = GetMeshRenderingLayer();
  736. uint pixelLightCount = GetAdditionalLightsCount();
  737. #if USE_FORWARD_PLUS
  738. [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
  739. {
  740. FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
  741. Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
  742. #ifdef _LIGHT_LAYERS
  743. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  744. #endif
  745. {
  746. SUM_LIGHT_TRANSLUCENCY( light );
  747. }
  748. }
  749. #endif
  750. LIGHT_LOOP_BEGIN( pixelLightCount )
  751. Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
  752. #ifdef _LIGHT_LAYERS
  753. if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
  754. #endif
  755. {
  756. SUM_LIGHT_TRANSLUCENCY( light );
  757. }
  758. LIGHT_LOOP_END
  759. #endif
  760. }
  761. #endif
  762. #ifdef ASE_REFRACTION
  763. float4 projScreenPos = ScreenPos / ScreenPos.w;
  764. float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) );
  765. projScreenPos.xy += refractionOffset.xy;
  766. float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor;
  767. color.rgb = lerp( refraction, color.rgb, color.a );
  768. color.a = 1;
  769. #endif
  770. #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
  771. color.rgb *= color.a;
  772. #endif
  773. #ifdef ASE_FOG
  774. #ifdef TERRAIN_SPLAT_ADDPASS
  775. color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), input.fogFactorAndVertexLight.x );
  776. #else
  777. color.rgb = MixFog(color.rgb, input.fogFactorAndVertexLight.x);
  778. #endif
  779. #endif
  780. #ifdef ASE_DEPTH_WRITE_ON
  781. outputDepth = DepthValue;
  782. #endif
  783. #ifdef _WRITE_RENDERING_LAYERS
  784. uint renderingLayers = GetMeshRenderingLayer();
  785. outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
  786. #endif
  787. return color;
  788. }
  789. ENDHLSL
  790. }
  791. Pass
  792. {
  793. Name "DepthOnly"
  794. Tags { "LightMode"="DepthOnly" }
  795. ZWrite On
  796. ColorMask 0
  797. AlphaToMask Off
  798. HLSLPROGRAM
  799. #pragma multi_compile_local_fragment _ALPHATEST_ON
  800. #define _NORMAL_DROPOFF_TS 1
  801. #pragma multi_compile_instancing
  802. #define ASE_FOG 1
  803. #define _SURFACE_TYPE_TRANSPARENT 1
  804. #define _NORMALMAP 1
  805. #define ASE_VERSION 19701
  806. #define ASE_SRP_VERSION 170003
  807. #pragma vertex vert
  808. #pragma fragment frag
  809. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  810. #define _SPECULAR_COLOR 1
  811. #endif
  812. #define SHADERPASS SHADERPASS_DEPTHONLY
  813. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  814. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  815. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  816. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  817. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  818. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  819. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  820. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  821. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  822. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  823. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  824. #if defined(LOD_FADE_CROSSFADE)
  825. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  826. #endif
  827. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  828. #define ASE_SV_DEPTH SV_DepthLessEqual
  829. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  830. #else
  831. #define ASE_SV_DEPTH SV_Depth
  832. #define ASE_SV_POSITION_QUALIFIERS
  833. #endif
  834. struct Attributes
  835. {
  836. float4 positionOS : POSITION;
  837. float3 normalOS : NORMAL;
  838. UNITY_VERTEX_INPUT_INSTANCE_ID
  839. };
  840. struct PackedVaryings
  841. {
  842. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  843. float4 clipPosV : TEXCOORD0;
  844. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  845. float3 positionWS : TEXCOORD1;
  846. #endif
  847. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  848. float4 shadowCoord : TEXCOORD2;
  849. #endif
  850. UNITY_VERTEX_INPUT_INSTANCE_ID
  851. UNITY_VERTEX_OUTPUT_STEREO
  852. };
  853. CBUFFER_START(UnityPerMaterial)
  854. float4 _WaterfallColor2;
  855. float4 _WaterfallColor;
  856. float4 _AnimateUV1XYUV2ZW;
  857. float4 _UV2TilingXYScaleZW;
  858. float4 _MainColor;
  859. float2 _WaterfallTiling;
  860. float2 _WaterfallSpeed;
  861. float2 _FoamTiling;
  862. float _WaterfallFoamOnOff;
  863. float _ReflectionIntensity;
  864. float _ReflectionNormalScale;
  865. float _AccurateNormalReflection;
  866. float _FresnelPower;
  867. float _LerpStrength;
  868. float _NS2;
  869. float _DephFadeDistance;
  870. float _NS1;
  871. float _FoamIntensity;
  872. float _FoamFalloff;
  873. float _FoamDepth;
  874. float _Edgedistance;
  875. float _EnergyConservation;
  876. float _Smoothness;
  877. #ifdef ASE_TRANSMISSION
  878. float _TransmissionShadow;
  879. #endif
  880. #ifdef ASE_TRANSLUCENCY
  881. float _TransStrength;
  882. float _TransNormal;
  883. float _TransScattering;
  884. float _TransDirect;
  885. float _TransAmbient;
  886. float _TransShadow;
  887. #endif
  888. #ifdef ASE_TESSELLATION
  889. float _TessPhongStrength;
  890. float _TessValue;
  891. float _TessMin;
  892. float _TessMax;
  893. float _TessEdgeLength;
  894. float _TessMaxDisp;
  895. #endif
  896. CBUFFER_END
  897. #ifdef SCENEPICKINGPASS
  898. float4 _SelectionID;
  899. #endif
  900. #ifdef SCENESELECTIONPASS
  901. int _ObjectId;
  902. int _PassValue;
  903. #endif
  904. PackedVaryings VertexFunction( Attributes input )
  905. {
  906. PackedVaryings output = (PackedVaryings)0;
  907. UNITY_SETUP_INSTANCE_ID(input);
  908. UNITY_TRANSFER_INSTANCE_ID(input, output);
  909. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  910. #ifdef ASE_ABSOLUTE_VERTEX_POS
  911. float3 defaultVertexValue = input.positionOS.xyz;
  912. #else
  913. float3 defaultVertexValue = float3(0, 0, 0);
  914. #endif
  915. float3 vertexValue = defaultVertexValue;
  916. #ifdef ASE_ABSOLUTE_VERTEX_POS
  917. input.positionOS.xyz = vertexValue;
  918. #else
  919. input.positionOS.xyz += vertexValue;
  920. #endif
  921. input.normalOS = input.normalOS;
  922. VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
  923. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  924. output.positionWS = vertexInput.positionWS;
  925. #endif
  926. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  927. output.shadowCoord = GetShadowCoord( vertexInput );
  928. #endif
  929. output.positionCS = vertexInput.positionCS;
  930. output.clipPosV = vertexInput.positionCS;
  931. return output;
  932. }
  933. #if defined(ASE_TESSELLATION)
  934. struct VertexControl
  935. {
  936. float4 vertex : INTERNALTESSPOS;
  937. float3 normalOS : NORMAL;
  938. UNITY_VERTEX_INPUT_INSTANCE_ID
  939. };
  940. struct TessellationFactors
  941. {
  942. float edge[3] : SV_TessFactor;
  943. float inside : SV_InsideTessFactor;
  944. };
  945. VertexControl vert ( Attributes input )
  946. {
  947. VertexControl output;
  948. UNITY_SETUP_INSTANCE_ID(input);
  949. UNITY_TRANSFER_INSTANCE_ID(input, output);
  950. output.vertex = input.positionOS;
  951. output.normalOS = input.normalOS;
  952. return output;
  953. }
  954. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  955. {
  956. TessellationFactors output;
  957. float4 tf = 1;
  958. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  959. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  960. #if defined(ASE_FIXED_TESSELLATION)
  961. tf = FixedTess( tessValue );
  962. #elif defined(ASE_DISTANCE_TESSELLATION)
  963. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  964. #elif defined(ASE_LENGTH_TESSELLATION)
  965. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  966. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  967. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  968. #endif
  969. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  970. return output;
  971. }
  972. [domain("tri")]
  973. [partitioning("fractional_odd")]
  974. [outputtopology("triangle_cw")]
  975. [patchconstantfunc("TessellationFunction")]
  976. [outputcontrolpoints(3)]
  977. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  978. {
  979. return patch[id];
  980. }
  981. [domain("tri")]
  982. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  983. {
  984. Attributes output = (Attributes) 0;
  985. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  986. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  987. #if defined(ASE_PHONG_TESSELLATION)
  988. float3 pp[3];
  989. for (int i = 0; i < 3; ++i)
  990. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  991. float phongStrength = _TessPhongStrength;
  992. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  993. #endif
  994. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  995. return VertexFunction(output);
  996. }
  997. #else
  998. PackedVaryings vert ( Attributes input )
  999. {
  1000. return VertexFunction( input );
  1001. }
  1002. #endif
  1003. half4 frag( PackedVaryings input
  1004. #ifdef ASE_DEPTH_WRITE_ON
  1005. ,out float outputDepth : ASE_SV_DEPTH
  1006. #endif
  1007. ) : SV_TARGET
  1008. {
  1009. UNITY_SETUP_INSTANCE_ID(input);
  1010. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
  1011. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1012. float3 WorldPosition = input.positionWS;
  1013. #endif
  1014. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  1015. float4 ClipPos = input.clipPosV;
  1016. float4 ScreenPos = ComputeScreenPos( input.clipPosV );
  1017. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1018. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  1019. ShadowCoords = input.shadowCoord;
  1020. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  1021. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  1022. #endif
  1023. #endif
  1024. float Alpha = 1;
  1025. float AlphaClipThreshold = 0.5;
  1026. #ifdef ASE_DEPTH_WRITE_ON
  1027. float DepthValue = input.positionCS.z;
  1028. #endif
  1029. #ifdef _ALPHATEST_ON
  1030. clip(Alpha - AlphaClipThreshold);
  1031. #endif
  1032. #if defined(LOD_FADE_CROSSFADE)
  1033. LODFadeCrossFade( input.positionCS );
  1034. #endif
  1035. #ifdef ASE_DEPTH_WRITE_ON
  1036. outputDepth = DepthValue;
  1037. #endif
  1038. return 0;
  1039. }
  1040. ENDHLSL
  1041. }
  1042. Pass
  1043. {
  1044. Name "Meta"
  1045. Tags { "LightMode"="Meta" }
  1046. Cull Off
  1047. HLSLPROGRAM
  1048. #pragma multi_compile_local_fragment _ALPHATEST_ON
  1049. #define _NORMAL_DROPOFF_TS 1
  1050. #define ASE_FOG 1
  1051. #define _SURFACE_TYPE_TRANSPARENT 1
  1052. #define _NORMALMAP 1
  1053. #define ASE_VERSION 19701
  1054. #define ASE_SRP_VERSION 170003
  1055. #define REQUIRE_DEPTH_TEXTURE 1
  1056. #define REQUIRE_OPAQUE_TEXTURE 1
  1057. #pragma shader_feature EDITOR_VISUALIZATION
  1058. #pragma vertex vert
  1059. #pragma fragment frag
  1060. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  1061. #define _SPECULAR_COLOR 1
  1062. #endif
  1063. #define SHADERPASS SHADERPASS_META
  1064. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1065. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1066. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1067. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1068. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  1069. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1070. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  1071. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  1072. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  1073. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1074. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
  1075. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1076. #define ASE_NEEDS_FRAG_WORLD_POSITION
  1077. #define ASE_NEEDS_VERT_POSITION
  1078. #pragma shader_feature_local _REFLECTIONONOFF_ON
  1079. struct Attributes
  1080. {
  1081. float4 positionOS : POSITION;
  1082. float3 normalOS : NORMAL;
  1083. float4 texcoord0 : TEXCOORD0;
  1084. float4 texcoord1 : TEXCOORD1;
  1085. float4 texcoord2 : TEXCOORD2;
  1086. UNITY_VERTEX_INPUT_INSTANCE_ID
  1087. };
  1088. struct PackedVaryings
  1089. {
  1090. float4 positionCS : SV_POSITION;
  1091. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1092. float3 positionWS : TEXCOORD0;
  1093. #endif
  1094. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1095. float4 shadowCoord : TEXCOORD1;
  1096. #endif
  1097. #ifdef EDITOR_VISUALIZATION
  1098. float4 VizUV : TEXCOORD2;
  1099. float4 LightCoord : TEXCOORD3;
  1100. #endif
  1101. float4 ase_texcoord4 : TEXCOORD4;
  1102. float4 ase_texcoord5 : TEXCOORD5;
  1103. float3 ase_normal : NORMAL;
  1104. float4 ase_texcoord6 : TEXCOORD6;
  1105. UNITY_VERTEX_INPUT_INSTANCE_ID
  1106. UNITY_VERTEX_OUTPUT_STEREO
  1107. };
  1108. CBUFFER_START(UnityPerMaterial)
  1109. float4 _WaterfallColor2;
  1110. float4 _WaterfallColor;
  1111. float4 _AnimateUV1XYUV2ZW;
  1112. float4 _UV2TilingXYScaleZW;
  1113. float4 _MainColor;
  1114. float2 _WaterfallTiling;
  1115. float2 _WaterfallSpeed;
  1116. float2 _FoamTiling;
  1117. float _WaterfallFoamOnOff;
  1118. float _ReflectionIntensity;
  1119. float _ReflectionNormalScale;
  1120. float _AccurateNormalReflection;
  1121. float _FresnelPower;
  1122. float _LerpStrength;
  1123. float _NS2;
  1124. float _DephFadeDistance;
  1125. float _NS1;
  1126. float _FoamIntensity;
  1127. float _FoamFalloff;
  1128. float _FoamDepth;
  1129. float _Edgedistance;
  1130. float _EnergyConservation;
  1131. float _Smoothness;
  1132. #ifdef ASE_TRANSMISSION
  1133. float _TransmissionShadow;
  1134. #endif
  1135. #ifdef ASE_TRANSLUCENCY
  1136. float _TransStrength;
  1137. float _TransNormal;
  1138. float _TransScattering;
  1139. float _TransDirect;
  1140. float _TransAmbient;
  1141. float _TransShadow;
  1142. #endif
  1143. #ifdef ASE_TESSELLATION
  1144. float _TessPhongStrength;
  1145. float _TessValue;
  1146. float _TessMin;
  1147. float _TessMax;
  1148. float _TessEdgeLength;
  1149. float _TessMaxDisp;
  1150. #endif
  1151. CBUFFER_END
  1152. #ifdef SCENEPICKINGPASS
  1153. float4 _SelectionID;
  1154. #endif
  1155. #ifdef SCENESELECTIONPASS
  1156. int _ObjectId;
  1157. int _PassValue;
  1158. #endif
  1159. sampler2D _Foam;
  1160. sampler2D _NormalMap;
  1161. sampler2D _ReflectionTex;
  1162. sampler2D _WaterfallFoam;
  1163. sampler2D _WaterfallFoam2;
  1164. PackedVaryings VertexFunction( Attributes input )
  1165. {
  1166. PackedVaryings output = (PackedVaryings)0;
  1167. UNITY_SETUP_INSTANCE_ID(input);
  1168. UNITY_TRANSFER_INSTANCE_ID(input, output);
  1169. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  1170. float4 ase_clipPos = TransformObjectToHClip((input.positionOS).xyz);
  1171. float4 screenPos = ComputeScreenPos(ase_clipPos);
  1172. output.ase_texcoord4 = screenPos;
  1173. float3 objectToViewPos = TransformWorldToView(TransformObjectToWorld(input.positionOS.xyz));
  1174. float eyeDepth = -objectToViewPos.z;
  1175. output.ase_texcoord5.x = eyeDepth;
  1176. output.ase_normal = input.normalOS;
  1177. output.ase_texcoord6 = input.positionOS;
  1178. //setting value to unused interpolator channels and avoid initialization warnings
  1179. output.ase_texcoord5.yzw = 0;
  1180. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1181. float3 defaultVertexValue = input.positionOS.xyz;
  1182. #else
  1183. float3 defaultVertexValue = float3(0, 0, 0);
  1184. #endif
  1185. float3 vertexValue = defaultVertexValue;
  1186. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1187. input.positionOS.xyz = vertexValue;
  1188. #else
  1189. input.positionOS.xyz += vertexValue;
  1190. #endif
  1191. input.normalOS = input.normalOS;
  1192. float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
  1193. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1194. output.positionWS = positionWS;
  1195. #endif
  1196. output.positionCS = MetaVertexPosition( input.positionOS, input.texcoord1.xy, input.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
  1197. #ifdef EDITOR_VISUALIZATION
  1198. float2 VizUV = 0;
  1199. float4 LightCoord = 0;
  1200. UnityEditorVizData(input.positionOS.xyz, input.texcoord0.xy, input.texcoord1.xy, input.texcoord2.xy, VizUV, LightCoord);
  1201. output.VizUV = float4(VizUV, 0, 0);
  1202. output.LightCoord = LightCoord;
  1203. #endif
  1204. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1205. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  1206. vertexInput.positionWS = positionWS;
  1207. vertexInput.positionCS = output.positionCS;
  1208. output.shadowCoord = GetShadowCoord( vertexInput );
  1209. #endif
  1210. return output;
  1211. }
  1212. #if defined(ASE_TESSELLATION)
  1213. struct VertexControl
  1214. {
  1215. float4 vertex : INTERNALTESSPOS;
  1216. float3 normalOS : NORMAL;
  1217. float4 texcoord0 : TEXCOORD0;
  1218. float4 texcoord1 : TEXCOORD1;
  1219. float4 texcoord2 : TEXCOORD2;
  1220. UNITY_VERTEX_INPUT_INSTANCE_ID
  1221. };
  1222. struct TessellationFactors
  1223. {
  1224. float edge[3] : SV_TessFactor;
  1225. float inside : SV_InsideTessFactor;
  1226. };
  1227. VertexControl vert ( Attributes input )
  1228. {
  1229. VertexControl output;
  1230. UNITY_SETUP_INSTANCE_ID(input);
  1231. UNITY_TRANSFER_INSTANCE_ID(input, output);
  1232. output.vertex = input.positionOS;
  1233. output.normalOS = input.normalOS;
  1234. output.texcoord0 = input.texcoord0;
  1235. output.texcoord1 = input.texcoord1;
  1236. output.texcoord2 = input.texcoord2;
  1237. return output;
  1238. }
  1239. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  1240. {
  1241. TessellationFactors output;
  1242. float4 tf = 1;
  1243. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1244. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1245. #if defined(ASE_FIXED_TESSELLATION)
  1246. tf = FixedTess( tessValue );
  1247. #elif defined(ASE_DISTANCE_TESSELLATION)
  1248. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1249. #elif defined(ASE_LENGTH_TESSELLATION)
  1250. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1251. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1252. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1253. #endif
  1254. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  1255. return output;
  1256. }
  1257. [domain("tri")]
  1258. [partitioning("fractional_odd")]
  1259. [outputtopology("triangle_cw")]
  1260. [patchconstantfunc("TessellationFunction")]
  1261. [outputcontrolpoints(3)]
  1262. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1263. {
  1264. return patch[id];
  1265. }
  1266. [domain("tri")]
  1267. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1268. {
  1269. Attributes output = (Attributes) 0;
  1270. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1271. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  1272. output.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z;
  1273. output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
  1274. output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
  1275. #if defined(ASE_PHONG_TESSELLATION)
  1276. float3 pp[3];
  1277. for (int i = 0; i < 3; ++i)
  1278. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  1279. float phongStrength = _TessPhongStrength;
  1280. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  1281. #endif
  1282. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  1283. return VertexFunction(output);
  1284. }
  1285. #else
  1286. PackedVaryings vert ( Attributes input )
  1287. {
  1288. return VertexFunction( input );
  1289. }
  1290. #endif
  1291. half4 frag(PackedVaryings input ) : SV_TARGET
  1292. {
  1293. UNITY_SETUP_INSTANCE_ID(input);
  1294. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
  1295. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1296. float3 WorldPosition = input.positionWS;
  1297. #endif
  1298. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  1299. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1300. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  1301. ShadowCoords = input.shadowCoord;
  1302. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  1303. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  1304. #endif
  1305. #endif
  1306. float4 screenPos = input.ase_texcoord4;
  1307. float4 ase_screenPosNorm = screenPos / screenPos.w;
  1308. ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
  1309. float screenDepth127 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  1310. float distanceDepth127 = abs( ( screenDepth127 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _Edgedistance ) );
  1311. float temp_output_128_0 = ( 1.0 - distanceDepth127 );
  1312. float2 appendResult205 = (float2(( _FoamTiling.x * WorldPosition.x ) , ( _FoamTiling.y * WorldPosition.z )));
  1313. float2 panner152 = ( 1.0 * _Time.y * float2( -0.01,0.01 ) + appendResult205);
  1314. float clampResult132 = clamp( ( ( temp_output_128_0 * 1.0 ) * ( saturate( pow( abs( ( temp_output_128_0 + _FoamDepth ) ) , _FoamFalloff ) ) * tex2D( _Foam, panner152 ).r * _FoamIntensity ) ) , 0.0 , 1.0 );
  1315. float Edge131 = clampResult132;
  1316. float2 appendResult7 = (float2(ase_screenPosNorm.x , ase_screenPosNorm.y));
  1317. float2 temp_output_24_0 = (WorldPosition).xz;
  1318. float2 appendResult31 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.x ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.y )));
  1319. float4 _UV1TilingXYScaleZW = float4(1,1,1,1);
  1320. float2 appendResult36 = (float2(_UV1TilingXYScaleZW.x , _UV1TilingXYScaleZW.y));
  1321. float2 appendResult38 = (float2(_UV1TilingXYScaleZW.z , _UV1TilingXYScaleZW.w));
  1322. float2 UV140 = ( ( ( temp_output_24_0 + appendResult31 ) * appendResult36 ) / appendResult38 );
  1323. float screenDepth78 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  1324. float distanceDepth78 = saturate( abs( ( screenDepth78 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DephFadeDistance ) ) );
  1325. float DephFade79 = distanceDepth78;
  1326. float3 unpack2 = UnpackNormalScale( tex2D( _NormalMap, UV140 ), ( _NS1 * DephFade79 ) );
  1327. unpack2.z = lerp( 1, unpack2.z, saturate(( _NS1 * DephFade79 )) );
  1328. float2 appendResult43 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.z ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.w )));
  1329. float2 appendResult49 = (float2(_UV2TilingXYScaleZW.x , _UV2TilingXYScaleZW.y));
  1330. float2 appendResult50 = (float2(_UV2TilingXYScaleZW.z , _UV2TilingXYScaleZW.w));
  1331. float2 UV247 = ( ( ( temp_output_24_0 + appendResult43 ) * appendResult49 ) / appendResult50 );
  1332. float3 unpack4 = UnpackNormalScale( tex2D( _NormalMap, UV247 ), ( _NS2 * DephFade79 ) );
  1333. unpack4.z = lerp( 1, unpack4.z, saturate(( _NS2 * DephFade79 )) );
  1334. float3 lerpResult8 = lerp( unpack2 , unpack4 , _LerpStrength);
  1335. float3 Normalmap12 = lerpResult8;
  1336. float2 ScreenUV20 = ( appendResult7 - ( (Normalmap12).xy * 0.1 ) );
  1337. float eyeDepth220 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( float4( ScreenUV20, 0.0 , 0.0 ).xy ),_ZBufferParams);
  1338. float eyeDepth = input.ase_texcoord5.x;
  1339. float ifLocalVar224 = 0;
  1340. if( eyeDepth220 > eyeDepth )
  1341. ifLocalVar224 = 1.0;
  1342. else if( eyeDepth220 < eyeDepth )
  1343. ifLocalVar224 = 0.0;
  1344. float4 fetchOpaqueVal1 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( ScreenUV20 * ifLocalVar224 ) ), 1.0 );
  1345. float3 ase_viewVectorWS = ( _WorldSpaceCameraPos.xyz - WorldPosition );
  1346. float3 ase_viewDirWS = normalize( ase_viewVectorWS );
  1347. float dotResult62 = dot( ase_viewDirWS , input.ase_normal );
  1348. float Fresnel68 = pow( abs( ( 1.0 - saturate( abs( dotResult62 ) ) ) ) , _FresnelPower );
  1349. float4 lerpResult55 = lerp( fetchOpaqueVal1 , _MainColor , ( Fresnel68 * DephFade79 ));
  1350. float4 temp_output_134_0 = ( Edge131 + lerpResult55 );
  1351. float4 unityObjectToClipPos185 = TransformWorldToHClip(TransformObjectToWorld(( input.ase_texcoord6.xyz + float3( 0,0,0 ) )));
  1352. float4 computeScreenPos189 = ComputeScreenPos( unityObjectToClipPos185 );
  1353. computeScreenPos189 = computeScreenPos189 / computeScreenPos189.w;
  1354. computeScreenPos189.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? computeScreenPos189.z : computeScreenPos189.z* 0.5 + 0.5;
  1355. float ReflectionNormalWarp197 = _NS2;
  1356. float4 Reflections191 = tex2D( _ReflectionTex, ( computeScreenPos189 + float4( ( Normalmap12 * (( _AccurateNormalReflection )?( ReflectionNormalWarp197 ):( _ReflectionNormalScale )) ) , 0.0 ) ).xy );
  1357. float4 lerpResult196 = lerp( temp_output_134_0 , Reflections191 , _ReflectionIntensity);
  1358. #ifdef _REFLECTIONONOFF_ON
  1359. float4 staticSwitch208 = lerpResult196;
  1360. #else
  1361. float4 staticSwitch208 = temp_output_134_0;
  1362. #endif
  1363. float2 appendResult243 = (float2(( _WaterfallTiling.x * WorldPosition.x ) , ( _WaterfallTiling.y * WorldPosition.z )));
  1364. float2 panner228 = ( ( _TimeParameters.x ) * _WaterfallSpeed + appendResult243);
  1365. float3 BaseColor = (( _WaterfallFoamOnOff )?( ( ( ( _WaterfallColor * tex2D( _WaterfallFoam, panner228 ) ) + ( _WaterfallColor2 * tex2D( _WaterfallFoam2, panner228 ) ) ) + staticSwitch208 ) ):( staticSwitch208 )).rgb;
  1366. float3 Emission = 0;
  1367. float Alpha = 1;
  1368. float AlphaClipThreshold = 0.5;
  1369. #ifdef _ALPHATEST_ON
  1370. clip(Alpha - AlphaClipThreshold);
  1371. #endif
  1372. MetaInput metaInput = (MetaInput)0;
  1373. metaInput.Albedo = BaseColor;
  1374. metaInput.Emission = Emission;
  1375. #ifdef EDITOR_VISUALIZATION
  1376. metaInput.VizUV = input.VizUV.xy;
  1377. metaInput.LightCoord = input.LightCoord;
  1378. #endif
  1379. return UnityMetaFragment(metaInput);
  1380. }
  1381. ENDHLSL
  1382. }
  1383. Pass
  1384. {
  1385. Name "Universal2D"
  1386. Tags { "LightMode"="Universal2D" }
  1387. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  1388. ZWrite On
  1389. ZTest LEqual
  1390. Offset 0 , 0
  1391. ColorMask RGBA
  1392. HLSLPROGRAM
  1393. #pragma multi_compile_local_fragment _ALPHATEST_ON
  1394. #define _NORMAL_DROPOFF_TS 1
  1395. #define ASE_FOG 1
  1396. #define _SURFACE_TYPE_TRANSPARENT 1
  1397. #define _NORMALMAP 1
  1398. #define ASE_VERSION 19701
  1399. #define ASE_SRP_VERSION 170003
  1400. #define REQUIRE_DEPTH_TEXTURE 1
  1401. #define REQUIRE_OPAQUE_TEXTURE 1
  1402. #pragma vertex vert
  1403. #pragma fragment frag
  1404. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  1405. #define _SPECULAR_COLOR 1
  1406. #endif
  1407. #define SHADERPASS SHADERPASS_2D
  1408. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1409. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1410. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1411. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1412. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  1413. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1414. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  1415. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  1416. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  1417. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1418. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1419. #define ASE_NEEDS_FRAG_WORLD_POSITION
  1420. #define ASE_NEEDS_VERT_POSITION
  1421. #pragma shader_feature_local _REFLECTIONONOFF_ON
  1422. struct Attributes
  1423. {
  1424. float4 positionOS : POSITION;
  1425. float3 normalOS : NORMAL;
  1426. UNITY_VERTEX_INPUT_INSTANCE_ID
  1427. };
  1428. struct PackedVaryings
  1429. {
  1430. float4 positionCS : SV_POSITION;
  1431. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1432. float3 positionWS : TEXCOORD0;
  1433. #endif
  1434. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1435. float4 shadowCoord : TEXCOORD1;
  1436. #endif
  1437. float4 ase_texcoord2 : TEXCOORD2;
  1438. float4 ase_texcoord3 : TEXCOORD3;
  1439. float3 ase_normal : NORMAL;
  1440. float4 ase_texcoord4 : TEXCOORD4;
  1441. UNITY_VERTEX_INPUT_INSTANCE_ID
  1442. UNITY_VERTEX_OUTPUT_STEREO
  1443. };
  1444. CBUFFER_START(UnityPerMaterial)
  1445. float4 _WaterfallColor2;
  1446. float4 _WaterfallColor;
  1447. float4 _AnimateUV1XYUV2ZW;
  1448. float4 _UV2TilingXYScaleZW;
  1449. float4 _MainColor;
  1450. float2 _WaterfallTiling;
  1451. float2 _WaterfallSpeed;
  1452. float2 _FoamTiling;
  1453. float _WaterfallFoamOnOff;
  1454. float _ReflectionIntensity;
  1455. float _ReflectionNormalScale;
  1456. float _AccurateNormalReflection;
  1457. float _FresnelPower;
  1458. float _LerpStrength;
  1459. float _NS2;
  1460. float _DephFadeDistance;
  1461. float _NS1;
  1462. float _FoamIntensity;
  1463. float _FoamFalloff;
  1464. float _FoamDepth;
  1465. float _Edgedistance;
  1466. float _EnergyConservation;
  1467. float _Smoothness;
  1468. #ifdef ASE_TRANSMISSION
  1469. float _TransmissionShadow;
  1470. #endif
  1471. #ifdef ASE_TRANSLUCENCY
  1472. float _TransStrength;
  1473. float _TransNormal;
  1474. float _TransScattering;
  1475. float _TransDirect;
  1476. float _TransAmbient;
  1477. float _TransShadow;
  1478. #endif
  1479. #ifdef ASE_TESSELLATION
  1480. float _TessPhongStrength;
  1481. float _TessValue;
  1482. float _TessMin;
  1483. float _TessMax;
  1484. float _TessEdgeLength;
  1485. float _TessMaxDisp;
  1486. #endif
  1487. CBUFFER_END
  1488. #ifdef SCENEPICKINGPASS
  1489. float4 _SelectionID;
  1490. #endif
  1491. #ifdef SCENESELECTIONPASS
  1492. int _ObjectId;
  1493. int _PassValue;
  1494. #endif
  1495. sampler2D _Foam;
  1496. sampler2D _NormalMap;
  1497. sampler2D _ReflectionTex;
  1498. sampler2D _WaterfallFoam;
  1499. sampler2D _WaterfallFoam2;
  1500. PackedVaryings VertexFunction( Attributes input )
  1501. {
  1502. PackedVaryings output = (PackedVaryings)0;
  1503. UNITY_SETUP_INSTANCE_ID( input );
  1504. UNITY_TRANSFER_INSTANCE_ID( input, output );
  1505. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( output );
  1506. float4 ase_clipPos = TransformObjectToHClip((input.positionOS).xyz);
  1507. float4 screenPos = ComputeScreenPos(ase_clipPos);
  1508. output.ase_texcoord2 = screenPos;
  1509. float3 objectToViewPos = TransformWorldToView(TransformObjectToWorld(input.positionOS.xyz));
  1510. float eyeDepth = -objectToViewPos.z;
  1511. output.ase_texcoord3.x = eyeDepth;
  1512. output.ase_normal = input.normalOS;
  1513. output.ase_texcoord4 = input.positionOS;
  1514. //setting value to unused interpolator channels and avoid initialization warnings
  1515. output.ase_texcoord3.yzw = 0;
  1516. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1517. float3 defaultVertexValue = input.positionOS.xyz;
  1518. #else
  1519. float3 defaultVertexValue = float3(0, 0, 0);
  1520. #endif
  1521. float3 vertexValue = defaultVertexValue;
  1522. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1523. input.positionOS.xyz = vertexValue;
  1524. #else
  1525. input.positionOS.xyz += vertexValue;
  1526. #endif
  1527. input.normalOS = input.normalOS;
  1528. VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
  1529. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1530. output.positionWS = vertexInput.positionWS;
  1531. #endif
  1532. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1533. output.shadowCoord = GetShadowCoord( vertexInput );
  1534. #endif
  1535. output.positionCS = vertexInput.positionCS;
  1536. return output;
  1537. }
  1538. #if defined(ASE_TESSELLATION)
  1539. struct VertexControl
  1540. {
  1541. float4 vertex : INTERNALTESSPOS;
  1542. float3 normalOS : NORMAL;
  1543. UNITY_VERTEX_INPUT_INSTANCE_ID
  1544. };
  1545. struct TessellationFactors
  1546. {
  1547. float edge[3] : SV_TessFactor;
  1548. float inside : SV_InsideTessFactor;
  1549. };
  1550. VertexControl vert ( Attributes input )
  1551. {
  1552. VertexControl output;
  1553. UNITY_SETUP_INSTANCE_ID(input);
  1554. UNITY_TRANSFER_INSTANCE_ID(input, output);
  1555. output.vertex = input.positionOS;
  1556. output.normalOS = input.normalOS;
  1557. return output;
  1558. }
  1559. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  1560. {
  1561. TessellationFactors output;
  1562. float4 tf = 1;
  1563. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1564. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1565. #if defined(ASE_FIXED_TESSELLATION)
  1566. tf = FixedTess( tessValue );
  1567. #elif defined(ASE_DISTANCE_TESSELLATION)
  1568. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1569. #elif defined(ASE_LENGTH_TESSELLATION)
  1570. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1571. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1572. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1573. #endif
  1574. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  1575. return output;
  1576. }
  1577. [domain("tri")]
  1578. [partitioning("fractional_odd")]
  1579. [outputtopology("triangle_cw")]
  1580. [patchconstantfunc("TessellationFunction")]
  1581. [outputcontrolpoints(3)]
  1582. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1583. {
  1584. return patch[id];
  1585. }
  1586. [domain("tri")]
  1587. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1588. {
  1589. Attributes output = (Attributes) 0;
  1590. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1591. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  1592. #if defined(ASE_PHONG_TESSELLATION)
  1593. float3 pp[3];
  1594. for (int i = 0; i < 3; ++i)
  1595. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  1596. float phongStrength = _TessPhongStrength;
  1597. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  1598. #endif
  1599. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  1600. return VertexFunction(output);
  1601. }
  1602. #else
  1603. PackedVaryings vert ( Attributes input )
  1604. {
  1605. return VertexFunction( input );
  1606. }
  1607. #endif
  1608. half4 frag(PackedVaryings input ) : SV_TARGET
  1609. {
  1610. UNITY_SETUP_INSTANCE_ID( input );
  1611. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
  1612. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1613. float3 WorldPosition = input.positionWS;
  1614. #endif
  1615. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  1616. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1617. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  1618. ShadowCoords = input.shadowCoord;
  1619. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  1620. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  1621. #endif
  1622. #endif
  1623. float4 screenPos = input.ase_texcoord2;
  1624. float4 ase_screenPosNorm = screenPos / screenPos.w;
  1625. ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
  1626. float screenDepth127 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  1627. float distanceDepth127 = abs( ( screenDepth127 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _Edgedistance ) );
  1628. float temp_output_128_0 = ( 1.0 - distanceDepth127 );
  1629. float2 appendResult205 = (float2(( _FoamTiling.x * WorldPosition.x ) , ( _FoamTiling.y * WorldPosition.z )));
  1630. float2 panner152 = ( 1.0 * _Time.y * float2( -0.01,0.01 ) + appendResult205);
  1631. float clampResult132 = clamp( ( ( temp_output_128_0 * 1.0 ) * ( saturate( pow( abs( ( temp_output_128_0 + _FoamDepth ) ) , _FoamFalloff ) ) * tex2D( _Foam, panner152 ).r * _FoamIntensity ) ) , 0.0 , 1.0 );
  1632. float Edge131 = clampResult132;
  1633. float2 appendResult7 = (float2(ase_screenPosNorm.x , ase_screenPosNorm.y));
  1634. float2 temp_output_24_0 = (WorldPosition).xz;
  1635. float2 appendResult31 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.x ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.y )));
  1636. float4 _UV1TilingXYScaleZW = float4(1,1,1,1);
  1637. float2 appendResult36 = (float2(_UV1TilingXYScaleZW.x , _UV1TilingXYScaleZW.y));
  1638. float2 appendResult38 = (float2(_UV1TilingXYScaleZW.z , _UV1TilingXYScaleZW.w));
  1639. float2 UV140 = ( ( ( temp_output_24_0 + appendResult31 ) * appendResult36 ) / appendResult38 );
  1640. float screenDepth78 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  1641. float distanceDepth78 = saturate( abs( ( screenDepth78 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DephFadeDistance ) ) );
  1642. float DephFade79 = distanceDepth78;
  1643. float3 unpack2 = UnpackNormalScale( tex2D( _NormalMap, UV140 ), ( _NS1 * DephFade79 ) );
  1644. unpack2.z = lerp( 1, unpack2.z, saturate(( _NS1 * DephFade79 )) );
  1645. float2 appendResult43 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.z ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.w )));
  1646. float2 appendResult49 = (float2(_UV2TilingXYScaleZW.x , _UV2TilingXYScaleZW.y));
  1647. float2 appendResult50 = (float2(_UV2TilingXYScaleZW.z , _UV2TilingXYScaleZW.w));
  1648. float2 UV247 = ( ( ( temp_output_24_0 + appendResult43 ) * appendResult49 ) / appendResult50 );
  1649. float3 unpack4 = UnpackNormalScale( tex2D( _NormalMap, UV247 ), ( _NS2 * DephFade79 ) );
  1650. unpack4.z = lerp( 1, unpack4.z, saturate(( _NS2 * DephFade79 )) );
  1651. float3 lerpResult8 = lerp( unpack2 , unpack4 , _LerpStrength);
  1652. float3 Normalmap12 = lerpResult8;
  1653. float2 ScreenUV20 = ( appendResult7 - ( (Normalmap12).xy * 0.1 ) );
  1654. float eyeDepth220 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( float4( ScreenUV20, 0.0 , 0.0 ).xy ),_ZBufferParams);
  1655. float eyeDepth = input.ase_texcoord3.x;
  1656. float ifLocalVar224 = 0;
  1657. if( eyeDepth220 > eyeDepth )
  1658. ifLocalVar224 = 1.0;
  1659. else if( eyeDepth220 < eyeDepth )
  1660. ifLocalVar224 = 0.0;
  1661. float4 fetchOpaqueVal1 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( ScreenUV20 * ifLocalVar224 ) ), 1.0 );
  1662. float3 ase_viewVectorWS = ( _WorldSpaceCameraPos.xyz - WorldPosition );
  1663. float3 ase_viewDirWS = normalize( ase_viewVectorWS );
  1664. float dotResult62 = dot( ase_viewDirWS , input.ase_normal );
  1665. float Fresnel68 = pow( abs( ( 1.0 - saturate( abs( dotResult62 ) ) ) ) , _FresnelPower );
  1666. float4 lerpResult55 = lerp( fetchOpaqueVal1 , _MainColor , ( Fresnel68 * DephFade79 ));
  1667. float4 temp_output_134_0 = ( Edge131 + lerpResult55 );
  1668. float4 unityObjectToClipPos185 = TransformWorldToHClip(TransformObjectToWorld(( input.ase_texcoord4.xyz + float3( 0,0,0 ) )));
  1669. float4 computeScreenPos189 = ComputeScreenPos( unityObjectToClipPos185 );
  1670. computeScreenPos189 = computeScreenPos189 / computeScreenPos189.w;
  1671. computeScreenPos189.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? computeScreenPos189.z : computeScreenPos189.z* 0.5 + 0.5;
  1672. float ReflectionNormalWarp197 = _NS2;
  1673. float4 Reflections191 = tex2D( _ReflectionTex, ( computeScreenPos189 + float4( ( Normalmap12 * (( _AccurateNormalReflection )?( ReflectionNormalWarp197 ):( _ReflectionNormalScale )) ) , 0.0 ) ).xy );
  1674. float4 lerpResult196 = lerp( temp_output_134_0 , Reflections191 , _ReflectionIntensity);
  1675. #ifdef _REFLECTIONONOFF_ON
  1676. float4 staticSwitch208 = lerpResult196;
  1677. #else
  1678. float4 staticSwitch208 = temp_output_134_0;
  1679. #endif
  1680. float2 appendResult243 = (float2(( _WaterfallTiling.x * WorldPosition.x ) , ( _WaterfallTiling.y * WorldPosition.z )));
  1681. float2 panner228 = ( ( _TimeParameters.x ) * _WaterfallSpeed + appendResult243);
  1682. float3 BaseColor = (( _WaterfallFoamOnOff )?( ( ( ( _WaterfallColor * tex2D( _WaterfallFoam, panner228 ) ) + ( _WaterfallColor2 * tex2D( _WaterfallFoam2, panner228 ) ) ) + staticSwitch208 ) ):( staticSwitch208 )).rgb;
  1683. float Alpha = 1;
  1684. float AlphaClipThreshold = 0.5;
  1685. half4 color = half4(BaseColor, Alpha );
  1686. #ifdef _ALPHATEST_ON
  1687. clip(Alpha - AlphaClipThreshold);
  1688. #endif
  1689. return color;
  1690. }
  1691. ENDHLSL
  1692. }
  1693. Pass
  1694. {
  1695. Name "DepthNormals"
  1696. Tags { "LightMode"="DepthNormals" }
  1697. ZWrite On
  1698. Blend One Zero
  1699. ZTest LEqual
  1700. ZWrite On
  1701. HLSLPROGRAM
  1702. #pragma multi_compile_local_fragment _ALPHATEST_ON
  1703. #define _NORMAL_DROPOFF_TS 1
  1704. #pragma multi_compile_instancing
  1705. #define ASE_FOG 1
  1706. #define _SURFACE_TYPE_TRANSPARENT 1
  1707. #define _NORMALMAP 1
  1708. #define ASE_VERSION 19701
  1709. #define ASE_SRP_VERSION 170003
  1710. #define REQUIRE_DEPTH_TEXTURE 1
  1711. #pragma vertex vert
  1712. #pragma fragment frag
  1713. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  1714. #define _SPECULAR_COLOR 1
  1715. #endif
  1716. #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
  1717. //#define SHADERPASS SHADERPASS_DEPTHNORMALS
  1718. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  1719. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
  1720. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1721. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1722. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1723. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1724. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  1725. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1726. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  1727. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  1728. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  1729. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1730. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1731. #if defined(LOD_FADE_CROSSFADE)
  1732. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  1733. #endif
  1734. #define ASE_NEEDS_FRAG_WORLD_POSITION
  1735. #define ASE_NEEDS_FRAG_SCREEN_POSITION
  1736. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  1737. #define ASE_SV_DEPTH SV_DepthLessEqual
  1738. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  1739. #else
  1740. #define ASE_SV_DEPTH SV_Depth
  1741. #define ASE_SV_POSITION_QUALIFIERS
  1742. #endif
  1743. struct Attributes
  1744. {
  1745. float4 positionOS : POSITION;
  1746. float3 normalOS : NORMAL;
  1747. float4 tangentOS : TANGENT;
  1748. UNITY_VERTEX_INPUT_INSTANCE_ID
  1749. };
  1750. struct PackedVaryings
  1751. {
  1752. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  1753. float4 clipPosV : TEXCOORD0;
  1754. float3 worldNormal : TEXCOORD1;
  1755. float4 worldTangent : TEXCOORD2;
  1756. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1757. float3 positionWS : TEXCOORD3;
  1758. #endif
  1759. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1760. float4 shadowCoord : TEXCOORD4;
  1761. #endif
  1762. UNITY_VERTEX_INPUT_INSTANCE_ID
  1763. UNITY_VERTEX_OUTPUT_STEREO
  1764. };
  1765. CBUFFER_START(UnityPerMaterial)
  1766. float4 _WaterfallColor2;
  1767. float4 _WaterfallColor;
  1768. float4 _AnimateUV1XYUV2ZW;
  1769. float4 _UV2TilingXYScaleZW;
  1770. float4 _MainColor;
  1771. float2 _WaterfallTiling;
  1772. float2 _WaterfallSpeed;
  1773. float2 _FoamTiling;
  1774. float _WaterfallFoamOnOff;
  1775. float _ReflectionIntensity;
  1776. float _ReflectionNormalScale;
  1777. float _AccurateNormalReflection;
  1778. float _FresnelPower;
  1779. float _LerpStrength;
  1780. float _NS2;
  1781. float _DephFadeDistance;
  1782. float _NS1;
  1783. float _FoamIntensity;
  1784. float _FoamFalloff;
  1785. float _FoamDepth;
  1786. float _Edgedistance;
  1787. float _EnergyConservation;
  1788. float _Smoothness;
  1789. #ifdef ASE_TRANSMISSION
  1790. float _TransmissionShadow;
  1791. #endif
  1792. #ifdef ASE_TRANSLUCENCY
  1793. float _TransStrength;
  1794. float _TransNormal;
  1795. float _TransScattering;
  1796. float _TransDirect;
  1797. float _TransAmbient;
  1798. float _TransShadow;
  1799. #endif
  1800. #ifdef ASE_TESSELLATION
  1801. float _TessPhongStrength;
  1802. float _TessValue;
  1803. float _TessMin;
  1804. float _TessMax;
  1805. float _TessEdgeLength;
  1806. float _TessMaxDisp;
  1807. #endif
  1808. CBUFFER_END
  1809. #ifdef SCENEPICKINGPASS
  1810. float4 _SelectionID;
  1811. #endif
  1812. #ifdef SCENESELECTIONPASS
  1813. int _ObjectId;
  1814. int _PassValue;
  1815. #endif
  1816. sampler2D _NormalMap;
  1817. PackedVaryings VertexFunction( Attributes input )
  1818. {
  1819. PackedVaryings output = (PackedVaryings)0;
  1820. UNITY_SETUP_INSTANCE_ID(input);
  1821. UNITY_TRANSFER_INSTANCE_ID(input, output);
  1822. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  1823. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1824. float3 defaultVertexValue = input.positionOS.xyz;
  1825. #else
  1826. float3 defaultVertexValue = float3(0, 0, 0);
  1827. #endif
  1828. float3 vertexValue = defaultVertexValue;
  1829. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1830. input.positionOS.xyz = vertexValue;
  1831. #else
  1832. input.positionOS.xyz += vertexValue;
  1833. #endif
  1834. input.normalOS = input.normalOS;
  1835. input.tangentOS = input.tangentOS;
  1836. VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
  1837. float3 normalWS = TransformObjectToWorldNormal( input.normalOS );
  1838. float4 tangentWS = float4( TransformObjectToWorldDir( input.tangentOS.xyz ), input.tangentOS.w );
  1839. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1840. output.positionWS = vertexInput.positionWS;
  1841. #endif
  1842. output.worldNormal = normalWS;
  1843. output.worldTangent = tangentWS;
  1844. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1845. output.shadowCoord = GetShadowCoord( vertexInput );
  1846. #endif
  1847. output.positionCS = vertexInput.positionCS;
  1848. output.clipPosV = vertexInput.positionCS;
  1849. return output;
  1850. }
  1851. #if defined(ASE_TESSELLATION)
  1852. struct VertexControl
  1853. {
  1854. float4 vertex : INTERNALTESSPOS;
  1855. float3 normalOS : NORMAL;
  1856. float4 tangentOS : TANGENT;
  1857. UNITY_VERTEX_INPUT_INSTANCE_ID
  1858. };
  1859. struct TessellationFactors
  1860. {
  1861. float edge[3] : SV_TessFactor;
  1862. float inside : SV_InsideTessFactor;
  1863. };
  1864. VertexControl vert ( Attributes input )
  1865. {
  1866. VertexControl output;
  1867. UNITY_SETUP_INSTANCE_ID(input);
  1868. UNITY_TRANSFER_INSTANCE_ID(input, output);
  1869. output.vertex = input.positionOS;
  1870. output.normalOS = input.normalOS;
  1871. output.tangentOS = input.tangentOS;
  1872. return output;
  1873. }
  1874. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  1875. {
  1876. TessellationFactors output;
  1877. float4 tf = 1;
  1878. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1879. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1880. #if defined(ASE_FIXED_TESSELLATION)
  1881. tf = FixedTess( tessValue );
  1882. #elif defined(ASE_DISTANCE_TESSELLATION)
  1883. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1884. #elif defined(ASE_LENGTH_TESSELLATION)
  1885. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1886. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1887. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1888. #endif
  1889. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  1890. return output;
  1891. }
  1892. [domain("tri")]
  1893. [partitioning("fractional_odd")]
  1894. [outputtopology("triangle_cw")]
  1895. [patchconstantfunc("TessellationFunction")]
  1896. [outputcontrolpoints(3)]
  1897. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1898. {
  1899. return patch[id];
  1900. }
  1901. [domain("tri")]
  1902. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1903. {
  1904. Attributes output = (Attributes) 0;
  1905. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1906. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  1907. output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
  1908. #if defined(ASE_PHONG_TESSELLATION)
  1909. float3 pp[3];
  1910. for (int i = 0; i < 3; ++i)
  1911. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  1912. float phongStrength = _TessPhongStrength;
  1913. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  1914. #endif
  1915. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  1916. return VertexFunction(output);
  1917. }
  1918. #else
  1919. PackedVaryings vert ( Attributes input )
  1920. {
  1921. return VertexFunction( input );
  1922. }
  1923. #endif
  1924. void frag( PackedVaryings input
  1925. , out half4 outNormalWS : SV_Target0
  1926. #ifdef ASE_DEPTH_WRITE_ON
  1927. ,out float outputDepth : ASE_SV_DEPTH
  1928. #endif
  1929. #ifdef _WRITE_RENDERING_LAYERS
  1930. , out float4 outRenderingLayers : SV_Target1
  1931. #endif
  1932. )
  1933. {
  1934. UNITY_SETUP_INSTANCE_ID(input);
  1935. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
  1936. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  1937. float3 WorldPosition = input.positionWS;
  1938. #endif
  1939. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  1940. float3 WorldNormal = input.worldNormal;
  1941. float4 WorldTangent = input.worldTangent;
  1942. float4 ClipPos = input.clipPosV;
  1943. float4 ScreenPos = ComputeScreenPos( input.clipPosV );
  1944. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  1945. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  1946. ShadowCoords = input.shadowCoord;
  1947. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  1948. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  1949. #endif
  1950. #endif
  1951. float2 temp_output_24_0 = (WorldPosition).xz;
  1952. float2 appendResult31 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.x ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.y )));
  1953. float4 _UV1TilingXYScaleZW = float4(1,1,1,1);
  1954. float2 appendResult36 = (float2(_UV1TilingXYScaleZW.x , _UV1TilingXYScaleZW.y));
  1955. float2 appendResult38 = (float2(_UV1TilingXYScaleZW.z , _UV1TilingXYScaleZW.w));
  1956. float2 UV140 = ( ( ( temp_output_24_0 + appendResult31 ) * appendResult36 ) / appendResult38 );
  1957. float4 ase_screenPosNorm = ScreenPos / ScreenPos.w;
  1958. ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
  1959. float screenDepth78 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  1960. float distanceDepth78 = saturate( abs( ( screenDepth78 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DephFadeDistance ) ) );
  1961. float DephFade79 = distanceDepth78;
  1962. float3 unpack2 = UnpackNormalScale( tex2D( _NormalMap, UV140 ), ( _NS1 * DephFade79 ) );
  1963. unpack2.z = lerp( 1, unpack2.z, saturate(( _NS1 * DephFade79 )) );
  1964. float2 appendResult43 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.z ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.w )));
  1965. float2 appendResult49 = (float2(_UV2TilingXYScaleZW.x , _UV2TilingXYScaleZW.y));
  1966. float2 appendResult50 = (float2(_UV2TilingXYScaleZW.z , _UV2TilingXYScaleZW.w));
  1967. float2 UV247 = ( ( ( temp_output_24_0 + appendResult43 ) * appendResult49 ) / appendResult50 );
  1968. float3 unpack4 = UnpackNormalScale( tex2D( _NormalMap, UV247 ), ( _NS2 * DephFade79 ) );
  1969. unpack4.z = lerp( 1, unpack4.z, saturate(( _NS2 * DephFade79 )) );
  1970. float3 lerpResult8 = lerp( unpack2 , unpack4 , _LerpStrength);
  1971. float3 Normalmap12 = lerpResult8;
  1972. float3 Normal = Normalmap12;
  1973. float Alpha = 1;
  1974. float AlphaClipThreshold = 0.5;
  1975. #ifdef ASE_DEPTH_WRITE_ON
  1976. float DepthValue = input.positionCS.z;
  1977. #endif
  1978. #ifdef _ALPHATEST_ON
  1979. clip(Alpha - AlphaClipThreshold);
  1980. #endif
  1981. #if defined(LOD_FADE_CROSSFADE)
  1982. LODFadeCrossFade( input.positionCS );
  1983. #endif
  1984. #ifdef ASE_DEPTH_WRITE_ON
  1985. outputDepth = DepthValue;
  1986. #endif
  1987. #if defined(_GBUFFER_NORMALS_OCT)
  1988. float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal);
  1989. float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5);
  1990. half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS);
  1991. outNormalWS = half4(packedNormalWS, 0.0);
  1992. #else
  1993. #if defined(_NORMALMAP)
  1994. #if _NORMAL_DROPOFF_TS
  1995. float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
  1996. float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz);
  1997. float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz));
  1998. #elif _NORMAL_DROPOFF_OS
  1999. float3 normalWS = TransformObjectToWorldNormal(Normal);
  2000. #elif _NORMAL_DROPOFF_WS
  2001. float3 normalWS = Normal;
  2002. #endif
  2003. #else
  2004. float3 normalWS = WorldNormal;
  2005. #endif
  2006. outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0);
  2007. #endif
  2008. #ifdef _WRITE_RENDERING_LAYERS
  2009. uint renderingLayers = GetMeshRenderingLayer();
  2010. outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
  2011. #endif
  2012. }
  2013. ENDHLSL
  2014. }
  2015. Pass
  2016. {
  2017. Name "GBuffer"
  2018. Tags { "LightMode"="UniversalGBuffer" }
  2019. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  2020. ZWrite On
  2021. ZTest LEqual
  2022. Offset 0 , 0
  2023. ColorMask RGBA
  2024. HLSLPROGRAM
  2025. #pragma multi_compile_local_fragment _ALPHATEST_ON
  2026. #define _NORMAL_DROPOFF_TS 1
  2027. #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
  2028. #pragma multi_compile_instancing
  2029. #pragma instancing_options renderinglayer
  2030. #pragma multi_compile_fog
  2031. #define ASE_FOG 1
  2032. #define _SURFACE_TYPE_TRANSPARENT 1
  2033. #define _NORMALMAP 1
  2034. #define ASE_VERSION 19701
  2035. #define ASE_SRP_VERSION 170003
  2036. #define REQUIRE_DEPTH_TEXTURE 1
  2037. #define REQUIRE_OPAQUE_TEXTURE 1
  2038. #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
  2039. #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
  2040. #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
  2041. #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
  2042. #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  2043. #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
  2044. #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
  2045. #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
  2046. #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
  2047. #pragma multi_compile _ SHADOWS_SHADOWMASK
  2048. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  2049. #pragma multi_compile _ USE_LEGACY_LIGHTMAPS
  2050. #pragma multi_compile _ LIGHTMAP_ON
  2051. #pragma multi_compile _ DYNAMICLIGHTMAP_ON
  2052. #pragma multi_compile_fragment _ DEBUG_DISPLAY
  2053. #pragma vertex vert
  2054. #pragma fragment frag
  2055. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  2056. #define _SPECULAR_COLOR 1
  2057. #endif
  2058. #define SHADERPASS SHADERPASS_GBUFFER
  2059. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  2060. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
  2061. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
  2062. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  2063. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  2064. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  2065. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  2066. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  2067. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  2068. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  2069. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  2070. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  2071. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
  2072. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  2073. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  2074. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  2075. #if defined(LOD_FADE_CROSSFADE)
  2076. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  2077. #endif
  2078. #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
  2079. #define ENABLE_TERRAIN_PERPIXEL_NORMAL
  2080. #endif
  2081. #define ASE_NEEDS_FRAG_SCREEN_POSITION
  2082. #define ASE_NEEDS_FRAG_WORLD_POSITION
  2083. #define ASE_NEEDS_VERT_POSITION
  2084. #pragma shader_feature_local _REFLECTIONONOFF_ON
  2085. #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
  2086. #define ASE_SV_DEPTH SV_DepthLessEqual
  2087. #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
  2088. #else
  2089. #define ASE_SV_DEPTH SV_Depth
  2090. #define ASE_SV_POSITION_QUALIFIERS
  2091. #endif
  2092. struct Attributes
  2093. {
  2094. float4 positionOS : POSITION;
  2095. float3 normalOS : NORMAL;
  2096. float4 tangentOS : TANGENT;
  2097. float4 texcoord : TEXCOORD0;
  2098. float4 texcoord1 : TEXCOORD1;
  2099. float4 texcoord2 : TEXCOORD2;
  2100. UNITY_VERTEX_INPUT_INSTANCE_ID
  2101. };
  2102. struct PackedVaryings
  2103. {
  2104. ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
  2105. float4 clipPosV : TEXCOORD0;
  2106. float4 lightmapUVOrVertexSH : TEXCOORD1;
  2107. half4 fogFactorAndVertexLight : TEXCOORD2;
  2108. float4 tSpace0 : TEXCOORD3;
  2109. float4 tSpace1 : TEXCOORD4;
  2110. float4 tSpace2 : TEXCOORD5;
  2111. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  2112. float4 shadowCoord : TEXCOORD6;
  2113. #endif
  2114. #if defined(DYNAMICLIGHTMAP_ON)
  2115. float2 dynamicLightmapUV : TEXCOORD7;
  2116. #endif
  2117. #if defined(USE_APV_PROBE_OCCLUSION)
  2118. float4 probeOcclusion : TEXCOORD8;
  2119. #endif
  2120. float4 ase_texcoord9 : TEXCOORD9;
  2121. float3 ase_normal : NORMAL;
  2122. float4 ase_texcoord10 : TEXCOORD10;
  2123. UNITY_VERTEX_INPUT_INSTANCE_ID
  2124. UNITY_VERTEX_OUTPUT_STEREO
  2125. };
  2126. CBUFFER_START(UnityPerMaterial)
  2127. float4 _WaterfallColor2;
  2128. float4 _WaterfallColor;
  2129. float4 _AnimateUV1XYUV2ZW;
  2130. float4 _UV2TilingXYScaleZW;
  2131. float4 _MainColor;
  2132. float2 _WaterfallTiling;
  2133. float2 _WaterfallSpeed;
  2134. float2 _FoamTiling;
  2135. float _WaterfallFoamOnOff;
  2136. float _ReflectionIntensity;
  2137. float _ReflectionNormalScale;
  2138. float _AccurateNormalReflection;
  2139. float _FresnelPower;
  2140. float _LerpStrength;
  2141. float _NS2;
  2142. float _DephFadeDistance;
  2143. float _NS1;
  2144. float _FoamIntensity;
  2145. float _FoamFalloff;
  2146. float _FoamDepth;
  2147. float _Edgedistance;
  2148. float _EnergyConservation;
  2149. float _Smoothness;
  2150. #ifdef ASE_TRANSMISSION
  2151. float _TransmissionShadow;
  2152. #endif
  2153. #ifdef ASE_TRANSLUCENCY
  2154. float _TransStrength;
  2155. float _TransNormal;
  2156. float _TransScattering;
  2157. float _TransDirect;
  2158. float _TransAmbient;
  2159. float _TransShadow;
  2160. #endif
  2161. #ifdef ASE_TESSELLATION
  2162. float _TessPhongStrength;
  2163. float _TessValue;
  2164. float _TessMin;
  2165. float _TessMax;
  2166. float _TessEdgeLength;
  2167. float _TessMaxDisp;
  2168. #endif
  2169. CBUFFER_END
  2170. #ifdef SCENEPICKINGPASS
  2171. float4 _SelectionID;
  2172. #endif
  2173. #ifdef SCENESELECTIONPASS
  2174. int _ObjectId;
  2175. int _PassValue;
  2176. #endif
  2177. sampler2D _Foam;
  2178. sampler2D _NormalMap;
  2179. sampler2D _ReflectionTex;
  2180. sampler2D _WaterfallFoam;
  2181. sampler2D _WaterfallFoam2;
  2182. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl"
  2183. PackedVaryings VertexFunction( Attributes input )
  2184. {
  2185. PackedVaryings output = (PackedVaryings)0;
  2186. UNITY_SETUP_INSTANCE_ID(input);
  2187. UNITY_TRANSFER_INSTANCE_ID(input, output);
  2188. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  2189. float3 objectToViewPos = TransformWorldToView(TransformObjectToWorld(input.positionOS.xyz));
  2190. float eyeDepth = -objectToViewPos.z;
  2191. output.ase_texcoord9.x = eyeDepth;
  2192. output.ase_normal = input.normalOS;
  2193. output.ase_texcoord10 = input.positionOS;
  2194. //setting value to unused interpolator channels and avoid initialization warnings
  2195. output.ase_texcoord9.yzw = 0;
  2196. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2197. float3 defaultVertexValue = input.positionOS.xyz;
  2198. #else
  2199. float3 defaultVertexValue = float3(0, 0, 0);
  2200. #endif
  2201. float3 vertexValue = defaultVertexValue;
  2202. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2203. input.positionOS.xyz = vertexValue;
  2204. #else
  2205. input.positionOS.xyz += vertexValue;
  2206. #endif
  2207. input.normalOS = input.normalOS;
  2208. input.tangentOS = input.tangentOS;
  2209. VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
  2210. VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS );
  2211. output.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x);
  2212. output.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y);
  2213. output.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z);
  2214. #if defined(LIGHTMAP_ON)
  2215. OUTPUT_LIGHTMAP_UV(input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy);
  2216. #endif
  2217. #if defined(DYNAMICLIGHTMAP_ON)
  2218. output.dynamicLightmapUV.xy = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
  2219. #endif
  2220. OUTPUT_SH4( vertexInput.positionWS, normalInput.normalWS.xyz, GetWorldSpaceNormalizeViewDir( vertexInput.positionWS ), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion );
  2221. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  2222. output.lightmapUVOrVertexSH.zw = input.texcoord.xy;
  2223. output.lightmapUVOrVertexSH.xy = input.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
  2224. #endif
  2225. half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
  2226. output.fogFactorAndVertexLight = half4(0, vertexLight);
  2227. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  2228. output.shadowCoord = GetShadowCoord( vertexInput );
  2229. #endif
  2230. output.positionCS = vertexInput.positionCS;
  2231. output.clipPosV = vertexInput.positionCS;
  2232. return output;
  2233. }
  2234. #if defined(ASE_TESSELLATION)
  2235. struct VertexControl
  2236. {
  2237. float4 vertex : INTERNALTESSPOS;
  2238. float3 normalOS : NORMAL;
  2239. float4 tangentOS : TANGENT;
  2240. float4 texcoord : TEXCOORD0;
  2241. float4 texcoord1 : TEXCOORD1;
  2242. float4 texcoord2 : TEXCOORD2;
  2243. UNITY_VERTEX_INPUT_INSTANCE_ID
  2244. };
  2245. struct TessellationFactors
  2246. {
  2247. float edge[3] : SV_TessFactor;
  2248. float inside : SV_InsideTessFactor;
  2249. };
  2250. VertexControl vert ( Attributes input )
  2251. {
  2252. VertexControl output;
  2253. UNITY_SETUP_INSTANCE_ID(input);
  2254. UNITY_TRANSFER_INSTANCE_ID(input, output);
  2255. output.vertex = input.positionOS;
  2256. output.normalOS = input.normalOS;
  2257. output.tangentOS = input.tangentOS;
  2258. output.texcoord = input.texcoord;
  2259. output.texcoord1 = input.texcoord1;
  2260. output.texcoord2 = input.texcoord2;
  2261. return output;
  2262. }
  2263. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  2264. {
  2265. TessellationFactors output;
  2266. float4 tf = 1;
  2267. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  2268. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  2269. #if defined(ASE_FIXED_TESSELLATION)
  2270. tf = FixedTess( tessValue );
  2271. #elif defined(ASE_DISTANCE_TESSELLATION)
  2272. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  2273. #elif defined(ASE_LENGTH_TESSELLATION)
  2274. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  2275. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  2276. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  2277. #endif
  2278. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  2279. return output;
  2280. }
  2281. [domain("tri")]
  2282. [partitioning("fractional_odd")]
  2283. [outputtopology("triangle_cw")]
  2284. [patchconstantfunc("TessellationFunction")]
  2285. [outputcontrolpoints(3)]
  2286. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  2287. {
  2288. return patch[id];
  2289. }
  2290. [domain("tri")]
  2291. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  2292. {
  2293. Attributes output = (Attributes) 0;
  2294. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  2295. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  2296. output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
  2297. output.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
  2298. output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
  2299. output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
  2300. #if defined(ASE_PHONG_TESSELLATION)
  2301. float3 pp[3];
  2302. for (int i = 0; i < 3; ++i)
  2303. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  2304. float phongStrength = _TessPhongStrength;
  2305. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  2306. #endif
  2307. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  2308. return VertexFunction(output);
  2309. }
  2310. #else
  2311. PackedVaryings vert ( Attributes input )
  2312. {
  2313. return VertexFunction( input );
  2314. }
  2315. #endif
  2316. FragmentOutput frag ( PackedVaryings input
  2317. #ifdef ASE_DEPTH_WRITE_ON
  2318. ,out float outputDepth : ASE_SV_DEPTH
  2319. #endif
  2320. )
  2321. {
  2322. UNITY_SETUP_INSTANCE_ID(input);
  2323. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
  2324. #if defined(LOD_FADE_CROSSFADE)
  2325. LODFadeCrossFade( input.positionCS );
  2326. #endif
  2327. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  2328. float2 sampleCoords = (input.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
  2329. float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
  2330. float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
  2331. float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
  2332. #else
  2333. float3 WorldNormal = normalize( input.tSpace0.xyz );
  2334. float3 WorldTangent = input.tSpace1.xyz;
  2335. float3 WorldBiTangent = input.tSpace2.xyz;
  2336. #endif
  2337. float3 WorldPosition = float3(input.tSpace0.w,input.tSpace1.w,input.tSpace2.w);
  2338. float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
  2339. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  2340. float4 ClipPos = input.clipPosV;
  2341. float4 ScreenPos = ComputeScreenPos( input.clipPosV );
  2342. float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
  2343. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  2344. ShadowCoords = input.shadowCoord;
  2345. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  2346. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  2347. #else
  2348. ShadowCoords = float4(0, 0, 0, 0);
  2349. #endif
  2350. WorldViewDirection = SafeNormalize( WorldViewDirection );
  2351. float4 ase_screenPosNorm = ScreenPos / ScreenPos.w;
  2352. ase_screenPosNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_screenPosNorm.z : ase_screenPosNorm.z * 0.5 + 0.5;
  2353. float screenDepth127 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  2354. float distanceDepth127 = abs( ( screenDepth127 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _Edgedistance ) );
  2355. float temp_output_128_0 = ( 1.0 - distanceDepth127 );
  2356. float2 appendResult205 = (float2(( _FoamTiling.x * WorldPosition.x ) , ( _FoamTiling.y * WorldPosition.z )));
  2357. float2 panner152 = ( 1.0 * _Time.y * float2( -0.01,0.01 ) + appendResult205);
  2358. float clampResult132 = clamp( ( ( temp_output_128_0 * 1.0 ) * ( saturate( pow( abs( ( temp_output_128_0 + _FoamDepth ) ) , _FoamFalloff ) ) * tex2D( _Foam, panner152 ).r * _FoamIntensity ) ) , 0.0 , 1.0 );
  2359. float Edge131 = clampResult132;
  2360. float2 appendResult7 = (float2(ase_screenPosNorm.x , ase_screenPosNorm.y));
  2361. float2 temp_output_24_0 = (WorldPosition).xz;
  2362. float2 appendResult31 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.x ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.y )));
  2363. float4 _UV1TilingXYScaleZW = float4(1,1,1,1);
  2364. float2 appendResult36 = (float2(_UV1TilingXYScaleZW.x , _UV1TilingXYScaleZW.y));
  2365. float2 appendResult38 = (float2(_UV1TilingXYScaleZW.z , _UV1TilingXYScaleZW.w));
  2366. float2 UV140 = ( ( ( temp_output_24_0 + appendResult31 ) * appendResult36 ) / appendResult38 );
  2367. float screenDepth78 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_screenPosNorm.xy ),_ZBufferParams);
  2368. float distanceDepth78 = saturate( abs( ( screenDepth78 - LinearEyeDepth( ase_screenPosNorm.z,_ZBufferParams ) ) / ( _DephFadeDistance ) ) );
  2369. float DephFade79 = distanceDepth78;
  2370. float3 unpack2 = UnpackNormalScale( tex2D( _NormalMap, UV140 ), ( _NS1 * DephFade79 ) );
  2371. unpack2.z = lerp( 1, unpack2.z, saturate(( _NS1 * DephFade79 )) );
  2372. float2 appendResult43 = (float2(( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.z ) , ( ( _TimeParameters.x * 0.05 ) * _AnimateUV1XYUV2ZW.w )));
  2373. float2 appendResult49 = (float2(_UV2TilingXYScaleZW.x , _UV2TilingXYScaleZW.y));
  2374. float2 appendResult50 = (float2(_UV2TilingXYScaleZW.z , _UV2TilingXYScaleZW.w));
  2375. float2 UV247 = ( ( ( temp_output_24_0 + appendResult43 ) * appendResult49 ) / appendResult50 );
  2376. float3 unpack4 = UnpackNormalScale( tex2D( _NormalMap, UV247 ), ( _NS2 * DephFade79 ) );
  2377. unpack4.z = lerp( 1, unpack4.z, saturate(( _NS2 * DephFade79 )) );
  2378. float3 lerpResult8 = lerp( unpack2 , unpack4 , _LerpStrength);
  2379. float3 Normalmap12 = lerpResult8;
  2380. float2 ScreenUV20 = ( appendResult7 - ( (Normalmap12).xy * 0.1 ) );
  2381. float eyeDepth220 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( float4( ScreenUV20, 0.0 , 0.0 ).xy ),_ZBufferParams);
  2382. float eyeDepth = input.ase_texcoord9.x;
  2383. float ifLocalVar224 = 0;
  2384. if( eyeDepth220 > eyeDepth )
  2385. ifLocalVar224 = 1.0;
  2386. else if( eyeDepth220 < eyeDepth )
  2387. ifLocalVar224 = 0.0;
  2388. float4 fetchOpaqueVal1 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( ScreenUV20 * ifLocalVar224 ) ), 1.0 );
  2389. float3 ase_viewVectorWS = ( _WorldSpaceCameraPos.xyz - WorldPosition );
  2390. float3 ase_viewDirWS = normalize( ase_viewVectorWS );
  2391. float dotResult62 = dot( ase_viewDirWS , input.ase_normal );
  2392. float Fresnel68 = pow( abs( ( 1.0 - saturate( abs( dotResult62 ) ) ) ) , _FresnelPower );
  2393. float4 lerpResult55 = lerp( fetchOpaqueVal1 , _MainColor , ( Fresnel68 * DephFade79 ));
  2394. float4 temp_output_134_0 = ( Edge131 + lerpResult55 );
  2395. float4 unityObjectToClipPos185 = TransformWorldToHClip(TransformObjectToWorld(( input.ase_texcoord10.xyz + float3( 0,0,0 ) )));
  2396. float4 computeScreenPos189 = ComputeScreenPos( unityObjectToClipPos185 );
  2397. computeScreenPos189 = computeScreenPos189 / computeScreenPos189.w;
  2398. computeScreenPos189.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? computeScreenPos189.z : computeScreenPos189.z* 0.5 + 0.5;
  2399. float ReflectionNormalWarp197 = _NS2;
  2400. float4 Reflections191 = tex2D( _ReflectionTex, ( computeScreenPos189 + float4( ( Normalmap12 * (( _AccurateNormalReflection )?( ReflectionNormalWarp197 ):( _ReflectionNormalScale )) ) , 0.0 ) ).xy );
  2401. float4 lerpResult196 = lerp( temp_output_134_0 , Reflections191 , _ReflectionIntensity);
  2402. #ifdef _REFLECTIONONOFF_ON
  2403. float4 staticSwitch208 = lerpResult196;
  2404. #else
  2405. float4 staticSwitch208 = temp_output_134_0;
  2406. #endif
  2407. float2 appendResult243 = (float2(( _WaterfallTiling.x * WorldPosition.x ) , ( _WaterfallTiling.y * WorldPosition.z )));
  2408. float2 panner228 = ( ( _TimeParameters.x ) * _WaterfallSpeed + appendResult243);
  2409. float3 BaseColor = (( _WaterfallFoamOnOff )?( ( ( ( _WaterfallColor * tex2D( _WaterfallFoam, panner228 ) ) + ( _WaterfallColor2 * tex2D( _WaterfallFoam2, panner228 ) ) ) + staticSwitch208 ) ):( staticSwitch208 )).rgb;
  2410. float3 Normal = Normalmap12;
  2411. float3 Emission = 0;
  2412. float3 Specular = 0.5;
  2413. float Metallic = _EnergyConservation;
  2414. float Smoothness = _Smoothness;
  2415. float Occlusion = 1;
  2416. float Alpha = 1;
  2417. float AlphaClipThreshold = 0.5;
  2418. float AlphaClipThresholdShadow = 0.5;
  2419. float3 BakedGI = 0;
  2420. float3 RefractionColor = 1;
  2421. float RefractionIndex = 1;
  2422. float3 Transmission = 1;
  2423. float3 Translucency = 1;
  2424. #ifdef ASE_DEPTH_WRITE_ON
  2425. float DepthValue = input.positionCS.z;
  2426. #endif
  2427. #ifdef _ALPHATEST_ON
  2428. clip(Alpha - AlphaClipThreshold);
  2429. #endif
  2430. InputData inputData = (InputData)0;
  2431. inputData.positionWS = WorldPosition;
  2432. inputData.positionCS = input.positionCS;
  2433. inputData.shadowCoord = ShadowCoords;
  2434. #ifdef _NORMALMAP
  2435. #if _NORMAL_DROPOFF_TS
  2436. inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal ));
  2437. #elif _NORMAL_DROPOFF_OS
  2438. inputData.normalWS = TransformObjectToWorldNormal(Normal);
  2439. #elif _NORMAL_DROPOFF_WS
  2440. inputData.normalWS = Normal;
  2441. #endif
  2442. #else
  2443. inputData.normalWS = WorldNormal;
  2444. #endif
  2445. inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
  2446. inputData.viewDirectionWS = SafeNormalize( WorldViewDirection );
  2447. inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
  2448. #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
  2449. float3 SH = SampleSH(inputData.normalWS.xyz);
  2450. #else
  2451. float3 SH = input.lightmapUVOrVertexSH.xyz;
  2452. #endif
  2453. #if defined(DYNAMICLIGHTMAP_ON)
  2454. inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS);
  2455. inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
  2456. #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
  2457. inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS),
  2458. inputData.normalWS,
  2459. inputData.viewDirectionWS,
  2460. input.positionCS.xy,
  2461. input.probeOcclusion,
  2462. inputData.shadowMask );
  2463. #else
  2464. inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
  2465. inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
  2466. #endif
  2467. #ifdef ASE_BAKEDGI
  2468. inputData.bakedGI = BakedGI;
  2469. #endif
  2470. inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
  2471. #if defined(DEBUG_DISPLAY)
  2472. #if defined(DYNAMICLIGHTMAP_ON)
  2473. inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy;
  2474. #endif
  2475. #if defined(LIGHTMAP_ON)
  2476. inputData.staticLightmapUV = input.lightmapUVOrVertexSH.xy;
  2477. #else
  2478. inputData.vertexSH = SH;
  2479. #endif
  2480. #if defined(USE_APV_PROBE_OCCLUSION)
  2481. inputData.probeOcclusion = input.probeOcclusion;
  2482. #endif
  2483. #endif
  2484. #ifdef _DBUFFER
  2485. ApplyDecal(input.positionCS,
  2486. BaseColor,
  2487. Specular,
  2488. inputData.normalWS,
  2489. Metallic,
  2490. Occlusion,
  2491. Smoothness);
  2492. #endif
  2493. BRDFData brdfData;
  2494. InitializeBRDFData
  2495. (BaseColor, Metallic, Specular, Smoothness, Alpha, brdfData);
  2496. Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask);
  2497. half4 color;
  2498. MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask);
  2499. color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS);
  2500. color.a = Alpha;
  2501. #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
  2502. color.rgb *= color.a;
  2503. #endif
  2504. #ifdef ASE_DEPTH_WRITE_ON
  2505. outputDepth = DepthValue;
  2506. #endif
  2507. return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb, Occlusion);
  2508. }
  2509. ENDHLSL
  2510. }
  2511. Pass
  2512. {
  2513. Name "SceneSelectionPass"
  2514. Tags { "LightMode"="SceneSelectionPass" }
  2515. Cull Off
  2516. AlphaToMask Off
  2517. HLSLPROGRAM
  2518. #pragma multi_compile_local_fragment _ALPHATEST_ON
  2519. #define _NORMAL_DROPOFF_TS 1
  2520. #define ASE_FOG 1
  2521. #define _SURFACE_TYPE_TRANSPARENT 1
  2522. #define _NORMALMAP 1
  2523. #define ASE_VERSION 19701
  2524. #define ASE_SRP_VERSION 170003
  2525. #pragma vertex vert
  2526. #pragma fragment frag
  2527. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  2528. #define _SPECULAR_COLOR 1
  2529. #endif
  2530. #define SCENESELECTIONPASS 1
  2531. #define ATTRIBUTES_NEED_NORMAL
  2532. #define ATTRIBUTES_NEED_TANGENT
  2533. #define SHADERPASS SHADERPASS_DEPTHONLY
  2534. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  2535. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  2536. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  2537. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  2538. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  2539. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  2540. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  2541. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  2542. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  2543. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  2544. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  2545. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  2546. struct Attributes
  2547. {
  2548. float4 positionOS : POSITION;
  2549. float3 normalOS : NORMAL;
  2550. UNITY_VERTEX_INPUT_INSTANCE_ID
  2551. };
  2552. struct PackedVaryings
  2553. {
  2554. float4 positionCS : SV_POSITION;
  2555. UNITY_VERTEX_INPUT_INSTANCE_ID
  2556. UNITY_VERTEX_OUTPUT_STEREO
  2557. };
  2558. CBUFFER_START(UnityPerMaterial)
  2559. float4 _WaterfallColor2;
  2560. float4 _WaterfallColor;
  2561. float4 _AnimateUV1XYUV2ZW;
  2562. float4 _UV2TilingXYScaleZW;
  2563. float4 _MainColor;
  2564. float2 _WaterfallTiling;
  2565. float2 _WaterfallSpeed;
  2566. float2 _FoamTiling;
  2567. float _WaterfallFoamOnOff;
  2568. float _ReflectionIntensity;
  2569. float _ReflectionNormalScale;
  2570. float _AccurateNormalReflection;
  2571. float _FresnelPower;
  2572. float _LerpStrength;
  2573. float _NS2;
  2574. float _DephFadeDistance;
  2575. float _NS1;
  2576. float _FoamIntensity;
  2577. float _FoamFalloff;
  2578. float _FoamDepth;
  2579. float _Edgedistance;
  2580. float _EnergyConservation;
  2581. float _Smoothness;
  2582. #ifdef ASE_TRANSMISSION
  2583. float _TransmissionShadow;
  2584. #endif
  2585. #ifdef ASE_TRANSLUCENCY
  2586. float _TransStrength;
  2587. float _TransNormal;
  2588. float _TransScattering;
  2589. float _TransDirect;
  2590. float _TransAmbient;
  2591. float _TransShadow;
  2592. #endif
  2593. #ifdef ASE_TESSELLATION
  2594. float _TessPhongStrength;
  2595. float _TessValue;
  2596. float _TessMin;
  2597. float _TessMax;
  2598. float _TessEdgeLength;
  2599. float _TessMaxDisp;
  2600. #endif
  2601. CBUFFER_END
  2602. #ifdef SCENEPICKINGPASS
  2603. float4 _SelectionID;
  2604. #endif
  2605. #ifdef SCENESELECTIONPASS
  2606. int _ObjectId;
  2607. int _PassValue;
  2608. #endif
  2609. struct SurfaceDescription
  2610. {
  2611. float Alpha;
  2612. float AlphaClipThreshold;
  2613. };
  2614. PackedVaryings VertexFunction(Attributes input )
  2615. {
  2616. PackedVaryings output;
  2617. ZERO_INITIALIZE(PackedVaryings, output);
  2618. UNITY_SETUP_INSTANCE_ID(input);
  2619. UNITY_TRANSFER_INSTANCE_ID(input, output);
  2620. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  2621. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2622. float3 defaultVertexValue = input.positionOS.xyz;
  2623. #else
  2624. float3 defaultVertexValue = float3(0, 0, 0);
  2625. #endif
  2626. float3 vertexValue = defaultVertexValue;
  2627. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2628. input.positionOS.xyz = vertexValue;
  2629. #else
  2630. input.positionOS.xyz += vertexValue;
  2631. #endif
  2632. input.normalOS = input.normalOS;
  2633. float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
  2634. output.positionCS = TransformWorldToHClip(positionWS);
  2635. return output;
  2636. }
  2637. #if defined(ASE_TESSELLATION)
  2638. struct VertexControl
  2639. {
  2640. float4 vertex : INTERNALTESSPOS;
  2641. float3 normalOS : NORMAL;
  2642. UNITY_VERTEX_INPUT_INSTANCE_ID
  2643. };
  2644. struct TessellationFactors
  2645. {
  2646. float edge[3] : SV_TessFactor;
  2647. float inside : SV_InsideTessFactor;
  2648. };
  2649. VertexControl vert ( Attributes input )
  2650. {
  2651. VertexControl output;
  2652. UNITY_SETUP_INSTANCE_ID(input);
  2653. UNITY_TRANSFER_INSTANCE_ID(input, output);
  2654. output.vertex = input.positionOS;
  2655. output.normalOS = input.normalOS;
  2656. return output;
  2657. }
  2658. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  2659. {
  2660. TessellationFactors output;
  2661. float4 tf = 1;
  2662. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  2663. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  2664. #if defined(ASE_FIXED_TESSELLATION)
  2665. tf = FixedTess( tessValue );
  2666. #elif defined(ASE_DISTANCE_TESSELLATION)
  2667. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  2668. #elif defined(ASE_LENGTH_TESSELLATION)
  2669. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  2670. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  2671. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  2672. #endif
  2673. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  2674. return output;
  2675. }
  2676. [domain("tri")]
  2677. [partitioning("fractional_odd")]
  2678. [outputtopology("triangle_cw")]
  2679. [patchconstantfunc("TessellationFunction")]
  2680. [outputcontrolpoints(3)]
  2681. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  2682. {
  2683. return patch[id];
  2684. }
  2685. [domain("tri")]
  2686. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  2687. {
  2688. Attributes output = (Attributes) 0;
  2689. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  2690. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  2691. #if defined(ASE_PHONG_TESSELLATION)
  2692. float3 pp[3];
  2693. for (int i = 0; i < 3; ++i)
  2694. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  2695. float phongStrength = _TessPhongStrength;
  2696. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  2697. #endif
  2698. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  2699. return VertexFunction(output);
  2700. }
  2701. #else
  2702. PackedVaryings vert ( Attributes input )
  2703. {
  2704. return VertexFunction( input );
  2705. }
  2706. #endif
  2707. half4 frag(PackedVaryings input ) : SV_TARGET
  2708. {
  2709. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  2710. surfaceDescription.Alpha = 1;
  2711. surfaceDescription.AlphaClipThreshold = 0.5;
  2712. #if _ALPHATEST_ON
  2713. float alphaClipThreshold = 0.01f;
  2714. #if ALPHA_CLIP_THRESHOLD
  2715. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  2716. #endif
  2717. clip(surfaceDescription.Alpha - alphaClipThreshold);
  2718. #endif
  2719. half4 outColor = 0;
  2720. #ifdef SCENESELECTIONPASS
  2721. outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  2722. #elif defined(SCENEPICKINGPASS)
  2723. outColor = _SelectionID;
  2724. #endif
  2725. return outColor;
  2726. }
  2727. ENDHLSL
  2728. }
  2729. Pass
  2730. {
  2731. Name "ScenePickingPass"
  2732. Tags { "LightMode"="Picking" }
  2733. AlphaToMask Off
  2734. HLSLPROGRAM
  2735. #pragma multi_compile_local_fragment _ALPHATEST_ON
  2736. #define _NORMAL_DROPOFF_TS 1
  2737. #define ASE_FOG 1
  2738. #define _SURFACE_TYPE_TRANSPARENT 1
  2739. #define _NORMALMAP 1
  2740. #define ASE_VERSION 19701
  2741. #define ASE_SRP_VERSION 170003
  2742. #pragma vertex vert
  2743. #pragma fragment frag
  2744. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  2745. #define _SPECULAR_COLOR 1
  2746. #endif
  2747. #define SCENEPICKINGPASS 1
  2748. #define ATTRIBUTES_NEED_NORMAL
  2749. #define ATTRIBUTES_NEED_TANGENT
  2750. #define SHADERPASS SHADERPASS_DEPTHONLY
  2751. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  2752. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  2753. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  2754. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  2755. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  2756. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  2757. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  2758. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  2759. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  2760. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  2761. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  2762. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  2763. struct Attributes
  2764. {
  2765. float4 positionOS : POSITION;
  2766. float3 normalOS : NORMAL;
  2767. UNITY_VERTEX_INPUT_INSTANCE_ID
  2768. };
  2769. struct PackedVaryings
  2770. {
  2771. float4 positionCS : SV_POSITION;
  2772. UNITY_VERTEX_INPUT_INSTANCE_ID
  2773. UNITY_VERTEX_OUTPUT_STEREO
  2774. };
  2775. CBUFFER_START(UnityPerMaterial)
  2776. float4 _WaterfallColor2;
  2777. float4 _WaterfallColor;
  2778. float4 _AnimateUV1XYUV2ZW;
  2779. float4 _UV2TilingXYScaleZW;
  2780. float4 _MainColor;
  2781. float2 _WaterfallTiling;
  2782. float2 _WaterfallSpeed;
  2783. float2 _FoamTiling;
  2784. float _WaterfallFoamOnOff;
  2785. float _ReflectionIntensity;
  2786. float _ReflectionNormalScale;
  2787. float _AccurateNormalReflection;
  2788. float _FresnelPower;
  2789. float _LerpStrength;
  2790. float _NS2;
  2791. float _DephFadeDistance;
  2792. float _NS1;
  2793. float _FoamIntensity;
  2794. float _FoamFalloff;
  2795. float _FoamDepth;
  2796. float _Edgedistance;
  2797. float _EnergyConservation;
  2798. float _Smoothness;
  2799. #ifdef ASE_TRANSMISSION
  2800. float _TransmissionShadow;
  2801. #endif
  2802. #ifdef ASE_TRANSLUCENCY
  2803. float _TransStrength;
  2804. float _TransNormal;
  2805. float _TransScattering;
  2806. float _TransDirect;
  2807. float _TransAmbient;
  2808. float _TransShadow;
  2809. #endif
  2810. #ifdef ASE_TESSELLATION
  2811. float _TessPhongStrength;
  2812. float _TessValue;
  2813. float _TessMin;
  2814. float _TessMax;
  2815. float _TessEdgeLength;
  2816. float _TessMaxDisp;
  2817. #endif
  2818. CBUFFER_END
  2819. #ifdef SCENEPICKINGPASS
  2820. float4 _SelectionID;
  2821. #endif
  2822. #ifdef SCENESELECTIONPASS
  2823. int _ObjectId;
  2824. int _PassValue;
  2825. #endif
  2826. struct SurfaceDescription
  2827. {
  2828. float Alpha;
  2829. float AlphaClipThreshold;
  2830. };
  2831. PackedVaryings VertexFunction(Attributes input )
  2832. {
  2833. PackedVaryings output;
  2834. ZERO_INITIALIZE(PackedVaryings, output);
  2835. UNITY_SETUP_INSTANCE_ID(input);
  2836. UNITY_TRANSFER_INSTANCE_ID(input, output);
  2837. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  2838. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2839. float3 defaultVertexValue = input.positionOS.xyz;
  2840. #else
  2841. float3 defaultVertexValue = float3(0, 0, 0);
  2842. #endif
  2843. float3 vertexValue = defaultVertexValue;
  2844. #ifdef ASE_ABSOLUTE_VERTEX_POS
  2845. input.positionOS.xyz = vertexValue;
  2846. #else
  2847. input.positionOS.xyz += vertexValue;
  2848. #endif
  2849. input.normalOS = input.normalOS;
  2850. float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
  2851. output.positionCS = TransformWorldToHClip(positionWS);
  2852. return output;
  2853. }
  2854. #if defined(ASE_TESSELLATION)
  2855. struct VertexControl
  2856. {
  2857. float4 vertex : INTERNALTESSPOS;
  2858. float3 normalOS : NORMAL;
  2859. UNITY_VERTEX_INPUT_INSTANCE_ID
  2860. };
  2861. struct TessellationFactors
  2862. {
  2863. float edge[3] : SV_TessFactor;
  2864. float inside : SV_InsideTessFactor;
  2865. };
  2866. VertexControl vert ( Attributes input )
  2867. {
  2868. VertexControl output;
  2869. UNITY_SETUP_INSTANCE_ID(input);
  2870. UNITY_TRANSFER_INSTANCE_ID(input, output);
  2871. output.vertex = input.positionOS;
  2872. output.normalOS = input.normalOS;
  2873. return output;
  2874. }
  2875. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
  2876. {
  2877. TessellationFactors output;
  2878. float4 tf = 1;
  2879. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  2880. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  2881. #if defined(ASE_FIXED_TESSELLATION)
  2882. tf = FixedTess( tessValue );
  2883. #elif defined(ASE_DISTANCE_TESSELLATION)
  2884. tf = DistanceBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  2885. #elif defined(ASE_LENGTH_TESSELLATION)
  2886. tf = EdgeLengthBasedTess(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  2887. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  2888. tf = EdgeLengthBasedTessCull(input[0].vertex, input[1].vertex, input[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  2889. #endif
  2890. output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
  2891. return output;
  2892. }
  2893. [domain("tri")]
  2894. [partitioning("fractional_odd")]
  2895. [outputtopology("triangle_cw")]
  2896. [patchconstantfunc("TessellationFunction")]
  2897. [outputcontrolpoints(3)]
  2898. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  2899. {
  2900. return patch[id];
  2901. }
  2902. [domain("tri")]
  2903. PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  2904. {
  2905. Attributes output = (Attributes) 0;
  2906. output.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  2907. output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
  2908. #if defined(ASE_PHONG_TESSELLATION)
  2909. float3 pp[3];
  2910. for (int i = 0; i < 3; ++i)
  2911. pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
  2912. float phongStrength = _TessPhongStrength;
  2913. output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
  2914. #endif
  2915. UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
  2916. return VertexFunction(output);
  2917. }
  2918. #else
  2919. PackedVaryings vert ( Attributes input )
  2920. {
  2921. return VertexFunction( input );
  2922. }
  2923. #endif
  2924. half4 frag(PackedVaryings input ) : SV_TARGET
  2925. {
  2926. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  2927. surfaceDescription.Alpha = 1;
  2928. surfaceDescription.AlphaClipThreshold = 0.5;
  2929. #if _ALPHATEST_ON
  2930. float alphaClipThreshold = 0.01f;
  2931. #if ALPHA_CLIP_THRESHOLD
  2932. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  2933. #endif
  2934. clip(surfaceDescription.Alpha - alphaClipThreshold);
  2935. #endif
  2936. half4 outColor = 0;
  2937. #ifdef SCENESELECTIONPASS
  2938. outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  2939. #elif defined(SCENEPICKINGPASS)
  2940. outColor = _SelectionID;
  2941. #endif
  2942. return outColor;
  2943. }
  2944. ENDHLSL
  2945. }
  2946. Pass
  2947. {
  2948. Name "MotionVectors"
  2949. Tags { "LightMode"="MotionVectors" }
  2950. ColorMask RG
  2951. HLSLPROGRAM
  2952. #pragma multi_compile_local_fragment _ALPHATEST_ON
  2953. #define _NORMAL_DROPOFF_TS 1
  2954. #pragma multi_compile_instancing
  2955. #define ASE_FOG 1
  2956. #define _SURFACE_TYPE_TRANSPARENT 1
  2957. #define _NORMALMAP 1
  2958. #define ASE_VERSION 19701
  2959. #define ASE_SRP_VERSION 170003
  2960. #pragma vertex vert
  2961. #pragma fragment frag
  2962. #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
  2963. #define _SPECULAR_COLOR 1
  2964. #endif
  2965. #define SHADERPASS SHADERPASS_MOTION_VECTORS
  2966. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
  2967. #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
  2968. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  2969. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  2970. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  2971. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  2972. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  2973. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  2974. #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
  2975. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
  2976. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
  2977. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  2978. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  2979. #if defined(LOD_FADE_CROSSFADE)
  2980. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
  2981. #endif
  2982. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MotionVectorsCommon.hlsl"
  2983. struct Attributes
  2984. {
  2985. float4 positionOS : POSITION;
  2986. float3 positionOld : TEXCOORD4;
  2987. #if _ADD_PRECOMPUTED_VELOCITY
  2988. float3 alembicMotionVector : TEXCOORD5;
  2989. #endif
  2990. UNITY_VERTEX_INPUT_INSTANCE_ID
  2991. };
  2992. struct PackedVaryings
  2993. {
  2994. float4 positionCS : SV_POSITION;
  2995. float4 positionCSNoJitter : TEXCOORD0;
  2996. float4 previousPositionCSNoJitter : TEXCOORD1;
  2997. UNITY_VERTEX_INPUT_INSTANCE_ID
  2998. UNITY_VERTEX_OUTPUT_STEREO
  2999. };
  3000. CBUFFER_START(UnityPerMaterial)
  3001. float4 _WaterfallColor2;
  3002. float4 _WaterfallColor;
  3003. float4 _AnimateUV1XYUV2ZW;
  3004. float4 _UV2TilingXYScaleZW;
  3005. float4 _MainColor;
  3006. float2 _WaterfallTiling;
  3007. float2 _WaterfallSpeed;
  3008. float2 _FoamTiling;
  3009. float _WaterfallFoamOnOff;
  3010. float _ReflectionIntensity;
  3011. float _ReflectionNormalScale;
  3012. float _AccurateNormalReflection;
  3013. float _FresnelPower;
  3014. float _LerpStrength;
  3015. float _NS2;
  3016. float _DephFadeDistance;
  3017. float _NS1;
  3018. float _FoamIntensity;
  3019. float _FoamFalloff;
  3020. float _FoamDepth;
  3021. float _Edgedistance;
  3022. float _EnergyConservation;
  3023. float _Smoothness;
  3024. #ifdef ASE_TRANSMISSION
  3025. float _TransmissionShadow;
  3026. #endif
  3027. #ifdef ASE_TRANSLUCENCY
  3028. float _TransStrength;
  3029. float _TransNormal;
  3030. float _TransScattering;
  3031. float _TransDirect;
  3032. float _TransAmbient;
  3033. float _TransShadow;
  3034. #endif
  3035. #ifdef ASE_TESSELLATION
  3036. float _TessPhongStrength;
  3037. float _TessValue;
  3038. float _TessMin;
  3039. float _TessMax;
  3040. float _TessEdgeLength;
  3041. float _TessMaxDisp;
  3042. #endif
  3043. CBUFFER_END
  3044. #ifdef SCENEPICKINGPASS
  3045. float4 _SelectionID;
  3046. #endif
  3047. #ifdef SCENESELECTIONPASS
  3048. int _ObjectId;
  3049. int _PassValue;
  3050. #endif
  3051. PackedVaryings VertexFunction( Attributes input )
  3052. {
  3053. PackedVaryings output = (PackedVaryings)0;
  3054. UNITY_SETUP_INSTANCE_ID(input);
  3055. UNITY_TRANSFER_INSTANCE_ID(input, output);
  3056. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
  3057. #ifdef ASE_ABSOLUTE_VERTEX_POS
  3058. float3 defaultVertexValue = input.positionOS.xyz;
  3059. #else
  3060. float3 defaultVertexValue = float3(0, 0, 0);
  3061. #endif
  3062. float3 vertexValue = defaultVertexValue;
  3063. #ifdef ASE_ABSOLUTE_VERTEX_POS
  3064. input.positionOS.xyz = vertexValue;
  3065. #else
  3066. input.positionOS.xyz += vertexValue;
  3067. #endif
  3068. VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
  3069. #if defined(APLICATION_SPACE_WARP_MOTION)
  3070. // We do not need jittered position in ASW
  3071. output.positionCSNoJitter = mul(_NonJitteredViewProjMatrix, mul(UNITY_MATRIX_M, input.positionOS));;
  3072. output.positionCS = output.positionCSNoJitter;
  3073. #else
  3074. // Jittered. Match the frame.
  3075. output.positionCS = vertexInput.positionCS;
  3076. output.positionCSNoJitter = mul( _NonJitteredViewProjMatrix, mul( UNITY_MATRIX_M, input.positionOS));
  3077. #endif
  3078. float4 prevPos = ( unity_MotionVectorsParams.x == 1 ) ? float4( input.positionOld, 1 ) : input.positionOS;
  3079. #if _ADD_PRECOMPUTED_VELOCITY
  3080. prevPos = prevPos - float4(input.alembicMotionVector, 0);
  3081. #endif
  3082. output.previousPositionCSNoJitter = mul( _PrevViewProjMatrix, mul( UNITY_PREV_MATRIX_M, prevPos ) );
  3083. // removed in ObjectMotionVectors.hlsl found in unity 6000.0.23 and higher
  3084. //ApplyMotionVectorZBias( output.positionCS );
  3085. return output;
  3086. }
  3087. PackedVaryings vert ( Attributes input )
  3088. {
  3089. return VertexFunction( input );
  3090. }
  3091. half4 frag( PackedVaryings input ) : SV_Target
  3092. {
  3093. UNITY_SETUP_INSTANCE_ID(input);
  3094. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
  3095. float Alpha = 1;
  3096. float AlphaClipThreshold = 0.5;
  3097. #ifdef _ALPHATEST_ON
  3098. clip(Alpha - AlphaClipThreshold);
  3099. #endif
  3100. #if defined(LOD_FADE_CROSSFADE)
  3101. LODFadeCrossFade( input.positionCS );
  3102. #endif
  3103. #if defined(APLICATION_SPACE_WARP_MOTION)
  3104. return float4( CalcAswNdcMotionVectorFromCsPositions( input.positionCSNoJitter, input.previousPositionCSNoJitter ), 1 );
  3105. #else
  3106. return float4( CalcNdcMotionVectorFromCsPositions( input.positionCSNoJitter, input.previousPositionCSNoJitter ), 0, 0 );
  3107. #endif
  3108. }
  3109. ENDHLSL
  3110. }
  3111. }
  3112. CustomEditor "UnityEditor.ShaderGraphLitGUI"
  3113. FallBack "Hidden/Shader Graph/FallbackError"
  3114. Fallback Off
  3115. }
  3116. /*ASEBEGIN
  3117. Version=19701
  3118. Node;AmplifyShaderEditor.CommentaryNode;138;-2875.129,720;Inherit;False;2061.017;817.8452;Foam controls and texture;16;205;207;170;206;204;153;158;173;155;152;151;143;145;142;135;250;;1,1,1,1;0;0
  3119. Node;AmplifyShaderEditor.CommentaryNode;181;-2704,1648;Inherit;False;1613.166;659.4885;Comment;8;191;194;190;189;185;184;183;203;Planar Reflections;1,1,1,1;0;0
  3120. Node;AmplifyShaderEditor.CommentaryNode;244;-1552,-1696;Inherit;False;1633.383;966.8502;;15;247;248;245;234;228;229;246;230;241;243;242;240;239;231;227;Waterfall Foam;0.572549,0.6747911,1,1;0;0
  3121. Node;AmplifyShaderEditor.CommentaryNode;39;-4432,-544;Inherit;False;1649.668;1175.389;Animated UVS;24;47;40;46;34;45;50;38;33;25;36;49;44;48;43;24;31;35;41;28;29;42;23;32;27;;1,1,1,1;0;0
  3122. Node;AmplifyShaderEditor.CommentaryNode;81;-2704,512;Inherit;False;803;170;DephFade;3;78;80;79;Normal Depth;1,0,0,1;0;0
  3123. Node;AmplifyShaderEditor.CommentaryNode;13;-2736,-112;Inherit;False;1147.129;596.2892;Water Normals;14;12;8;9;4;2;86;54;52;87;53;51;84;85;197;;1,1,1,1;0;0
  3124. Node;AmplifyShaderEditor.CommentaryNode;135;-2704,768;Inherit;False;1729.686;239.2343;Foam Edge;8;131;132;171;129;130;128;127;126;;1,1,1,1;0;0
  3125. Node;AmplifyShaderEditor.CommentaryNode;69;-3024,-1008;Inherit;False;1398.91;388.3285;Fresnel;10;251;68;66;61;60;67;65;64;63;62;;0.4779412,0.7839755,1,1;0;0
  3126. Node;AmplifyShaderEditor.CommentaryNode;14;-2560,-576;Inherit;False;969.1844;422.8784;Screen UV;8;20;6;7;5;16;22;15;18;;1,1,1,1;0;0
  3127. Node;AmplifyShaderEditor.CommentaryNode;203;-2656,1952;Inherit;False;788;307;;5;186;198;201;187;188;Surface normals wobbling the reflection;1,1,1,1;0;0
  3128. Node;AmplifyShaderEditor.CommentaryNode;199;-544,-400;Inherit;False;564;259;;3;196;192;193;Add Reflections;1,1,1,1;0;0
  3129. Node;AmplifyShaderEditor.CommentaryNode;219;-1552,-640;Inherit;False;490;413;Fix Refraction;5;224;223;222;221;220;;0,1,0.006896496,1;0;0
  3130. Node;AmplifyShaderEditor.Vector4Node;32;-4384,48;Inherit;False;Property;_AnimateUV1XYUV2ZW;Animate UV1 (XY) UV2 (ZW);3;0;Create;True;0;0;0;False;0;False;0,0,0,0;1,1,4,6;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3131. Node;AmplifyShaderEditor.TimeNode;27;-4320,-112;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3132. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;-3952,-80;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3133. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-3952,336;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3134. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;29;-3952,48;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3135. Node;AmplifyShaderEditor.WorldPosInputsNode;23;-4208,-368;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  3136. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;42;-3952,192;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3137. Node;AmplifyShaderEditor.DynamicAppendNode;43;-3776,192;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3138. Node;AmplifyShaderEditor.DynamicAppendNode;31;-3792,-48;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3139. Node;AmplifyShaderEditor.ComponentMaskNode;24;-3888,-224;Inherit;False;True;False;True;True;1;0;FLOAT3;0,0,0;False;1;FLOAT2;0
  3140. Node;AmplifyShaderEditor.Vector4Node;48;-3984,448;Inherit;False;Property;_UV2TilingXYScaleZW;UV2 Tiling (XY) Scale (ZW);2;1;[Header];Create;True;1;Animated Tiling;0;0;False;0;False;1,1,1,1;0.1,0.1,1,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3141. Node;AmplifyShaderEditor.Vector4Node;35;-3968,-480;Inherit;False;Constant;_UV1TilingXYScaleZW;UV1 Tiling (XY) Scale (ZW);2;0;Create;True;0;0;0;False;0;False;1,1,1,1;1,1,1,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3142. Node;AmplifyShaderEditor.SimpleAddOpNode;25;-3600,-160;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3143. Node;AmplifyShaderEditor.DynamicAppendNode;36;-3616,-304;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3144. Node;AmplifyShaderEditor.SimpleAddOpNode;44;-3568,112;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3145. Node;AmplifyShaderEditor.DynamicAppendNode;49;-3584,272;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3146. Node;AmplifyShaderEditor.RangedFloatNode;80;-2640,592;Inherit;False;Property;_DephFadeDistance;Deph Fade Distance;21;0;Create;True;0;0;0;False;0;False;0;-20;0;0;0;1;FLOAT;0
  3147. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;33;-3408,-112;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3148. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;45;-3376,96;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3149. Node;AmplifyShaderEditor.DynamicAppendNode;38;-3456,-320;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3150. Node;AmplifyShaderEditor.DepthFade;78;-2416,576;Inherit;False;True;True;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
  3151. Node;AmplifyShaderEditor.DynamicAppendNode;50;-3552,416;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3152. Node;AmplifyShaderEditor.SimpleDivideOpNode;46;-3200,112;Inherit;False;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3153. Node;AmplifyShaderEditor.RegisterLocalVarNode;79;-2144,592;Inherit;False;DephFade;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  3154. Node;AmplifyShaderEditor.SimpleDivideOpNode;34;-3248,-112;Inherit;False;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3155. Node;AmplifyShaderEditor.GetLocalVarNode;87;-2672,112;Inherit;False;79;DephFade;1;0;OBJECT;;False;1;FLOAT;0
  3156. Node;AmplifyShaderEditor.GetLocalVarNode;86;-2672,352;Inherit;False;79;DephFade;1;0;OBJECT;;False;1;FLOAT;0
  3157. Node;AmplifyShaderEditor.RegisterLocalVarNode;47;-3040,128;Inherit;False;UV2;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0
  3158. Node;AmplifyShaderEditor.RangedFloatNode;53;-2624,32;Inherit;False;Property;_NS1;NS 1;9;0;Create;True;0;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0
  3159. Node;AmplifyShaderEditor.RegisterLocalVarNode;40;-3072,-112;Inherit;False;UV1;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0
  3160. Node;AmplifyShaderEditor.RangedFloatNode;54;-2640,272;Inherit;False;Property;_NS2;NS 2;10;0;Create;True;0;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0
  3161. Node;AmplifyShaderEditor.GetLocalVarNode;52;-2656,192;Inherit;False;47;UV2;1;0;OBJECT;;False;1;FLOAT2;0
  3162. Node;AmplifyShaderEditor.GetLocalVarNode;51;-2656,-48;Inherit;False;40;UV1;1;0;OBJECT;;False;1;FLOAT2;0
  3163. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;84;-2464,32;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3164. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;85;-2464,304;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3165. Node;AmplifyShaderEditor.RangedFloatNode;9;-2304,352;Inherit;False;Property;_LerpStrength;Lerp Strength ;8;1;[Header];Create;True;1;Refraction Settings;0;0;False;0;False;0.5;0.935;0;1;0;1;FLOAT;0
  3166. Node;AmplifyShaderEditor.LerpOp;8;-1984,112;Inherit;False;3;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
  3167. Node;AmplifyShaderEditor.RangedFloatNode;126;-2656,848;Inherit;False;Property;_Edgedistance;Edge distance;20;0;Create;True;0;0;0;False;0;False;1;-1.07;0;0;0;1;FLOAT;0
  3168. Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1808,112;Inherit;False;Normalmap;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
  3169. Node;AmplifyShaderEditor.DotProductOpNode;62;-2768,-896;Inherit;True;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
  3170. Node;AmplifyShaderEditor.DepthFade;127;-2464,832;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
  3171. Node;AmplifyShaderEditor.GetLocalVarNode;15;-2528,-336;Inherit;False;12;Normalmap;1;0;OBJECT;;False;1;FLOAT3;0
  3172. Node;AmplifyShaderEditor.AbsOpNode;63;-2560,-896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3173. Node;AmplifyShaderEditor.OneMinusNode;128;-2224,832;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3174. Node;AmplifyShaderEditor.RangedFloatNode;142;-2288,1056;Float;False;Property;_FoamDepth;Foam Depth;18;0;Create;True;0;0;0;False;0;False;0;1.16;0;0;0;1;FLOAT;0
  3175. Node;AmplifyShaderEditor.SaturateNode;64;-2448,-896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3176. Node;AmplifyShaderEditor.RangedFloatNode;145;-2160,1136;Float;False;Property;_FoamFalloff;Foam Falloff;19;0;Create;True;0;0;0;False;0;False;0;-0.95;0;0;0;1;FLOAT;0
  3177. Node;AmplifyShaderEditor.SimpleAddOpNode;143;-2112,1040;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3178. Node;AmplifyShaderEditor.RangedFloatNode;18;-2496,-256;Inherit;False;Constant;_Constnat01;Constnat 0.1;5;0;Create;True;0;0;0;False;0;False;0.1;0;0;0;0;1;FLOAT;0
  3179. Node;AmplifyShaderEditor.PosVertexDataNode;183;-2656,1712;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3180. Node;AmplifyShaderEditor.DynamicAppendNode;7;-2288,-480;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3181. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;16;-2112,-256;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
  3182. Node;AmplifyShaderEditor.OneMinusNode;65;-2304,-896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3183. Node;AmplifyShaderEditor.SimpleAddOpNode;184;-2448,1712;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
  3184. Node;AmplifyShaderEditor.GetLocalVarNode;198;-2592,2144;Inherit;False;197;ReflectionNormalWarp;1;0;OBJECT;;False;1;FLOAT;0
  3185. Node;AmplifyShaderEditor.RangedFloatNode;186;-2592,2064;Float;False;Property;_ReflectionNormalScale;Reflection Normal Scale;12;0;Create;True;0;0;0;False;0;False;0;0.2;0;0;0;1;FLOAT;0
  3186. Node;AmplifyShaderEditor.PannerNode;152;-2160,1216;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;-0.01,0.01;False;1;FLOAT;1;False;1;FLOAT2;0
  3187. Node;AmplifyShaderEditor.RangedFloatNode;67;-2416,-816;Inherit;False;Property;_FresnelPower;Fresnel Power;7;0;Create;True;0;0;0;False;0;False;1;0.69;0;5;0;1;FLOAT;0
  3188. Node;AmplifyShaderEditor.SimpleSubtractOpNode;6;-2000,-432;Inherit;False;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
  3189. Node;AmplifyShaderEditor.RangedFloatNode;130;-2400,928;Inherit;False;Constant;_EdgeStrenght;Edge Strenght;14;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
  3190. Node;AmplifyShaderEditor.UnityObjToClipPosHlpNode;185;-2320,1728;Inherit;False;1;0;FLOAT3;0,0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3191. Node;AmplifyShaderEditor.GetLocalVarNode;187;-2224,2000;Inherit;False;12;Normalmap;1;0;OBJECT;0;False;1;FLOAT3;0
  3192. Node;AmplifyShaderEditor.ToggleSwitchNode;201;-2320,2096;Inherit;False;Property;_AccurateNormalReflection;Accurate Normal Reflection;13;0;Create;True;0;0;0;False;0;False;1;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3193. Node;AmplifyShaderEditor.RegisterLocalVarNode;20;-1840,-368;Inherit;False;ScreenUV;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0
  3194. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;129;-2048,832;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3195. Node;AmplifyShaderEditor.ComputeScreenPosHlpNode;189;-2112,1760;Inherit;False;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
  3196. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;188;-2032,2048;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
  3197. Node;AmplifyShaderEditor.GetLocalVarNode;82;-1200,192;Inherit;False;79;DephFade;1;0;OBJECT;;False;1;FLOAT;0
  3198. Node;AmplifyShaderEditor.GetLocalVarNode;70;-1216,64;Inherit;False;68;Fresnel;1;0;OBJECT;;False;1;FLOAT;0
  3199. Node;AmplifyShaderEditor.SimpleAddOpNode;190;-1824,1744;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT4;0
  3200. Node;AmplifyShaderEditor.ColorNode;56;-1504,-48;Inherit;False;Property;_MainColor;Main Color;4;1;[Header];Create;True;1;Texture Settings;0;0;False;0;False;0.7279412,0.7011786,0.7011786,0;0.4470155,0.5002384,0.5735295,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
  3201. Node;AmplifyShaderEditor.WireNode;172;-800,32;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  3202. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;83;-1008,160;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3203. Node;AmplifyShaderEditor.ScreenColorNode;1;-816,-208;Inherit;False;Global;_GrabScreen0;Grab Screen 0;0;0;Create;True;0;0;0;False;0;False;Object;-1;False;False;False;False;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3204. Node;AmplifyShaderEditor.LerpOp;55;-480,-48;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
  3205. Node;AmplifyShaderEditor.SimpleAddOpNode;134;-320,-32;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  3206. Node;AmplifyShaderEditor.RangedFloatNode;192;-496,-256;Float;False;Property;_ReflectionIntensity;Reflection Intensity;11;1;[Header];Create;True;1;Reflection Settings;0;0;False;0;False;0;0.4;0;1;0;1;FLOAT;0
  3207. Node;AmplifyShaderEditor.GetLocalVarNode;193;-416,-352;Inherit;False;191;Reflections;1;0;OBJECT;0;False;1;COLOR;0
  3208. Node;AmplifyShaderEditor.LerpOp;196;-160,-304;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
  3209. Node;AmplifyShaderEditor.RangedFloatNode;10;224,272;Inherit;False;Property;_Smoothness;Smoothness;5;0;Create;True;0;0;0;False;0;False;1;0.947;0;1;0;1;FLOAT;0
  3210. Node;AmplifyShaderEditor.RangedFloatNode;11;224,192;Inherit;False;Property;_EnergyConservation;Energy Conservation;6;0;Create;True;0;0;0;False;0;False;0;0.559;0;1;0;1;FLOAT;0
  3211. Node;AmplifyShaderEditor.RegisterLocalVarNode;191;-1376,1744;Float;False;Reflections;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  3212. Node;AmplifyShaderEditor.RegisterLocalVarNode;197;-2496,432;Inherit;False;ReflectionNormalWarp;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  3213. Node;AmplifyShaderEditor.SamplerNode;2;-2320,-48;Inherit;True;Property;_NormalMap;Normal Map;1;3;[Header];[NoScaleOffset];[Normal];Create;True;3;____________________(TFS) Water______________________;_____________________________________________________;Refraction Map;0;0;False;0;False;-1;None;07be9e38bf6a6604f85f75cf91682070;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
  3214. Node;AmplifyShaderEditor.SamplerNode;4;-2320,160;Inherit;True;Property;_Refernce;Refernce;1;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;True;Instance;2;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
  3215. Node;AmplifyShaderEditor.SamplerNode;194;-1680,1712;Inherit;True;Global;_ReflectionTex;_ReflectionTex;0;0;Create;True;0;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;1;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
  3216. Node;AmplifyShaderEditor.ViewDirInputsCoordNode;60;-2976,-960;Inherit;False;World;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  3217. Node;AmplifyShaderEditor.NormalVertexDataNode;61;-2976,-800;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3218. Node;AmplifyShaderEditor.ComponentMaskNode;22;-2304,-336;Inherit;False;True;True;False;True;1;0;FLOAT3;0,0,0;False;1;FLOAT2;0
  3219. Node;AmplifyShaderEditor.ScreenPosInputsNode;5;-2512,-512;Float;False;0;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3220. Node;AmplifyShaderEditor.RangedFloatNode;221;-1408,-400;Inherit;False;Constant;_Float0;Float 0;12;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
  3221. Node;AmplifyShaderEditor.RangedFloatNode;222;-1408,-320;Inherit;False;Constant;_Float1;Float 1;12;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
  3222. Node;AmplifyShaderEditor.ConditionalIfNode;224;-1232,-496;Inherit;False;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;1;FLOAT;0
  3223. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;225;-1200,-176;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
  3224. Node;AmplifyShaderEditor.SurfaceDepthNode;223;-1520,-496;Inherit;False;0;1;0;FLOAT3;0,0,0;False;1;FLOAT;0
  3225. Node;AmplifyShaderEditor.ScreenDepthNode;220;-1536,-592;Inherit;False;0;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0
  3226. Node;AmplifyShaderEditor.GetLocalVarNode;226;-1408,-160;Inherit;False;20;ScreenUV;1;0;OBJECT;;False;1;FLOAT2;0
  3227. Node;AmplifyShaderEditor.StaticSwitch;208;32,-32;Inherit;False;Property;_ReflectionOnOff;Reflection On/Off;14;0;Create;True;0;0;0;False;0;False;0;1;1;True;;Toggle;2;Key0;Key1;Create;True;True;All;9;1;COLOR;0,0,0,0;False;0;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;0,0,0,0;False;5;COLOR;0,0,0,0;False;6;COLOR;0,0,0,0;False;7;COLOR;0,0,0,0;False;8;COLOR;0,0,0,0;False;1;COLOR;0
  3228. Node;AmplifyShaderEditor.SimpleAddOpNode;236;276.238,-260.3674;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  3229. Node;AmplifyShaderEditor.WireNode;238;176,-272;Inherit;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
  3230. Node;AmplifyShaderEditor.WorldPosInputsNode;204;-2784,1280;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  3231. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;206;-2544,1248;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3232. Node;AmplifyShaderEditor.Vector2Node;170;-2784,1104;Inherit;False;Property;_FoamTiling;Foam Tiling;16;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
  3233. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;207;-2560,1376;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3234. Node;AmplifyShaderEditor.DynamicAppendNode;205;-2368,1296;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3235. Node;AmplifyShaderEditor.TimeNode;227;-1136,-1216;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  3236. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;231;-272,-1440;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  3237. Node;AmplifyShaderEditor.WorldPosInputsNode;239;-1504,-1504;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
  3238. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;240;-1264,-1536;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3239. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;242;-1280,-1408;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3240. Node;AmplifyShaderEditor.DynamicAppendNode;243;-1088,-1488;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
  3241. Node;AmplifyShaderEditor.Vector2Node;241;-1488,-1648;Inherit;False;Property;_WaterfallTiling;Waterfall Tiling;27;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
  3242. Node;AmplifyShaderEditor.ToggleSwitchNode;237;384,-368;Inherit;False;Property;_WaterfallFoamOnOff;Waterfall Foam On/Off;24;0;Create;True;0;0;0;False;0;False;0;True;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  3243. Node;AmplifyShaderEditor.SamplerNode;230;-624,-1360;Inherit;True;Property;_WaterfallFoam;Waterfall Foam;22;2;[Header];[NoScaleOffset];Create;True;1;Waterfall Foam;0;0;False;0;False;-1;None;25752278d3d4d554fa073769cdcbd840;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
  3244. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;246;-288,-1296;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  3245. Node;AmplifyShaderEditor.ColorNode;229;-576,-1536;Inherit;False;Property;_WaterfallColor;Waterfall Color;25;0;Create;True;0;0;0;False;0;False;1,1,1,0;0.4196078,0.4196078,0.4196078,1;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
  3246. Node;AmplifyShaderEditor.PannerNode;228;-832,-1328;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
  3247. Node;AmplifyShaderEditor.Vector2Node;234;-1088,-1376;Inherit;False;Property;_WaterfallSpeed;Waterfall Speed;28;0;Create;True;0;0;0;False;0;False;0,1;0,0.55;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
  3248. Node;AmplifyShaderEditor.SamplerNode;245;-624,-1168;Inherit;True;Property;_WaterfallFoam2;Waterfall Foam 2;23;2;[Header];[NoScaleOffset];Create;True;1;Waterfall Foam;0;0;False;0;False;-1;None;25752278d3d4d554fa073769cdcbd840;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
  3249. Node;AmplifyShaderEditor.ColorNode;248;-576,-944;Inherit;False;Property;_WaterfallColor2;Waterfall Color 2;26;0;Create;True;0;0;0;False;0;False;1,1,1,0;0.4196078,0.4196078,0.4196078,1;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
  3250. Node;AmplifyShaderEditor.SimpleAddOpNode;247;-64,-1344;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
  3251. Node;AmplifyShaderEditor.PowerNode;151;-1872,1088;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3252. Node;AmplifyShaderEditor.SaturateNode;155;-1728,1104;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3253. Node;AmplifyShaderEditor.RangedFloatNode;173;-1856,1392;Inherit;False;Property;_FoamIntensity;Foam Intensity;17;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
  3254. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;158;-1584,1104;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  3255. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;171;-1552,880;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
  3256. Node;AmplifyShaderEditor.ClampOpNode;132;-1408,864;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
  3257. Node;AmplifyShaderEditor.RegisterLocalVarNode;131;-1264,848;Inherit;False;Edge;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  3258. Node;AmplifyShaderEditor.SamplerNode;153;-1872,1184;Inherit;True;Property;_Foam;Foam;15;2;[Header];[NoScaleOffset];Create;True;1;Foam Map;0;0;False;0;False;-1;None;25752278d3d4d554fa073769cdcbd840;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;1;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
  3259. Node;AmplifyShaderEditor.AbsOpNode;250;-1984,1040;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3260. Node;AmplifyShaderEditor.PowerNode;66;-2000,-880;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
  3261. Node;AmplifyShaderEditor.RegisterLocalVarNode;68;-1856,-864;Inherit;False;Fresnel;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
  3262. Node;AmplifyShaderEditor.AbsOpNode;251;-2128,-896;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
  3263. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;209;592,64;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
  3264. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;210;592,64;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Tobyfredson/Water;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;21;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;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;1;638538727959902889; Refraction Model;0;638538727351742353; Blend;0;0;Two Sided;1;638538727259982668;Alpha Clipping;1;0; Use Shadow Threshold;0;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Forward Only;0;638538727082250644;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;0;638537176114385749;Receive Shadows;1;0;Receive SSAO;1;0;Motion Vectors;1;0; Add Precomputed Velocity;0;0;GPU Instancing;1;0;LOD CrossFade;0;638537176146892671;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;638538726879257552; Early Z;0;638538726875265009;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;11;False;True;False;True;True;True;True;True;True;True;True;False;;False;0
  3265. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;211;592,64;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
  3266. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;212;592,64;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
  3267. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;213;592,64;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
  3268. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;214;592,64;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;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=Universal2D;False;False;0;;0;0;Standard;0;False;0
  3269. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;215;592,64;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
  3270. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;216;592,64;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;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;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
  3271. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;217;592,64;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
  3272. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;218;592,64;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
  3273. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;252;592,164;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
  3274. WireConnection;28;0;27;1
  3275. WireConnection;28;1;32;1
  3276. WireConnection;41;0;27;1
  3277. WireConnection;41;1;32;4
  3278. WireConnection;29;0;27;1
  3279. WireConnection;29;1;32;2
  3280. WireConnection;42;0;27;1
  3281. WireConnection;42;1;32;3
  3282. WireConnection;43;0;42;0
  3283. WireConnection;43;1;41;0
  3284. WireConnection;31;0;28;0
  3285. WireConnection;31;1;29;0
  3286. WireConnection;24;0;23;0
  3287. WireConnection;25;0;24;0
  3288. WireConnection;25;1;31;0
  3289. WireConnection;36;0;35;1
  3290. WireConnection;36;1;35;2
  3291. WireConnection;44;0;24;0
  3292. WireConnection;44;1;43;0
  3293. WireConnection;49;0;48;1
  3294. WireConnection;49;1;48;2
  3295. WireConnection;33;0;25;0
  3296. WireConnection;33;1;36;0
  3297. WireConnection;45;0;44;0
  3298. WireConnection;45;1;49;0
  3299. WireConnection;38;0;35;3
  3300. WireConnection;38;1;35;4
  3301. WireConnection;78;0;80;0
  3302. WireConnection;50;0;48;3
  3303. WireConnection;50;1;48;4
  3304. WireConnection;46;0;45;0
  3305. WireConnection;46;1;50;0
  3306. WireConnection;79;0;78;0
  3307. WireConnection;34;0;33;0
  3308. WireConnection;34;1;38;0
  3309. WireConnection;47;0;46;0
  3310. WireConnection;40;0;34;0
  3311. WireConnection;84;0;53;0
  3312. WireConnection;84;1;87;0
  3313. WireConnection;85;0;54;0
  3314. WireConnection;85;1;86;0
  3315. WireConnection;8;0;2;0
  3316. WireConnection;8;1;4;0
  3317. WireConnection;8;2;9;0
  3318. WireConnection;12;0;8;0
  3319. WireConnection;62;0;60;0
  3320. WireConnection;62;1;61;0
  3321. WireConnection;127;0;126;0
  3322. WireConnection;63;0;62;0
  3323. WireConnection;128;0;127;0
  3324. WireConnection;64;0;63;0
  3325. WireConnection;143;0;128;0
  3326. WireConnection;143;1;142;0
  3327. WireConnection;7;0;5;1
  3328. WireConnection;7;1;5;2
  3329. WireConnection;16;0;22;0
  3330. WireConnection;16;1;18;0
  3331. WireConnection;65;0;64;0
  3332. WireConnection;184;0;183;0
  3333. WireConnection;152;0;205;0
  3334. WireConnection;6;0;7;0
  3335. WireConnection;6;1;16;0
  3336. WireConnection;185;0;184;0
  3337. WireConnection;201;0;186;0
  3338. WireConnection;201;1;198;0
  3339. WireConnection;20;0;6;0
  3340. WireConnection;129;0;128;0
  3341. WireConnection;129;1;130;0
  3342. WireConnection;189;0;185;0
  3343. WireConnection;188;0;187;0
  3344. WireConnection;188;1;201;0
  3345. WireConnection;190;0;189;0
  3346. WireConnection;190;1;188;0
  3347. WireConnection;172;0;56;0
  3348. WireConnection;83;0;70;0
  3349. WireConnection;83;1;82;0
  3350. WireConnection;1;0;225;0
  3351. WireConnection;55;0;1;0
  3352. WireConnection;55;1;172;0
  3353. WireConnection;55;2;83;0
  3354. WireConnection;134;0;131;0
  3355. WireConnection;134;1;55;0
  3356. WireConnection;196;0;134;0
  3357. WireConnection;196;1;193;0
  3358. WireConnection;196;2;192;0
  3359. WireConnection;191;0;194;0
  3360. WireConnection;197;0;54;0
  3361. WireConnection;2;1;51;0
  3362. WireConnection;2;5;84;0
  3363. WireConnection;4;1;52;0
  3364. WireConnection;4;5;85;0
  3365. WireConnection;194;1;190;0
  3366. WireConnection;22;0;15;0
  3367. WireConnection;224;0;220;0
  3368. WireConnection;224;1;223;0
  3369. WireConnection;224;2;221;0
  3370. WireConnection;224;4;222;0
  3371. WireConnection;225;0;226;0
  3372. WireConnection;225;1;224;0
  3373. WireConnection;220;0;20;0
  3374. WireConnection;208;1;134;0
  3375. WireConnection;208;0;196;0
  3376. WireConnection;236;0;247;0
  3377. WireConnection;236;1;208;0
  3378. WireConnection;238;0;208;0
  3379. WireConnection;206;0;170;1
  3380. WireConnection;206;1;204;1
  3381. WireConnection;207;0;170;2
  3382. WireConnection;207;1;204;3
  3383. WireConnection;205;0;206;0
  3384. WireConnection;205;1;207;0
  3385. WireConnection;231;0;229;0
  3386. WireConnection;231;1;230;0
  3387. WireConnection;240;0;241;1
  3388. WireConnection;240;1;239;1
  3389. WireConnection;242;0;241;2
  3390. WireConnection;242;1;239;3
  3391. WireConnection;243;0;240;0
  3392. WireConnection;243;1;242;0
  3393. WireConnection;237;0;238;0
  3394. WireConnection;237;1;236;0
  3395. WireConnection;230;1;228;0
  3396. WireConnection;246;0;248;0
  3397. WireConnection;246;1;245;0
  3398. WireConnection;228;0;243;0
  3399. WireConnection;228;2;234;0
  3400. WireConnection;228;1;227;2
  3401. WireConnection;245;1;228;0
  3402. WireConnection;247;0;231;0
  3403. WireConnection;247;1;246;0
  3404. WireConnection;151;0;250;0
  3405. WireConnection;151;1;145;0
  3406. WireConnection;155;0;151;0
  3407. WireConnection;158;0;155;0
  3408. WireConnection;158;1;153;1
  3409. WireConnection;158;2;173;0
  3410. WireConnection;171;0;129;0
  3411. WireConnection;171;1;158;0
  3412. WireConnection;132;0;171;0
  3413. WireConnection;131;0;132;0
  3414. WireConnection;153;1;152;0
  3415. WireConnection;250;0;143;0
  3416. WireConnection;66;0;251;0
  3417. WireConnection;66;1;67;0
  3418. WireConnection;68;0;66;0
  3419. WireConnection;251;0;65;0
  3420. WireConnection;210;0;237;0
  3421. WireConnection;210;1;12;0
  3422. WireConnection;210;3;11;0
  3423. WireConnection;210;4;10;0
  3424. ASEEND*/
  3425. //CHKSM=F7C79FE483042C0AFCF6BB5F6537FA0991F503CD