Ice Base.shader 134 KB

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