1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870 |
- // Made with Amplify Shader Editor v1.9.8
- // Available at the Unity Asset Store - http://u3d.as/y3X
- Shader "Polytope Studio/PT_Water_Shader"
- {
- Properties
- {
- [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
- [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
- _DeepColor("Deep Color", Color) = (0.3114988,0.5266015,0.5283019,0)
- _ShallowColor("Shallow Color", Color) = (0.5238074,0.7314408,0.745283,0)
- _Depth("Depth", Range( 0 , 1)) = 0.3
- _DepthStrength("Depth Strength", Range( 0 , 1)) = 0.3
- _Smootness("Smootness", Range( 0 , 1)) = 1
- _Mettalic("Mettalic", Range( 0 , 1)) = 1
- _WaveSpeed("Wave Speed", Range( 0 , 1)) = 0.5
- _WaveTile("Wave Tile", Range( 0 , 0.9)) = 0.5
- _WaveAmplitude("Wave Amplitude", Range( 0 , 1)) = 0.2
- [NoScaleOffset][Normal]_NormalMapTexture("Normal Map Texture ", 2D) = "bump" {}
- _NormalMapWavesSpeed("Normal Map Waves Speed", Range( 0 , 1)) = 0.1
- _NormalMapsWavesSize("Normal Maps Waves Size", Range( 0 , 10)) = 5
- _FoamColor("Foam Color", Color) = (0.3066038,1,0.9145772,0)
- _FoamAmount("Foam Amount", Range( 0 , 10)) = 1.5
- _FoamPower("Foam Power", Range( 0.1 , 5)) = 0.5
- _FoamNoiseScale("Foam Noise Scale", Range( 0 , 1000)) = 150
- //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5
- //_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1
- //_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5
- //_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2
- //_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9
- //_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1
- //_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5
- //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
- //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
- //_TessMin( "Tess Min Distance", Float ) = 10
- //_TessMax( "Tess Max Distance", Float ) = 25
- //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
- //_TessMaxDisp( "Tess Max Displacement", Float ) = 25
- [HideInInspector][ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1
- [HideInInspector][ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1
- [HideInInspector][ToggleOff] _ReceiveShadows("Receive Shadows", Float) = 1.0
- [HideInInspector] _QueueOffset("_QueueOffset", Float) = 0
- [HideInInspector] _QueueControl("_QueueControl", Float) = -1
- [HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
- [HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
- [HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
- //[HideInInspector][ToggleUI] _AddPrecomputedVelocity("Add Precomputed Velocity", Float) = 1
- }
- SubShader
- {
- LOD 0
-
- Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" "UniversalMaterialType"="Lit" }
- Cull Back
- ZWrite Off
- ZTest LEqual
- Offset 0 , 0
- AlphaToMask Off
-
- HLSLINCLUDE
- #pragma target 4.5
- #pragma prefer_hlslcc gles
- // ensure rendering platforms toggle list is visible
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
- #ifndef ASE_TESS_FUNCS
- #define ASE_TESS_FUNCS
- float4 FixedTess( float tessValue )
- {
- return tessValue;
- }
- float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
- {
- float3 wpos = mul(o2w,vertex).xyz;
- float dist = distance (wpos, cameraPos);
- float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
- return f;
- }
- float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
- {
- float4 tess;
- tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
- tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
- tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
- tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
- return tess;
- }
- float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
- {
- float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
- float len = distance(wpos0, wpos1);
- float f = max(len * scParams.y / (edgeLen * dist), 1.0);
- return f;
- }
- float DistanceFromPlane (float3 pos, float4 plane)
- {
- float d = dot (float4(pos,1.0f), plane);
- return d;
- }
- bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
- {
- float4 planeTest;
- planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
- planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
- planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
- planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
- (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
- return !all (planeTest);
- }
- float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
- {
- float3 f;
- f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
- f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
- f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
- return CalcTriEdgeTessFactors (f);
- }
- float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
- {
- float3 pos0 = mul(o2w,v0).xyz;
- float3 pos1 = mul(o2w,v1).xyz;
- float3 pos2 = mul(o2w,v2).xyz;
- float4 tess;
- tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
- tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
- tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
- tess.w = (tess.x + tess.y + tess.z) / 3.0f;
- return tess;
- }
- float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
- {
- float3 pos0 = mul(o2w,v0).xyz;
- float3 pos1 = mul(o2w,v1).xyz;
- float3 pos2 = mul(o2w,v2).xyz;
- float4 tess;
- if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
- {
- tess = 0.0f;
- }
- else
- {
- tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
- tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
- tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
- tess.w = (tess.x + tess.y + tess.z) / 3.0f;
- }
- return tess;
- }
- #endif //ASE_TESS_FUNCS
- ENDHLSL
-
- Pass
- {
-
- Name "Forward"
- Tags { "LightMode"="UniversalForward" }
- Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
- ZWrite On
- ZTest LEqual
- Offset 0 , 0
- ColorMask RGBA
-
- HLSLPROGRAM
- #pragma multi_compile_fragment _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
- #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
- #pragma multi_compile_instancing
- #pragma instancing_options renderinglayer
- #pragma multi_compile _ LOD_FADE_CROSSFADE
- #pragma multi_compile_fog
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #define REQUIRE_OPAQUE_TEXTURE 1
- #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
- #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
- #pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
- #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
- #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
- #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
- #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
- #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
- #pragma multi_compile _ _LIGHT_LAYERS
- #pragma multi_compile_fragment _ _LIGHT_COOKIES
- #pragma multi_compile _ _FORWARD_PLUS
- #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
- #pragma multi_compile _ SHADOWS_SHADOWMASK
- #pragma multi_compile _ DIRLIGHTMAP_COMBINED
- #pragma multi_compile _ LIGHTMAP_ON
- #pragma multi_compile _ DYNAMICLIGHTMAP_ON
- #pragma multi_compile _ USE_LEGACY_LIGHTMAPS
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_FORWARD
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
- #if defined(LOD_FADE_CROSSFADE)
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
- #endif
- #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
- #define ENABLE_TERRAIN_PERPIXEL_NORMAL
- #endif
- #define ASE_NEEDS_FRAG_SCREEN_POSITION
- #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
- #define ASE_SV_DEPTH SV_DepthLessEqual
- #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
- #else
- #define ASE_SV_DEPTH SV_Depth
- #define ASE_SV_POSITION_QUALIFIERS
- #endif
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 tangentOS : TANGENT;
- float4 texcoord : TEXCOORD0;
- float4 texcoord1 : TEXCOORD1;
- float4 texcoord2 : TEXCOORD2;
-
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
- float4 clipPosV : TEXCOORD0;
- float4 lightmapUVOrVertexSH : TEXCOORD1;
- #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX)
- half4 fogFactorAndVertexLight : TEXCOORD2;
- #endif
- float4 tSpace0 : TEXCOORD3;
- float4 tSpace1 : TEXCOORD4;
- float4 tSpace2 : TEXCOORD5;
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- float4 shadowCoord : TEXCOORD6;
- #endif
- #if defined(DYNAMICLIGHTMAP_ON)
- float2 dynamicLightmapUV : TEXCOORD7;
- #endif
- #if defined(USE_APV_PROBE_OCCLUSION)
- float4 probeOcclusion : TEXCOORD8;
- #endif
- float4 ase_texcoord9 : TEXCOORD9;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
- sampler2D _NormalMapTexture;
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- inline float4 ASE_ComputeGrabScreenPos( float4 pos )
- {
- #if UNITY_UV_STARTS_AT_TOP
- float scale = -1.0;
- #else
- float scale = 1.0;
- #endif
- float4 o = pos;
- o.y = pos.w * 0.5f;
- o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
- return o;
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- output.ase_texcoord9.xy = input.texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord9.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- input.tangentOS = input.tangentOS;
- VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
- VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS );
- output.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x );
- output.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y );
- output.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z );
- #if defined(LIGHTMAP_ON)
- OUTPUT_LIGHTMAP_UV( input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy );
- #endif
- #if defined(DYNAMICLIGHTMAP_ON)
- output.dynamicLightmapUV.xy = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
- #endif
- OUTPUT_SH4( vertexInput.positionWS, normalInput.normalWS.xyz, GetWorldSpaceNormalizeViewDir( vertexInput.positionWS ), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion );
- #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
- output.lightmapUVOrVertexSH.zw = input.texcoord.xy;
- output.lightmapUVOrVertexSH.xy = input.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
- #endif
- #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX)
- output.fogFactorAndVertexLight = 0;
- #if defined(ASE_FOG) && !defined(_FOG_FRAGMENT)
- output.fogFactorAndVertexLight.x = ComputeFogFactor(vertexInput.positionCS.z);
- #endif
- #ifdef _ADDITIONAL_LIGHTS_VERTEX
- half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
- output.fogFactorAndVertexLight.yzw = vertexLight;
- #endif
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- output.positionCS = vertexInput.positionCS;
- output.clipPosV = vertexInput.positionCS;
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 tangentOS : TANGENT;
- float4 texcoord : TEXCOORD0;
- float4 texcoord1 : TEXCOORD1;
- float4 texcoord2 : TEXCOORD2;
-
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.tangentOS = input.tangentOS;
- output.texcoord = input.texcoord;
- output.texcoord1 = input.texcoord1;
- output.texcoord2 = input.texcoord2;
-
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
- output.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
- output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
- output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
-
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag ( PackedVaryings input
- #ifdef ASE_DEPTH_WRITE_ON
- ,out float outputDepth : ASE_SV_DEPTH
- #endif
- #ifdef _WRITE_RENDERING_LAYERS
- , out float4 outRenderingLayers : SV_Target1
- #endif
- ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
- #if defined(LOD_FADE_CROSSFADE)
- LODFadeCrossFade( input.positionCS );
- #endif
- #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
- float2 sampleCoords = (input.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
- float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
- float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
- float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
- #else
- float3 WorldNormal = normalize( input.tSpace0.xyz );
- float3 WorldTangent = input.tSpace1.xyz;
- float3 WorldBiTangent = input.tSpace2.xyz;
- #endif
- float3 WorldPosition = float3(input.tSpace0.w,input.tSpace1.w,input.tSpace2.w);
- float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- float4 ClipPos = input.clipPosV;
- float4 ScreenPos = ComputeScreenPos( input.clipPosV );
- float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #endif
- WorldViewDirection = SafeNormalize( WorldViewDirection );
- float4 ase_positionSSNorm = ScreenPos / ScreenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) );
- float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos );
- float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
- float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0));
- float mulTime251 = _TimeParameters.x * 0.1;
- float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx;
- float2 texCoord254 = input.ase_texcoord9.xy * appendResult405.xy + temp_cast_1;
- float2 temp_output_2_0_g9 = texCoord254;
- float2 break6_g9 = temp_output_2_0_g9;
- float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 );
- float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y));
- float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 );
- float temp_output_4_0_g9 = 1.0;
- float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 )));
- float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) );
- float3 NORMALMAPWAVES243 = normalizeResult22_g9;
- float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 );
- float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 );
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81);
- float4 DeepShallowColor196 = lerpResult86;
- float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 ));
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_4 = (_FoamNoiseScale).xx;
- float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord9.xy * temp_cast_4 + temp_cast_5;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float4 FoamColor442 = ( temp_output_471_0 * _FoamColor );
-
- float FoamMask439 = temp_output_471_0;
- float4 color478 = IsGammaSpace() ? float4(0.4980392,0.4980392,1,0) : float4(0.2122307,0.2122307,1,0);
- float layeredBlendVar477 = FoamMask439;
- float4 layeredBlend477 = ( lerp( float4( NORMALMAPWAVES243 , 0.0 ),color478 , layeredBlendVar477 ) );
- float4 normalizeResult474 = normalize( layeredBlend477 );
-
- float4 temp_cast_9 = (_Smootness).xxxx;
- float4 color484 = IsGammaSpace() ? float4(0.2264151,0.2264151,0.2264151,0) : float4(0.04193995,0.04193995,0.04193995,0);
- float layeredBlendVar485 = FoamMask439;
- float4 layeredBlend485 = ( lerp( temp_cast_9,color484 , layeredBlendVar485 ) );
-
- float DeepShallowMask197 = clampResult81;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb;
- float3 Normal = normalizeResult474.rgb;
- float3 Emission = 0;
- float3 Specular = 0.5;
- float Metallic = _Mettalic;
- float Smoothness = layeredBlend485.r;
- float Occlusion = 1;
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- float AlphaClipThresholdShadow = 0.5;
- float3 BakedGI = 0;
- float3 RefractionColor = 1;
- float RefractionIndex = 1;
- float3 Transmission = 1;
- float3 Translucency = 1;
- #ifdef ASE_DEPTH_WRITE_ON
- float DepthValue = input.positionCS.z;
- #endif
- #ifdef _CLEARCOAT
- float CoatMask = 0;
- float CoatSmoothness = 0;
- #endif
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- InputData inputData = (InputData)0;
- inputData.positionWS = WorldPosition;
- inputData.positionCS = input.positionCS;
- inputData.viewDirectionWS = WorldViewDirection;
- #ifdef _NORMALMAP
- #if _NORMAL_DROPOFF_TS
- inputData.normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent, WorldBiTangent, WorldNormal));
- #elif _NORMAL_DROPOFF_OS
- inputData.normalWS = TransformObjectToWorldNormal(Normal);
- #elif _NORMAL_DROPOFF_WS
- inputData.normalWS = Normal;
- #endif
- inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
- #else
- inputData.normalWS = WorldNormal;
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- inputData.shadowCoord = ShadowCoords;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
- #else
- inputData.shadowCoord = float4(0, 0, 0, 0);
- #endif
- #ifdef ASE_FOG
- inputData.fogCoord = InitializeInputDataFog(float4(inputData.positionWS, 1.0), input.fogFactorAndVertexLight.x);
- #endif
- #ifdef _ADDITIONAL_LIGHTS_VERTEX
- inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
- #endif
- #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
- float3 SH = SampleSH(inputData.normalWS.xyz);
- #else
- float3 SH = input.lightmapUVOrVertexSH.xyz;
- #endif
- #if defined(DYNAMICLIGHTMAP_ON)
- inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS);
- inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
- #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
- inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS),
- inputData.normalWS,
- inputData.viewDirectionWS,
- input.positionCS.xy,
- input.probeOcclusion,
- inputData.shadowMask );
- #else
- inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
- inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
- #endif
- #ifdef ASE_BAKEDGI
- inputData.bakedGI = BakedGI;
- #endif
- inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
- #if defined(DEBUG_DISPLAY)
- #if defined(DYNAMICLIGHTMAP_ON)
- inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy;
- #endif
- #if defined(LIGHTMAP_ON)
- inputData.staticLightmapUV = input.lightmapUVOrVertexSH.xy;
- #else
- inputData.vertexSH = SH;
- #endif
- #if defined(USE_APV_PROBE_OCCLUSION)
- inputData.probeOcclusion = input.probeOcclusion;
- #endif
- #endif
- SurfaceData surfaceData;
- surfaceData.albedo = BaseColor;
- surfaceData.metallic = saturate(Metallic);
- surfaceData.specular = Specular;
- surfaceData.smoothness = saturate(Smoothness),
- surfaceData.occlusion = Occlusion,
- surfaceData.emission = Emission,
- surfaceData.alpha = saturate(Alpha);
- surfaceData.normalTS = Normal;
- surfaceData.clearCoatMask = 0;
- surfaceData.clearCoatSmoothness = 1;
- #ifdef _CLEARCOAT
- surfaceData.clearCoatMask = saturate(CoatMask);
- surfaceData.clearCoatSmoothness = saturate(CoatSmoothness);
- #endif
- #ifdef _DBUFFER
- ApplyDecalToSurfaceData(input.positionCS, surfaceData, inputData);
- #endif
- #ifdef _ASE_LIGHTING_SIMPLE
- half4 color = UniversalFragmentBlinnPhong( inputData, surfaceData);
- #else
- half4 color = UniversalFragmentPBR( inputData, surfaceData);
- #endif
- #ifdef ASE_TRANSMISSION
- {
- float shadow = _TransmissionShadow;
- #define SUM_LIGHT_TRANSMISSION(Light)\
- float3 atten = Light.color * Light.distanceAttenuation;\
- atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
- half3 transmission = max( 0, -dot( inputData.normalWS, Light.direction ) ) * atten * Transmission;\
- color.rgb += BaseColor * transmission;
- SUM_LIGHT_TRANSMISSION( GetMainLight( inputData.shadowCoord ) );
- #if defined(_ADDITIONAL_LIGHTS)
- uint meshRenderingLayers = GetMeshRenderingLayer();
- uint pixelLightCount = GetAdditionalLightsCount();
- #if USE_FORWARD_PLUS
- [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
- {
- FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
- Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
- #ifdef _LIGHT_LAYERS
- if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
- #endif
- {
- SUM_LIGHT_TRANSMISSION( light );
- }
- }
- #endif
- LIGHT_LOOP_BEGIN( pixelLightCount )
- Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
- #ifdef _LIGHT_LAYERS
- if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
- #endif
- {
- SUM_LIGHT_TRANSMISSION( light );
- }
- LIGHT_LOOP_END
- #endif
- }
- #endif
- #ifdef ASE_TRANSLUCENCY
- {
- float shadow = _TransShadow;
- float normal = _TransNormal;
- float scattering = _TransScattering;
- float direct = _TransDirect;
- float ambient = _TransAmbient;
- float strength = _TransStrength;
- #define SUM_LIGHT_TRANSLUCENCY(Light)\
- float3 atten = Light.color * Light.distanceAttenuation;\
- atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
- half3 lightDir = Light.direction + inputData.normalWS * normal;\
- half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );\
- half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;\
- color.rgb += BaseColor * translucency * strength;
- SUM_LIGHT_TRANSLUCENCY( GetMainLight( inputData.shadowCoord ) );
- #if defined(_ADDITIONAL_LIGHTS)
- uint meshRenderingLayers = GetMeshRenderingLayer();
- uint pixelLightCount = GetAdditionalLightsCount();
- #if USE_FORWARD_PLUS
- [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
- {
- FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
- Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
- #ifdef _LIGHT_LAYERS
- if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
- #endif
- {
- SUM_LIGHT_TRANSLUCENCY( light );
- }
- }
- #endif
- LIGHT_LOOP_BEGIN( pixelLightCount )
- Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask);
- #ifdef _LIGHT_LAYERS
- if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
- #endif
- {
- SUM_LIGHT_TRANSLUCENCY( light );
- }
- LIGHT_LOOP_END
- #endif
- }
- #endif
- #ifdef ASE_REFRACTION
- float4 projScreenPos = ScreenPos / ScreenPos.w;
- float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) );
- projScreenPos.xy += refractionOffset.xy;
- float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor;
- color.rgb = lerp( refraction, color.rgb, color.a );
- color.a = 1;
- #endif
- #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
- color.rgb *= color.a;
- #endif
- #ifdef ASE_FOG
- #ifdef TERRAIN_SPLAT_ADDPASS
- color.rgb = MixFogColor(color.rgb, half3(0,0,0), inputData.fogCoord);
- #else
- color.rgb = MixFog(color.rgb, inputData.fogCoord);
- #endif
- #endif
- #ifdef ASE_DEPTH_WRITE_ON
- outputDepth = DepthValue;
- #endif
- #ifdef _WRITE_RENDERING_LAYERS
- uint renderingLayers = GetMeshRenderingLayer();
- outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
- #endif
- return color;
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "ShadowCaster"
- Tags { "LightMode"="ShadowCaster" }
- ZWrite On
- ZTest LEqual
- AlphaToMask Off
- ColorMask 0
- HLSLPROGRAM
- #pragma multi_compile _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #pragma multi_compile_instancing
- #pragma multi_compile _ LOD_FADE_CROSSFADE
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_SHADOWCASTER
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
- #if defined(LOD_FADE_CROSSFADE)
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
- #endif
- #define ASE_NEEDS_FRAG_SCREEN_POSITION
- #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
- #define ASE_SV_DEPTH SV_DepthLessEqual
- #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
- #else
- #define ASE_SV_DEPTH SV_Depth
- #define ASE_SV_POSITION_QUALIFIERS
- #endif
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
- float4 clipPosV : TEXCOORD0;
- float3 positionWS : TEXCOORD1;
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- float4 shadowCoord : TEXCOORD2;
- #endif
- float4 ase_texcoord3 : TEXCOORD3;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
-
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- float3 _LightDirection;
- float3 _LightPosition;
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( output );
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- output.ase_texcoord3.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord3.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
- float3 normalWS = TransformObjectToWorldDir(input.normalOS);
- #if _CASTING_PUNCTUAL_LIGHT_SHADOW
- float3 lightDirectionWS = normalize(_LightPosition - positionWS);
- #else
- float3 lightDirectionWS = _LightDirection;
- #endif
- float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS));
- //code for UNITY_REVERSED_Z is moved into Shadows.hlsl from 6000.0.22 and or higher
- positionCS = ApplyShadowClamping(positionCS);
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- VertexPositionInputs vertexInput = (VertexPositionInputs)0;
- vertexInput.positionWS = positionWS;
- vertexInput.positionCS = positionCS;
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- output.positionCS = positionCS;
- output.clipPosV = positionCS;
- output.positionWS = positionWS;
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.ase_texcoord = input.ase_texcoord;
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag( PackedVaryings input
- #ifdef ASE_DEPTH_WRITE_ON
- ,out float outputDepth : ASE_SV_DEPTH
- #endif
- ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID( input );
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
- float3 WorldPosition = input.positionWS;
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- float4 ClipPos = input.clipPosV;
- float4 ScreenPos = ComputeScreenPos( input.clipPosV );
- #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #endif
- #endif
- float4 ase_positionSSNorm = ScreenPos / ScreenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float DeepShallowMask197 = clampResult81;
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_0 = (_FoamNoiseScale).xx;
- float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_0 + temp_cast_1;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- float AlphaClipThresholdShadow = 0.5;
- #ifdef ASE_DEPTH_WRITE_ON
- float DepthValue = input.positionCS.z;
- #endif
- #ifdef _ALPHATEST_ON
- #ifdef _ALPHATEST_SHADOW_ON
- clip(Alpha - AlphaClipThresholdShadow);
- #else
- clip(Alpha - AlphaClipThreshold);
- #endif
- #endif
- #if defined(LOD_FADE_CROSSFADE)
- LODFadeCrossFade( input.positionCS );
- #endif
- #ifdef ASE_DEPTH_WRITE_ON
- outputDepth = DepthValue;
- #endif
- return 0;
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "DepthOnly"
- Tags { "LightMode"="DepthOnly" }
- ZWrite On
- ColorMask R
- AlphaToMask Off
- HLSLPROGRAM
- #pragma multi_compile _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #pragma multi_compile_instancing
- #pragma multi_compile _ LOD_FADE_CROSSFADE
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_DEPTHONLY
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
- #if defined(LOD_FADE_CROSSFADE)
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
- #endif
- #define ASE_NEEDS_FRAG_SCREEN_POSITION
- #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
- #define ASE_SV_DEPTH SV_DepthLessEqual
- #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
- #else
- #define ASE_SV_DEPTH SV_Depth
- #define ASE_SV_POSITION_QUALIFIERS
- #endif
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
- float4 clipPosV : TEXCOORD0;
- float3 positionWS : TEXCOORD1;
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- float4 shadowCoord : TEXCOORD2;
- #endif
- float4 ase_texcoord3 : TEXCOORD3;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
-
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- output.ase_texcoord3.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord3.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- output.positionCS = vertexInput.positionCS;
- output.clipPosV = vertexInput.positionCS;
- output.positionWS = vertexInput.positionWS;
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.ase_texcoord = input.ase_texcoord;
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag( PackedVaryings input
- #ifdef ASE_DEPTH_WRITE_ON
- ,out float outputDepth : ASE_SV_DEPTH
- #endif
- ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
- float3 WorldPosition = input.positionWS;
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- float4 ClipPos = input.clipPosV;
- float4 ScreenPos = ComputeScreenPos( input.clipPosV );
- #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #endif
- #endif
- float4 ase_positionSSNorm = ScreenPos / ScreenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float DeepShallowMask197 = clampResult81;
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_0 = (_FoamNoiseScale).xx;
- float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_0 + temp_cast_1;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- #ifdef ASE_DEPTH_WRITE_ON
- float DepthValue = input.positionCS.z;
- #endif
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- #if defined(LOD_FADE_CROSSFADE)
- LODFadeCrossFade( input.positionCS );
- #endif
- #ifdef ASE_DEPTH_WRITE_ON
- outputDepth = DepthValue;
- #endif
- return 0;
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "Meta"
- Tags { "LightMode"="Meta" }
- Cull Off
- HLSLPROGRAM
- #pragma multi_compile_fragment _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #define REQUIRE_OPAQUE_TEXTURE 1
- #pragma shader_feature EDITOR_VISUALIZATION
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_META
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
-
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 texcoord0 : TEXCOORD0;
- float4 texcoord1 : TEXCOORD1;
- float4 texcoord2 : TEXCOORD2;
-
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- float4 positionCS : SV_POSITION;
- #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
- float3 positionWS : TEXCOORD0;
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- float4 shadowCoord : TEXCOORD1;
- #endif
- #ifdef EDITOR_VISUALIZATION
- float4 VizUV : TEXCOORD2;
- float4 LightCoord : TEXCOORD3;
- #endif
- float4 ase_texcoord4 : TEXCOORD4;
- float4 ase_texcoord5 : TEXCOORD5;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
- sampler2D _NormalMapTexture;
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- inline float4 ASE_ComputeGrabScreenPos( float4 pos )
- {
- #if UNITY_UV_STARTS_AT_TOP
- float scale = -1.0;
- #else
- float scale = 1.0;
- #endif
- float4 o = pos;
- o.y = pos.w * 0.5f;
- o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
- return o;
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz);
- float4 screenPos = ComputeScreenPos(ase_positionCS);
- output.ase_texcoord4 = screenPos;
-
- output.ase_texcoord5.xy = input.texcoord0.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord5.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
- #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
- output.positionWS = positionWS;
- #endif
- output.positionCS = MetaVertexPosition( input.positionOS, input.texcoord1.xy, input.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
- #ifdef EDITOR_VISUALIZATION
- float2 VizUV = 0;
- float4 LightCoord = 0;
- UnityEditorVizData(input.positionOS.xyz, input.texcoord0.xy, input.texcoord1.xy, input.texcoord2.xy, VizUV, LightCoord);
- output.VizUV = float4(VizUV, 0, 0);
- output.LightCoord = LightCoord;
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- VertexPositionInputs vertexInput = (VertexPositionInputs)0;
- vertexInput.positionWS = positionWS;
- vertexInput.positionCS = output.positionCS;
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 texcoord0 : TEXCOORD0;
- float4 texcoord1 : TEXCOORD1;
- float4 texcoord2 : TEXCOORD2;
-
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.texcoord0 = input.texcoord0;
- output.texcoord1 = input.texcoord1;
- output.texcoord2 = input.texcoord2;
-
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z;
- output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
- output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
-
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag(PackedVaryings input ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
- #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
- float3 WorldPosition = input.positionWS;
- #endif
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #endif
- #endif
- float4 screenPos = input.ase_texcoord4;
- float4 ase_positionSSNorm = screenPos / screenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) );
- float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
- float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
- float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0));
- float mulTime251 = _TimeParameters.x * 0.1;
- float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx;
- float2 texCoord254 = input.ase_texcoord5.xy * appendResult405.xy + temp_cast_1;
- float2 temp_output_2_0_g9 = texCoord254;
- float2 break6_g9 = temp_output_2_0_g9;
- float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 );
- float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y));
- float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 );
- float temp_output_4_0_g9 = 1.0;
- float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 )));
- float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) );
- float3 NORMALMAPWAVES243 = normalizeResult22_g9;
- float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 );
- float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 );
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81);
- float4 DeepShallowColor196 = lerpResult86;
- float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 ));
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_4 = (_FoamNoiseScale).xx;
- float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord5.xy * temp_cast_4 + temp_cast_5;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float4 FoamColor442 = ( temp_output_471_0 * _FoamColor );
-
- float DeepShallowMask197 = clampResult81;
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb;
- float3 Emission = 0;
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- MetaInput metaInput = (MetaInput)0;
- metaInput.Albedo = BaseColor;
- metaInput.Emission = Emission;
- #ifdef EDITOR_VISUALIZATION
- metaInput.VizUV = input.VizUV.xy;
- metaInput.LightCoord = input.LightCoord;
- #endif
- return UnityMetaFragment(metaInput);
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "Universal2D"
- Tags { "LightMode"="Universal2D" }
- Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
- ZWrite On
- ZTest LEqual
- Offset 0 , 0
- ColorMask RGBA
- HLSLPROGRAM
- #pragma multi_compile_fragment _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #define REQUIRE_OPAQUE_TEXTURE 1
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_2D
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
-
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- float4 positionCS : SV_POSITION;
- #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
- float3 positionWS : TEXCOORD0;
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- float4 shadowCoord : TEXCOORD1;
- #endif
- float4 ase_texcoord2 : TEXCOORD2;
- float4 ase_texcoord3 : TEXCOORD3;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
- sampler2D _NormalMapTexture;
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- inline float4 ASE_ComputeGrabScreenPos( float4 pos )
- {
- #if UNITY_UV_STARTS_AT_TOP
- float scale = -1.0;
- #else
- float scale = 1.0;
- #endif
- float4 o = pos;
- o.y = pos.w * 0.5f;
- o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
- return o;
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID( input );
- UNITY_TRANSFER_INSTANCE_ID( input, output );
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( output );
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz);
- float4 screenPos = ComputeScreenPos(ase_positionCS);
- output.ase_texcoord2 = screenPos;
-
- output.ase_texcoord3.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord3.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
- #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
- output.positionWS = vertexInput.positionWS;
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- output.positionCS = vertexInput.positionCS;
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.ase_texcoord = input.ase_texcoord;
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag(PackedVaryings input ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID( input );
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
- #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
- float3 WorldPosition = input.positionWS;
- #endif
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #endif
- #endif
- float4 screenPos = input.ase_texcoord2;
- float4 ase_positionSSNorm = screenPos / screenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) );
- float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
- float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
- float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0));
- float mulTime251 = _TimeParameters.x * 0.1;
- float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx;
- float2 texCoord254 = input.ase_texcoord3.xy * appendResult405.xy + temp_cast_1;
- float2 temp_output_2_0_g9 = texCoord254;
- float2 break6_g9 = temp_output_2_0_g9;
- float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 );
- float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y));
- float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 );
- float temp_output_4_0_g9 = 1.0;
- float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 )));
- float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) );
- float3 NORMALMAPWAVES243 = normalizeResult22_g9;
- float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 );
- float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 );
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81);
- float4 DeepShallowColor196 = lerpResult86;
- float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 ));
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_4 = (_FoamNoiseScale).xx;
- float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_4 + temp_cast_5;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float4 FoamColor442 = ( temp_output_471_0 * _FoamColor );
-
- float DeepShallowMask197 = clampResult81;
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb;
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- half4 color = half4(BaseColor, Alpha );
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- return color;
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "DepthNormals"
- Tags { "LightMode"="DepthNormals" }
- ZWrite On
- Blend One Zero
- ZTest LEqual
- ZWrite On
- HLSLPROGRAM
- #pragma multi_compile _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #pragma multi_compile_instancing
- #pragma multi_compile _ LOD_FADE_CROSSFADE
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
- //#define SHADERPASS SHADERPASS_DEPTHNORMALS
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
- #if defined(LOD_FADE_CROSSFADE)
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
- #endif
- #define ASE_NEEDS_FRAG_SCREEN_POSITION
- #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
- #define ASE_SV_DEPTH SV_DepthLessEqual
- #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
- #else
- #define ASE_SV_DEPTH SV_Depth
- #define ASE_SV_POSITION_QUALIFIERS
- #endif
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 tangentOS : TANGENT;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
- float4 clipPosV : TEXCOORD0;
- float3 positionWS : TEXCOORD1;
- float3 normalWS : TEXCOORD2;
- float4 tangentWS : TEXCOORD3;
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- float4 shadowCoord : TEXCOORD4;
- #endif
- float4 ase_texcoord5 : TEXCOORD5;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
- sampler2D _NormalMapTexture;
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- output.ase_texcoord5.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord5.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- input.tangentOS = input.tangentOS;
- VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
- float3 normalWS = TransformObjectToWorldNormal( input.normalOS );
- float4 tangentWS = float4( TransformObjectToWorldDir( input.tangentOS.xyz ), input.tangentOS.w );
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- output.positionCS = vertexInput.positionCS;
- output.clipPosV = vertexInput.positionCS;
- output.positionWS = vertexInput.positionWS;
- output.normalWS = normalWS;
- output.tangentWS = tangentWS;
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 tangentOS : TANGENT;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.tangentOS = input.tangentOS;
- output.ase_texcoord = input.ase_texcoord;
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
- output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- void frag( PackedVaryings input
- , out half4 outNormalWS : SV_Target0
- #ifdef ASE_DEPTH_WRITE_ON
- ,out float outputDepth : ASE_SV_DEPTH
- #endif
- #ifdef _WRITE_RENDERING_LAYERS
- , out float4 outRenderingLayers : SV_Target1
- #endif
- )
- {
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- float3 WorldNormal = input.normalWS;
- float4 WorldTangent = input.tangentWS;
- float3 WorldPosition = input.positionWS;
- float4 ClipPos = input.clipPosV;
- float4 ScreenPos = ComputeScreenPos( input.clipPosV );
- #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #endif
- #endif
- float4 ase_positionSSNorm = ScreenPos / ScreenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_0 = (_FoamNoiseScale).xx;
- float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord5.xy * temp_cast_0 + temp_cast_1;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float FoamMask439 = temp_output_471_0;
- float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0));
- float mulTime251 = _TimeParameters.x * 0.1;
- float2 temp_cast_3 = (( mulTime251 * _NormalMapWavesSpeed )).xx;
- float2 texCoord254 = input.ase_texcoord5.xy * appendResult405.xy + temp_cast_3;
- float2 temp_output_2_0_g9 = texCoord254;
- float2 break6_g9 = temp_output_2_0_g9;
- float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 );
- float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y));
- float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 );
- float temp_output_4_0_g9 = 1.0;
- float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 )));
- float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) );
- float3 NORMALMAPWAVES243 = normalizeResult22_g9;
- float4 color478 = IsGammaSpace() ? float4(0.4980392,0.4980392,1,0) : float4(0.2122307,0.2122307,1,0);
- float layeredBlendVar477 = FoamMask439;
- float4 layeredBlend477 = ( lerp( float4( NORMALMAPWAVES243 , 0.0 ),color478 , layeredBlendVar477 ) );
- float4 normalizeResult474 = normalize( layeredBlend477 );
-
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float DeepShallowMask197 = clampResult81;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float3 Normal = normalizeResult474.rgb;
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- #ifdef ASE_DEPTH_WRITE_ON
- float DepthValue = input.positionCS.z;
- #endif
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- #if defined(LOD_FADE_CROSSFADE)
- LODFadeCrossFade( input.positionCS );
- #endif
- #ifdef ASE_DEPTH_WRITE_ON
- outputDepth = DepthValue;
- #endif
- #if defined(_GBUFFER_NORMALS_OCT)
- float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal);
- float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5);
- half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS);
- outNormalWS = half4(packedNormalWS, 0.0);
- #else
- #if defined(_NORMALMAP)
- #if _NORMAL_DROPOFF_TS
- float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
- float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz);
- float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz));
- #elif _NORMAL_DROPOFF_OS
- float3 normalWS = TransformObjectToWorldNormal(Normal);
- #elif _NORMAL_DROPOFF_WS
- float3 normalWS = Normal;
- #endif
- #else
- float3 normalWS = WorldNormal;
- #endif
- outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0);
- #endif
- #ifdef _WRITE_RENDERING_LAYERS
- uint renderingLayers = GetMeshRenderingLayer();
- outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0);
- #endif
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "GBuffer"
- Tags { "LightMode"="UniversalGBuffer" }
- Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
- ZWrite On
- ZTest LEqual
- Offset 0 , 0
- ColorMask RGBA
-
- HLSLPROGRAM
- #pragma multi_compile_fragment _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #pragma shader_feature_local _RECEIVE_SHADOWS_OFF
- #pragma multi_compile_instancing
- #pragma instancing_options renderinglayer
- #pragma multi_compile _ LOD_FADE_CROSSFADE
- #pragma multi_compile_fog
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #define REQUIRE_OPAQUE_TEXTURE 1
- #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
- #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
- #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
- #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
- #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
- #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
- #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
- #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
- #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
- #pragma multi_compile _ SHADOWS_SHADOWMASK
- #pragma multi_compile _ DIRLIGHTMAP_COMBINED
- #pragma multi_compile _ USE_LEGACY_LIGHTMAPS
- #pragma multi_compile _ LIGHTMAP_ON
- #pragma multi_compile _ DYNAMICLIGHTMAP_ON
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SHADERPASS SHADERPASS_GBUFFER
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
- #if defined(LOD_FADE_CROSSFADE)
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
- #endif
-
- #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
- #define ENABLE_TERRAIN_PERPIXEL_NORMAL
- #endif
- #define ASE_NEEDS_FRAG_SCREEN_POSITION
- #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
- #define ASE_SV_DEPTH SV_DepthLessEqual
- #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
- #else
- #define ASE_SV_DEPTH SV_Depth
- #define ASE_SV_POSITION_QUALIFIERS
- #endif
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 tangentOS : TANGENT;
- float4 texcoord : TEXCOORD0;
- float4 texcoord1 : TEXCOORD1;
- float4 texcoord2 : TEXCOORD2;
-
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
- float4 clipPosV : TEXCOORD0;
- float4 lightmapUVOrVertexSH : TEXCOORD1;
- #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX)
- half4 fogFactorAndVertexLight : TEXCOORD2;
- #endif
- float4 tSpace0 : TEXCOORD3;
- float4 tSpace1 : TEXCOORD4;
- float4 tSpace2 : TEXCOORD5;
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- float4 shadowCoord : TEXCOORD6;
- #endif
- #if defined(DYNAMICLIGHTMAP_ON)
- float2 dynamicLightmapUV : TEXCOORD7;
- #endif
- #if defined(USE_APV_PROBE_OCCLUSION)
- float4 probeOcclusion : TEXCOORD8;
- #endif
- float4 ase_texcoord9 : TEXCOORD9;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
- sampler2D _NormalMapTexture;
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl"
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- inline float4 ASE_ComputeGrabScreenPos( float4 pos )
- {
- #if UNITY_UV_STARTS_AT_TOP
- float scale = -1.0;
- #else
- float scale = 1.0;
- #endif
- float4 o = pos;
- o.y = pos.w * 0.5f;
- o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
- return o;
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- output.ase_texcoord9.xy = input.texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord9.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- input.tangentOS = input.tangentOS;
- VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
- VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS );
- output.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x);
- output.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y);
- output.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z);
- #if defined(LIGHTMAP_ON)
- OUTPUT_LIGHTMAP_UV(input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy);
- #endif
- #if defined(DYNAMICLIGHTMAP_ON)
- output.dynamicLightmapUV.xy = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
- #endif
- OUTPUT_SH4( vertexInput.positionWS, normalInput.normalWS.xyz, GetWorldSpaceNormalizeViewDir( vertexInput.positionWS ), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion );
- #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
- output.lightmapUVOrVertexSH.zw = input.texcoord.xy;
- output.lightmapUVOrVertexSH.xy = input.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
- #endif
- #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX)
- output.fogFactorAndVertexLight = 0;
- #if defined(ASE_FOG) && !defined(_FOG_FRAGMENT)
- // @diogo: no fog applied in GBuffer
- #endif
- #ifdef _ADDITIONAL_LIGHTS_VERTEX
- half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
- output.fogFactorAndVertexLight.yzw = vertexLight;
- #endif
- #endif
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- output.shadowCoord = GetShadowCoord( vertexInput );
- #endif
- output.positionCS = vertexInput.positionCS;
- output.clipPosV = vertexInput.positionCS;
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 tangentOS : TANGENT;
- float4 texcoord : TEXCOORD0;
- float4 texcoord1 : TEXCOORD1;
- float4 texcoord2 : TEXCOORD2;
-
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.tangentOS = input.tangentOS;
- output.texcoord = input.texcoord;
- output.texcoord1 = input.texcoord1;
- output.texcoord2 = input.texcoord2;
-
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
- output.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
- output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
- output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
-
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- FragmentOutput frag ( PackedVaryings input
- #ifdef ASE_DEPTH_WRITE_ON
- ,out float outputDepth : ASE_SV_DEPTH
- #endif
- )
- {
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
- #if defined(LOD_FADE_CROSSFADE)
- LODFadeCrossFade( input.positionCS );
- #endif
- #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
- float2 sampleCoords = (input.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
- float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
- float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
- float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
- #else
- float3 WorldNormal = normalize( input.tSpace0.xyz );
- float3 WorldTangent = input.tSpace1.xyz;
- float3 WorldBiTangent = input.tSpace2.xyz;
- #endif
- float3 WorldPosition = float3(input.tSpace0.w,input.tSpace1.w,input.tSpace2.w);
- float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
- float4 ShadowCoords = float4( 0, 0, 0, 0 );
- float4 ClipPos = input.clipPosV;
- float4 ScreenPos = ComputeScreenPos( input.clipPosV );
- float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
- #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
- ShadowCoords = input.shadowCoord;
- #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
- ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
- #else
- ShadowCoords = float4(0, 0, 0, 0);
- #endif
- WorldViewDirection = SafeNormalize( WorldViewDirection );
- float4 ase_positionSSNorm = ScreenPos / ScreenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) );
- float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos );
- float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
- float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0));
- float mulTime251 = _TimeParameters.x * 0.1;
- float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx;
- float2 texCoord254 = input.ase_texcoord9.xy * appendResult405.xy + temp_cast_1;
- float2 temp_output_2_0_g9 = texCoord254;
- float2 break6_g9 = temp_output_2_0_g9;
- float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 );
- float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y));
- float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 );
- float temp_output_4_0_g9 = 1.0;
- float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 )));
- float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 )));
- float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) );
- float3 NORMALMAPWAVES243 = normalizeResult22_g9;
- float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 );
- float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 );
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81);
- float4 DeepShallowColor196 = lerpResult86;
- float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 ));
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_4 = (_FoamNoiseScale).xx;
- float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord9.xy * temp_cast_4 + temp_cast_5;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float4 FoamColor442 = ( temp_output_471_0 * _FoamColor );
-
- float FoamMask439 = temp_output_471_0;
- float4 color478 = IsGammaSpace() ? float4(0.4980392,0.4980392,1,0) : float4(0.2122307,0.2122307,1,0);
- float layeredBlendVar477 = FoamMask439;
- float4 layeredBlend477 = ( lerp( float4( NORMALMAPWAVES243 , 0.0 ),color478 , layeredBlendVar477 ) );
- float4 normalizeResult474 = normalize( layeredBlend477 );
-
- float4 temp_cast_9 = (_Smootness).xxxx;
- float4 color484 = IsGammaSpace() ? float4(0.2264151,0.2264151,0.2264151,0) : float4(0.04193995,0.04193995,0.04193995,0);
- float layeredBlendVar485 = FoamMask439;
- float4 layeredBlend485 = ( lerp( temp_cast_9,color484 , layeredBlendVar485 ) );
-
- float DeepShallowMask197 = clampResult81;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb;
- float3 Normal = normalizeResult474.rgb;
- float3 Emission = 0;
- float3 Specular = 0.5;
- float Metallic = _Mettalic;
- float Smoothness = layeredBlend485.r;
- float Occlusion = 1;
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- float AlphaClipThresholdShadow = 0.5;
- float3 BakedGI = 0;
- float3 RefractionColor = 1;
- float RefractionIndex = 1;
- float3 Transmission = 1;
- float3 Translucency = 1;
- #ifdef ASE_DEPTH_WRITE_ON
- float DepthValue = input.positionCS.z;
- #endif
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- InputData inputData = (InputData)0;
- inputData.positionWS = WorldPosition;
- inputData.positionCS = input.positionCS;
- inputData.shadowCoord = ShadowCoords;
- #ifdef _NORMALMAP
- #if _NORMAL_DROPOFF_TS
- inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal ));
- #elif _NORMAL_DROPOFF_OS
- inputData.normalWS = TransformObjectToWorldNormal(Normal);
- #elif _NORMAL_DROPOFF_WS
- inputData.normalWS = Normal;
- #endif
- #else
- inputData.normalWS = WorldNormal;
- #endif
- inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
- inputData.viewDirectionWS = SafeNormalize( WorldViewDirection );
- #ifdef ASE_FOG
- // @diogo: no fog applied in GBuffer
- #endif
- #ifdef _ADDITIONAL_LIGHTS_VERTEX
- inputData.vertexLighting = input.fogFactorAndVertexLight.yzw;
- #endif
- #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
- float3 SH = SampleSH(inputData.normalWS.xyz);
- #else
- float3 SH = input.lightmapUVOrVertexSH.xyz;
- #endif
- #if defined(DYNAMICLIGHTMAP_ON)
- inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS);
- inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
- #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
- inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS),
- inputData.normalWS,
- inputData.viewDirectionWS,
- input.positionCS.xy,
- input.probeOcclusion,
- inputData.shadowMask );
- #else
- inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
- inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy);
- #endif
- #ifdef ASE_BAKEDGI
- inputData.bakedGI = BakedGI;
- #endif
- inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
- #if defined(DEBUG_DISPLAY)
- #if defined(DYNAMICLIGHTMAP_ON)
- inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy;
- #endif
- #if defined(LIGHTMAP_ON)
- inputData.staticLightmapUV = input.lightmapUVOrVertexSH.xy;
- #else
- inputData.vertexSH = SH;
- #endif
- #if defined(USE_APV_PROBE_OCCLUSION)
- inputData.probeOcclusion = input.probeOcclusion;
- #endif
- #endif
- #ifdef _DBUFFER
- ApplyDecal(input.positionCS,
- BaseColor,
- Specular,
- inputData.normalWS,
- Metallic,
- Occlusion,
- Smoothness);
- #endif
- BRDFData brdfData;
- InitializeBRDFData
- (BaseColor, Metallic, Specular, Smoothness, Alpha, brdfData);
- Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask);
- half4 color;
- MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask);
- color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS);
- color.a = Alpha;
- #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
- color.rgb *= color.a;
- #endif
- #ifdef ASE_DEPTH_WRITE_ON
- outputDepth = DepthValue;
- #endif
- return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb, Occlusion);
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "SceneSelectionPass"
- Tags { "LightMode"="SceneSelectionPass" }
- Cull Off
- AlphaToMask Off
- HLSLPROGRAM
- #define _NORMAL_DROPOFF_TS 1
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SCENESELECTIONPASS 1
- #define ATTRIBUTES_NEED_NORMAL
- #define ATTRIBUTES_NEED_TANGENT
- #define SHADERPASS SHADERPASS_DEPTHONLY
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
-
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- float4 positionCS : SV_POSITION;
- float4 ase_texcoord : TEXCOORD0;
- float4 ase_texcoord1 : TEXCOORD1;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
-
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- struct SurfaceDescription
- {
- float Alpha;
- float AlphaClipThreshold;
- };
- PackedVaryings VertexFunction(Attributes input )
- {
- PackedVaryings output;
- ZERO_INITIALIZE(PackedVaryings, output);
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz);
- float4 screenPos = ComputeScreenPos(ase_positionCS);
- output.ase_texcoord = screenPos;
-
- output.ase_texcoord1.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord1.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
- output.positionCS = TransformWorldToHClip(positionWS);
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.ase_texcoord = input.ase_texcoord;
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag(PackedVaryings input ) : SV_Target
- {
- SurfaceDescription surfaceDescription = (SurfaceDescription)0;
- float4 screenPos = input.ase_texcoord;
- float4 ase_positionSSNorm = screenPos / screenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float DeepShallowMask197 = clampResult81;
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_0 = (_FoamNoiseScale).xx;
- float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord1.xy * temp_cast_0 + temp_cast_1;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- surfaceDescription.Alpha = TRANSPARENCYFINAL267;
- surfaceDescription.AlphaClipThreshold = 0.5;
- #if _ALPHATEST_ON
- float alphaClipThreshold = 0.01f;
- #if ALPHA_CLIP_THRESHOLD
- alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
- #endif
- clip(surfaceDescription.Alpha - alphaClipThreshold);
- #endif
- half4 outColor = 0;
- #ifdef SCENESELECTIONPASS
- outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
- #elif defined(SCENEPICKINGPASS)
- outColor = _SelectionID;
- #endif
- return outColor;
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "ScenePickingPass"
- Tags { "LightMode"="Picking" }
- AlphaToMask Off
- HLSLPROGRAM
- #define _NORMAL_DROPOFF_TS 1
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
- #define SCENEPICKINGPASS 1
- #define ATTRIBUTES_NEED_NORMAL
- #define ATTRIBUTES_NEED_TANGENT
- #define SHADERPASS SHADERPASS_DEPTHONLY
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
-
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- float4 positionCS : SV_POSITION;
- float4 ase_texcoord : TEXCOORD0;
- float4 ase_texcoord1 : TEXCOORD1;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
-
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- struct SurfaceDescription
- {
- float Alpha;
- float AlphaClipThreshold;
- };
- PackedVaryings VertexFunction(Attributes input )
- {
- PackedVaryings output;
- ZERO_INITIALIZE(PackedVaryings, output);
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz);
- float4 screenPos = ComputeScreenPos(ase_positionCS);
- output.ase_texcoord = screenPos;
-
- output.ase_texcoord1.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord1.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- input.normalOS = input.normalOS;
- float3 positionWS = TransformObjectToWorld( input.positionOS.xyz );
- output.positionCS = TransformWorldToHClip(positionWS);
- return output;
- }
- #if defined(ASE_TESSELLATION)
- struct VertexControl
- {
- float4 positionOS : INTERNALTESSPOS;
- float3 normalOS : NORMAL;
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct TessellationFactors
- {
- float edge[3] : SV_TessFactor;
- float inside : SV_InsideTessFactor;
- };
- VertexControl vert ( Attributes input )
- {
- VertexControl output;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- output.positionOS = input.positionOS;
- output.normalOS = input.normalOS;
- output.ase_texcoord = input.ase_texcoord;
- return output;
- }
- TessellationFactors TessellationFunction (InputPatch<VertexControl,3> input)
- {
- TessellationFactors output;
- float4 tf = 1;
- float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
- float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
- #if defined(ASE_FIXED_TESSELLATION)
- tf = FixedTess( tessValue );
- #elif defined(ASE_DISTANCE_TESSELLATION)
- tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
- #elif defined(ASE_LENGTH_TESSELLATION)
- tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
- #elif defined(ASE_LENGTH_CULL_TESSELLATION)
- tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
- #endif
- output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w;
- return output;
- }
- [domain("tri")]
- [partitioning("fractional_odd")]
- [outputtopology("triangle_cw")]
- [patchconstantfunc("TessellationFunction")]
- [outputcontrolpoints(3)]
- VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
- {
- return patch[id];
- }
- [domain("tri")]
- PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
- {
- Attributes output = (Attributes) 0;
- output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z;
- output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
- output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
- #if defined(ASE_PHONG_TESSELLATION)
- float3 pp[3];
- for (int i = 0; i < 3; ++i)
- pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS));
- float phongStrength = _TessPhongStrength;
- output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz;
- #endif
- UNITY_TRANSFER_INSTANCE_ID(patch[0], output);
- return VertexFunction(output);
- }
- #else
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- #endif
- half4 frag(PackedVaryings input ) : SV_Target
- {
- SurfaceDescription surfaceDescription = (SurfaceDescription)0;
- float4 screenPos = input.ase_texcoord;
- float4 ase_positionSSNorm = screenPos / screenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float DeepShallowMask197 = clampResult81;
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_0 = (_FoamNoiseScale).xx;
- float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord1.xy * temp_cast_0 + temp_cast_1;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- surfaceDescription.Alpha = TRANSPARENCYFINAL267;
- surfaceDescription.AlphaClipThreshold = 0.5;
- #if _ALPHATEST_ON
- float alphaClipThreshold = 0.01f;
- #if ALPHA_CLIP_THRESHOLD
- alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
- #endif
- clip(surfaceDescription.Alpha - alphaClipThreshold);
- #endif
- half4 outColor = 0;
- #ifdef SCENESELECTIONPASS
- outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
- #elif defined(SCENEPICKINGPASS)
- outColor = _SelectionID;
- #endif
- return outColor;
- }
- ENDHLSL
- }
-
- Pass
- {
-
- Name "MotionVectors"
- Tags { "LightMode"="MotionVectors" }
- ColorMask RG
- HLSLPROGRAM
- #pragma multi_compile _ALPHATEST_ON
- #define _NORMAL_DROPOFF_TS 1
- #pragma multi_compile_instancing
- #pragma multi_compile _ LOD_FADE_CROSSFADE
- #define ASE_FOG 1
- #define _SURFACE_TYPE_TRANSPARENT 1
- #define _NORMALMAP 1
- #define ASE_VERSION 19800
- #define ASE_SRP_VERSION 170003
- #define REQUIRE_DEPTH_TEXTURE 1
- #pragma vertex vert
- #pragma fragment frag
- #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE)
- #define _SPECULAR_COLOR 1
- #endif
-
- #define SHADERPASS SHADERPASS_MOTION_VECTORS
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
- #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
- #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
- #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
- #if defined(LOD_FADE_CROSSFADE)
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
- #endif
- #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MotionVectorsCommon.hlsl"
-
- struct Attributes
- {
- float4 positionOS : POSITION;
- float3 positionOld : TEXCOORD4;
- #if _ADD_PRECOMPUTED_VELOCITY
- float3 alembicMotionVector : TEXCOORD5;
- #endif
- float4 ase_texcoord : TEXCOORD0;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- };
- struct PackedVaryings
- {
- float4 positionCS : SV_POSITION;
- float4 positionCSNoJitter : TEXCOORD0;
- float4 previousPositionCSNoJitter : TEXCOORD1;
- float4 ase_texcoord2 : TEXCOORD2;
- float4 ase_texcoord3 : TEXCOORD3;
- UNITY_VERTEX_INPUT_INSTANCE_ID
- UNITY_VERTEX_OUTPUT_STEREO
- };
- CBUFFER_START(UnityPerMaterial)
- float4 _ShallowColor;
- float4 _DeepColor;
- float4 _FoamColor;
- float _WaveAmplitude;
- float _WaveSpeed;
- float _WaveTile;
- float _NormalMapsWavesSize;
- float _NormalMapWavesSpeed;
- float _DepthStrength;
- float _Depth;
- float _FoamAmount;
- float _FoamPower;
- float _FoamNoiseScale;
- float _Mettalic;
- float _Smootness;
- #ifdef ASE_TRANSMISSION
- float _TransmissionShadow;
- #endif
- #ifdef ASE_TRANSLUCENCY
- float _TransStrength;
- float _TransNormal;
- float _TransScattering;
- float _TransDirect;
- float _TransAmbient;
- float _TransShadow;
- #endif
- #ifdef ASE_TESSELLATION
- float _TessPhongStrength;
- float _TessValue;
- float _TessMin;
- float _TessMax;
- float _TessEdgeLength;
- float _TessMaxDisp;
- #endif
- CBUFFER_END
- #ifdef SCENEPICKINGPASS
- float4 _SelectionID;
- #endif
- #ifdef SCENESELECTIONPASS
- int _ObjectId;
- int _PassValue;
- #endif
-
- float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; }
- float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); }
- float snoise( float2 v )
- {
- const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 );
- float2 i = floor( v + dot( v, C.yy ) );
- float2 x0 = v - i + dot( i, C.xx );
- float2 i1;
- i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 );
- float4 x12 = x0.xyxy + C.xxzz;
- x12.xy -= i1;
- i = mod2D289( i );
- float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) );
- float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 );
- m = m * m;
- m = m * m;
- float3 x = 2.0 * frac( p * C.www ) - 1.0;
- float3 h = abs( x ) - 0.5;
- float3 ox = floor( x + 0.5 );
- float3 a0 = x - ox;
- m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h );
- float3 g;
- g.x = a0.x * x0.x + h.x * x0.y;
- g.yz = a0.yz * x12.xz + h.yz * x12.yw;
- return 130.0 * dot( m, g );
- }
-
- float2 UnityGradientNoiseDir( float2 p )
- {
- p = fmod(p , 289);
- float x = fmod((34 * p.x + 1) * p.x , 289) + p.y;
- x = fmod( (34 * x + 1) * x , 289);
- x = frac( x / 41 ) * 2 - 1;
- return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) );
- }
-
- float UnityGradientNoise( float2 UV, float Scale )
- {
- float2 p = UV * Scale;
- float2 ip = floor( p );
- float2 fp = frac( p );
- float d00 = dot( UnityGradientNoiseDir( ip ), fp );
- float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) );
- float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) );
- float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) );
- fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 );
- return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5;
- }
-
- PackedVaryings VertexFunction( Attributes input )
- {
- PackedVaryings output = (PackedVaryings)0;
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_TRANSFER_INSTANCE_ID(input, output);
- UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
- float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0));
- float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz );
- float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0));
- float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy);
- float simplePerlin2D143 = snoise( panner145 );
- simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5;
- float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 );
- float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx;
-
- float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz);
- float4 screenPos = ComputeScreenPos(ase_positionCS);
- output.ase_texcoord2 = screenPos;
-
- output.ase_texcoord3.xy = input.ase_texcoord.xy;
-
- //setting value to unused interpolator channels and avoid initialization warnings
- output.ase_texcoord3.zw = 0;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- float3 defaultVertexValue = input.positionOS.xyz;
- #else
- float3 defaultVertexValue = float3(0, 0, 0);
- #endif
- float3 vertexValue = temp_cast_3;
- #ifdef ASE_ABSOLUTE_VERTEX_POS
- input.positionOS.xyz = vertexValue;
- #else
- input.positionOS.xyz += vertexValue;
- #endif
- VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz );
- #if defined(APLICATION_SPACE_WARP_MOTION)
- // We do not need jittered position in ASW
- output.positionCSNoJitter = mul(_NonJitteredViewProjMatrix, mul(UNITY_MATRIX_M, input.positionOS));;
- output.positionCS = output.positionCSNoJitter;
- #else
- // Jittered. Match the frame.
- output.positionCS = vertexInput.positionCS;
- output.positionCSNoJitter = mul( _NonJitteredViewProjMatrix, mul( UNITY_MATRIX_M, input.positionOS));
- #endif
- float4 prevPos = ( unity_MotionVectorsParams.x == 1 ) ? float4( input.positionOld, 1 ) : input.positionOS;
- #if _ADD_PRECOMPUTED_VELOCITY
- prevPos = prevPos - float4(input.alembicMotionVector, 0);
- #endif
- output.previousPositionCSNoJitter = mul( _PrevViewProjMatrix, mul( UNITY_PREV_MATRIX_M, prevPos ) );
- // removed in ObjectMotionVectors.hlsl found in unity 6000.0.23 and higher
- //ApplyMotionVectorZBias( output.positionCS );
- return output;
- }
- PackedVaryings vert ( Attributes input )
- {
- return VertexFunction( input );
- }
- half4 frag( PackedVaryings input ) : SV_Target
- {
- UNITY_SETUP_INSTANCE_ID(input);
- UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input );
- float4 screenPos = input.ase_texcoord2;
- float4 ase_positionSSNorm = screenPos / screenPos.w;
- ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5;
- float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams );
- float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 );
- float DeepShallowMask197 = clampResult81;
- float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams);
- float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) );
- float saferPower436 = abs( distanceDepth434 );
- float temp_output_436_0 = pow( saferPower436 , _FoamPower );
- float2 temp_cast_0 = (_FoamNoiseScale).xx;
- float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx;
- float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_0 + temp_cast_1;
- float gradientNoise437 = UnityGradientNoise(texCoord433,1.0);
- gradientNoise437 = gradientNoise437*0.5 + 0.5;
- float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 );
- float FoamMask439 = temp_output_471_0;
- float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439);
- float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 );
- float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 );
-
- float Alpha = TRANSPARENCYFINAL267;
- float AlphaClipThreshold = 0.5;
- #ifdef _ALPHATEST_ON
- clip(Alpha - AlphaClipThreshold);
- #endif
- #if defined(LOD_FADE_CROSSFADE)
- LODFadeCrossFade( input.positionCS );
- #endif
- #if defined(APLICATION_SPACE_WARP_MOTION)
- return float4( CalcAswNdcMotionVectorFromCsPositions( input.positionCSNoJitter, input.previousPositionCSNoJitter ), 1 );
- #else
- return float4( CalcNdcMotionVectorFromCsPositions( input.positionCSNoJitter, input.previousPositionCSNoJitter ), 0, 0 );
- #endif
- }
- ENDHLSL
- }
-
- }
-
-
- FallBack "Hidden/Shader Graph/FallbackError"
-
- Fallback Off
- }
- /*ASEBEGIN
- Version=19800
- Node;AmplifyShaderEditor.CommentaryNode;428;-65.96826,-1461.15;Inherit;False;1745.648;737.933;Foam;16;445;443;442;441;440;439;437;436;435;434;433;432;431;430;429;471;Foam;1,1,1,1;0;0
- Node;AmplifyShaderEditor.RangedFloatNode;445;-71.74513,-811.948;Inherit;False;Constant;_FoamSpeed;Foam Speed;20;0;Create;True;0;0;0;False;0;False;0.2;0.5;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleTimeNode;429;-17.23541,-917.0339;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.CommentaryNode;91;-2474.408,466.2085;Inherit;False;1982.289;589.8825;Comment;14;63;65;67;64;83;82;66;74;81;85;86;84;197;196;Deep&ShallowColor;1,1,1,1;0;0
- Node;AmplifyShaderEditor.RangedFloatNode;430;-26.14526,-1064.283;Inherit;False;Property;_FoamNoiseScale;Foam Noise Scale;17;0;Create;True;0;0;0;False;0;False;150;150;0;1000;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;431;-27.87524,-1268.683;Inherit;False;Property;_FoamAmount;Foam Amount;15;0;Create;True;0;0;0;False;0;False;1.5;1.5;0;10;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;432;227.9714,-894.1125;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;435;256.7495,-1206.154;Inherit;False;Property;_FoamPower;Foam Power;16;0;Create;True;0;0;0;False;0;False;0.5;0.5;0.1;5;0;1;FLOAT;0
- Node;AmplifyShaderEditor.ScreenPosInputsNode;63;-2442.563,708.9407;Float;False;1;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.TextureCoordinatesNode;433;290.627,-1062.13;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.DepthFade;434;224.4038,-1418.474;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.CommentaryNode;183;-2427.607,1285.62;Inherit;False;1957.563;1136.648;Comment;21;155;156;158;151;148;150;152;157;160;149;159;153;145;162;168;170;143;169;163;188;245;WavesVertexOffset;1,1,1,1;0;0
- Node;AmplifyShaderEditor.RangedFloatNode;67;-2355.368,899.1294;Inherit;False;Property;_Depth;Depth;4;0;Create;True;0;0;0;False;0;False;0.3;0.3;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.PowerNode;436;594.9379,-1353.827;Inherit;False;True;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.NoiseGeneratorNode;437;667.4668,-1066.86;Inherit;True;Gradient;True;True;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.BreakToComponentsNode;65;-2215.166,717.8157;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
- Node;AmplifyShaderEditor.StepOpNode;471;841.0071,-1233.626;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleAddOpNode;83;-2088.616,791.182;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.WorldPosInputsNode;155;-2377.607,1537.926;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.ScreenDepthNode;64;-2258.576,616.881;Inherit;False;0;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.CommentaryNode;266;170.6061,898.9609;Inherit;False;1198.132;582.9205;Comment;9;3;192;90;265;198;267;398;400;401;TRANSPARENCY FINAL;1,1,1,1;0;0
- Node;AmplifyShaderEditor.SimpleSubtractOpNode;66;-1956.295,733.16;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;439;1437.562,-1352.665;Inherit;False;FoamMask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;82;-2058.965,595.7329;Inherit;False;Property;_DepthStrength;Depth Strength;5;0;Create;True;0;0;0;False;0;False;0.3;0.3;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.Vector2Node;158;-2163.74,1704.801;Inherit;False;Constant;_Vector0;Vector 0;15;0;Create;True;0;0;0;False;0;False;6.5,0.9;1,10;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
- Node;AmplifyShaderEditor.DynamicAppendNode;156;-2155.255,1544.367;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.RangedFloatNode;160;-1960.265,1772.124;Inherit;False;Property;_WaveTile;Wave Tile;9;0;Create;True;0;0;0;False;0;False;0.5;0.5;0;0.9;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;151;-2243.51,1996.039;Inherit;False;Constant;_wavedirectionx;wave direction x;17;0;Create;True;0;0;0;False;0;False;0.23;-1;-1;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;150;-1855.533,2306.268;Inherit;False;Property;_WaveSpeed;Wave Speed;8;0;Create;True;0;0;0;False;0;False;0.5;0.5;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;74;-1761.804,708.0941;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;157;-1896.241,1546.953;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT2;0,0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.SimpleTimeNode;148;-1754.768,2203.957;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.GetLocalVarNode;192;41.23421,1217.474;Inherit;False;439;FoamMask;1;0;OBJECT;;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;152;-2236.342,2081.59;Inherit;False;Constant;_wavedirectiony;wave direction y;24;0;Create;True;0;0;0;False;0;False;-0.8;0.067;-1;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.ClampOpNode;81;-1596.362,711.3876;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;149;-1530.768,2253.957;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;159;-1643.2,1549.363;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.Vector3Node;162;-1513.271,1361.713;Inherit;False;Constant;_Vector1;Vector 1;14;0;Create;True;0;0;0;False;0;False;0,0.05,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
- Node;AmplifyShaderEditor.DynamicAppendNode;153;-1867.231,2019.957;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.RangedFloatNode;399;277.303,1436.751;Inherit;False;Constant;_Float0;Float 0;29;0;Create;True;0;0;0;True;0;False;0.05;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SmoothstepOpNode;400;362.052,1219.602;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0.2;False;2;FLOAT;1.2;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;398;577.6862,1288.293;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.PannerNode;145;-1386.378,1988.409;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
- Node;AmplifyShaderEditor.RangedFloatNode;3;193.7791,1014.227;Inherit;False;Constant;_Transparency;Transparency;2;0;Create;True;0;0;0;False;0;False;0.95;0.5;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.BreakToComponentsNode;168;-1298.1,1387.307;Inherit;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
- Node;AmplifyShaderEditor.RangedFloatNode;170;-1409.1,1596.307;Inherit;False;Property;_WaveAmplitude;Wave Amplitude;10;0;Create;True;0;0;0;False;0;False;0.2;0.2;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;197;-1377.094,528.7972;Inherit;False;DeepShallowMask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ClampOpNode;401;715.3116,1244.153;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.NoiseGeneratorNode;143;-1126.841,1911.796;Inherit;True;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.GetLocalVarNode;198;494.371,948.9609;Inherit;False;197;DeepShallowMask;1;0;OBJECT;;False;1;FLOAT;0
- Node;AmplifyShaderEditor.TFHCRemapNode;265;508.0719,1046.37;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;1;False;4;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;169;-1167.1,1475.307;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleAddOpNode;90;833.869,1012.861;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;163;-963.286,1360.345;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.CommentaryNode;248;-2607.635,-1748.536;Inherit;False;1847.655;579.5157;Comment;9;243;352;254;405;249;257;251;252;351;Normal Map Waves;1,1,1,1;0;0
- Node;AmplifyShaderEditor.CommentaryNode;414;-2408.578,-776.7009;Inherit;False;1714.404;696.3644;Comment;12;290;342;280;333;279;341;415;335;336;314;350;282;FAKE REFRACTIONS;1,1,1,1;0;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;267;1047.772,1004.04;Inherit;False;TRANSPARENCYFINAL;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;245;-729.6497,1371.044;Inherit;False;WAVESDISPLACEMENT;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleTimeNode;251;-2324.447,-1362.269;Inherit;False;1;0;FLOAT;0.1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;257;-2561.399,-1535.609;Inherit;False;Property;_NormalMapsWavesSize;Normal Maps Waves Size;13;0;Create;True;0;0;0;False;0;False;5;5;0;10;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;252;-2485.628,-1264.38;Inherit;False;Property;_NormalMapWavesSpeed;Normal Map Waves Speed;12;0;Create;True;0;0;0;False;0;False;0.1;0.1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.DynamicAppendNode;405;-2190.042,-1513.174;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;249;-2082.218,-1380.983;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.TexturePropertyNode;351;-2189.521,-1740.015;Inherit;True;Property;_NormalMapTexture;Normal Map Texture ;11;2;[NoScaleOffset];[Normal];Create;True;0;0;0;True;0;False;a78adb8868cccbe4a92d9d81db916e6e;a78adb8868cccbe4a92d9d81db916e6e;True;bump;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
- Node;AmplifyShaderEditor.TextureCoordinatesNode;254;-1992.74,-1514.106;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,5;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.FunctionNode;352;-1730.17,-1725.82;Inherit;True;NormalCreate;0;;9;e12f7ae19d416b942820e3932b56220f;0;4;1;SAMPLER2D;;False;2;FLOAT2;0,0;False;3;FLOAT;0.5;False;4;FLOAT;1;False;1;FLOAT3;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;243;-1071.836,-1714.044;Inherit;False;NORMALMAPWAVES;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
- Node;AmplifyShaderEditor.GetLocalVarNode;279;-2170.569,-303.5186;Inherit;False;243;NORMALMAPWAVES;1;0;OBJECT;;False;1;FLOAT3;0
- Node;AmplifyShaderEditor.GrabScreenPosition;341;-2358.578,-519.3195;Inherit;False;0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
- Node;AmplifyShaderEditor.RangedFloatNode;290;-2208.454,-202.0541;Inherit;False;Constant;_Float3;Float 3;18;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;333;-1985.109,-686.3021;Inherit;False;Constant;_Float4;Float 4;22;0;Create;True;0;0;0;False;0;False;100;1;0;100;0;1;FLOAT;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;280;-1875.663,-306.6546;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
- Node;AmplifyShaderEditor.ComponentMaskNode;342;-2090.173,-513.0981;Inherit;False;True;True;True;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.SimpleAddOpNode;282;-1591.159,-357.7633;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT4;0
- Node;AmplifyShaderEditor.DepthFade;350;-1684.137,-726.7009;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ScreenColorNode;314;-1416.112,-356.7128;Inherit;False;Global;_GrabScreen0;Grab Screen 0;21;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
- Node;AmplifyShaderEditor.ColorNode;85;-1353.423,608.9352;Inherit;False;Property;_ShallowColor;Shallow Color;3;0;Create;True;0;0;0;False;0;False;0.5238074,0.7314408,0.745283,0;0.2003827,0.745283,0.3747112,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
- Node;AmplifyShaderEditor.OneMinusNode;335;-1387.788,-726.2308;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;84;-1327.132,818.0287;Inherit;False;Property;_DeepColor;Deep Color;2;0;Create;True;0;0;0;False;0;False;0.3114988,0.5266015,0.5283019,0;1,0.8726415,0.8726415,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;336;-1165.583,-388.4095;Inherit;True;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.LerpOp;86;-1045.415,672.1371;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
- Node;AmplifyShaderEditor.ColorNode;440;999.5128,-922.9009;Inherit;False;Property;_FoamColor;Foam Color;14;0;Create;True;0;0;0;False;0;False;0.3066038,1,0.9145772,0;0.2971698,1,0.9126425,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
- Node;AmplifyShaderEditor.RegisterLocalVarNode;415;-925.225,-389.6505;Inherit;False;FAKEREFRACTIONS;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.SimpleMultiplyOpNode;441;1249.635,-1154.369;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;196;-731.6638,665.9779;Inherit;False;DeepShallowColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.GetLocalVarNode;416;909.8789,-371.3734;Inherit;False;415;FAKEREFRACTIONS;1;0;OBJECT;;False;1;COLOR;0
- Node;AmplifyShaderEditor.GetLocalVarNode;476;1045.112,-63.59784;Inherit;False;439;FoamMask;1;0;OBJECT;;False;1;FLOAT;0
- Node;AmplifyShaderEditor.ColorNode;478;1017.163,100.7891;Inherit;False;Constant;_Color0;Color 0;15;0;Create;True;0;0;0;False;0;False;0.4980392,0.4980392,1,0;0,0,0,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
- Node;AmplifyShaderEditor.GetLocalVarNode;411;903.5338,-288.2307;Inherit;False;196;DeepShallowColor;1;0;OBJECT;;False;1;COLOR;0
- Node;AmplifyShaderEditor.GetLocalVarNode;457;1005.23,19.06134;Inherit;False;243;NORMALMAPWAVES;1;0;OBJECT;;False;1;FLOAT3;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;442;1435.016,-1148.227;Inherit;False;FoamColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.GetLocalVarNode;483;1068.577,311.6291;Inherit;False;439;FoamMask;1;0;OBJECT;;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RangedFloatNode;1;1085.717,394.7116;Inherit;False;Property;_Smootness;Smootness;6;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.GetLocalVarNode;460;1400.639,-169.8729;Inherit;False;442;FoamColor;1;0;OBJECT;;False;1;COLOR;0
- Node;AmplifyShaderEditor.LayeredBlendNode;477;1422.112,-51.59784;Inherit;False;6;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0
- Node;AmplifyShaderEditor.ColorNode;484;1118.628,475.016;Inherit;False;Constant;_Color1;Color 1;15;0;Create;True;0;0;0;False;0;False;0.2264151,0.2264151,0.2264151,0;0,0,0,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5
- Node;AmplifyShaderEditor.LerpOp;470;1194.726,-397.0083;Inherit;True;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0.6132076,0.6132076,0.6132076,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.SimpleAddOpNode;468;1626.736,-390.0578;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.RangedFloatNode;16;1430.962,91.4223;Inherit;False;Property;_Mettalic;Mettalic;7;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
- Node;AmplifyShaderEditor.GetLocalVarNode;246;1792.341,447.4535;Inherit;False;245;WAVESDISPLACEMENT;1;0;OBJECT;;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;443;802.7948,-1429.559;Inherit;False;newfoammask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.GetLocalVarNode;268;1802.455,333.9038;Inherit;False;267;TRANSPARENCYFINAL;1;0;OBJECT;;False;1;FLOAT;0
- Node;AmplifyShaderEditor.RegisterLocalVarNode;188;-830.4629,1926.917;Inherit;False;OffsetWavesMask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
- Node;AmplifyShaderEditor.LayeredBlendNode;485;1425.577,305.6291;Inherit;False;6;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0
- Node;AmplifyShaderEditor.NormalizeNode;474;1650.911,-43.49784;Inherit;False;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;486;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;487;2122.445,-57.32889;Float;False;True;-1;2;;0;12;Polytope Studio/PT_Water_Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;21;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;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;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalForward;False;False;0;;0;0;Standard;45;Lighting Model;0;0;Workflow;1;0;Surface;1;638388171280090033; 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
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;488;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;489;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;True;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;490;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;491;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;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;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;492;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;493;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;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;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalGBuffer;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;494;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;495;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;False;0;;0;0;Standard;0;False;0
- Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;496;2122.445,42.67111;Float;False;False;-1;3;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
- WireConnection;432;0;429;0
- WireConnection;432;1;445;0
- WireConnection;433;0;430;0
- WireConnection;433;1;432;0
- WireConnection;434;0;431;0
- WireConnection;436;0;434;0
- WireConnection;436;1;435;0
- WireConnection;437;0;433;0
- WireConnection;65;0;63;0
- WireConnection;471;0;436;0
- WireConnection;471;1;437;0
- WireConnection;83;0;65;3
- WireConnection;83;1;67;0
- WireConnection;66;0;64;0
- WireConnection;66;1;83;0
- WireConnection;439;0;471;0
- WireConnection;156;0;155;1
- WireConnection;156;1;155;3
- WireConnection;74;0;82;0
- WireConnection;74;1;66;0
- WireConnection;157;0;156;0
- WireConnection;157;1;158;0
- WireConnection;81;0;74;0
- WireConnection;149;0;148;0
- WireConnection;149;1;150;0
- WireConnection;159;0;157;0
- WireConnection;159;1;160;0
- WireConnection;153;0;151;0
- WireConnection;153;1;152;0
- WireConnection;400;0;192;0
- WireConnection;398;0;400;0
- WireConnection;398;1;399;0
- WireConnection;145;0;159;0
- WireConnection;145;2;153;0
- WireConnection;145;1;149;0
- WireConnection;168;0;162;0
- WireConnection;197;0;81;0
- WireConnection;401;0;398;0
- WireConnection;143;0;145;0
- WireConnection;265;0;3;0
- WireConnection;169;0;168;1
- WireConnection;169;1;170;0
- WireConnection;90;0;198;0
- WireConnection;90;1;265;0
- WireConnection;90;2;401;0
- WireConnection;163;0;169;0
- WireConnection;163;1;143;0
- WireConnection;267;0;90;0
- WireConnection;245;0;163;0
- WireConnection;405;0;257;0
- WireConnection;405;1;257;0
- WireConnection;249;0;251;0
- WireConnection;249;1;252;0
- WireConnection;254;0;405;0
- WireConnection;254;1;249;0
- WireConnection;352;1;351;0
- WireConnection;352;2;254;0
- WireConnection;243;0;352;0
- WireConnection;280;0;279;0
- WireConnection;280;1;290;0
- WireConnection;342;0;341;0
- WireConnection;282;0;342;0
- WireConnection;282;1;280;0
- WireConnection;350;0;333;0
- WireConnection;314;0;282;0
- WireConnection;335;0;350;0
- WireConnection;336;0;335;0
- WireConnection;336;1;314;0
- WireConnection;86;0;85;0
- WireConnection;86;1;84;0
- WireConnection;86;2;81;0
- WireConnection;415;0;336;0
- WireConnection;441;0;471;0
- WireConnection;441;1;440;0
- WireConnection;196;0;86;0
- WireConnection;442;0;441;0
- WireConnection;477;0;476;0
- WireConnection;477;1;457;0
- WireConnection;477;2;478;0
- WireConnection;470;0;416;0
- WireConnection;470;1;411;0
- WireConnection;468;0;470;0
- WireConnection;468;1;460;0
- WireConnection;443;0;436;0
- WireConnection;188;0;143;0
- WireConnection;485;0;483;0
- WireConnection;485;1;1;0
- WireConnection;485;2;484;0
- WireConnection;474;0;477;0
- WireConnection;487;0;468;0
- WireConnection;487;1;474;0
- WireConnection;487;3;16;0
- WireConnection;487;4;485;0
- WireConnection;487;6;268;0
- WireConnection;487;8;246;0
- ASEEND*/
- //CHKSM=B4EED95D4787ACDB08CAA60A08E617EE2DD2337B
|