Simple Water_SRP.shader 153 KB

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