Tree Bark Foliage Wind.shader 150 KB

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