Tree Billboard Plane.shader 170 KB

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