Simple Snow Triplanar.shader 162 KB

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