AlphaBlend.shader 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930
  1. // Made with Amplify Shader Editor
  2. // Available at the Unity Asset Store - http://u3d.as/y3X
  3. Shader "LT/AlphaBlend"
  4. {
  5. Properties
  6. {
  7. [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
  8. [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
  9. [ASEBegin]_MainTex("MainTex", 2D) = "white" {}
  10. [HDR]_Color("Color", Color) = (1,1,1,1)
  11. _Intensity("Intensity", Range( 0 , 60)) = 1
  12. _MainTexChannel("通道选择", Vector) = (1,0,0,0)
  13. _MainTexRotation("贴图旋转", Range( 0 , 1)) = 0
  14. [ASEEnd]_ca("_ca", Float) = 1
  15. [HideInInspector]_QueueOffset("_QueueOffset", Float) = 0
  16. [HideInInspector]_QueueControl("_QueueControl", Float) = -1
  17. [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
  18. [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
  19. [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
  20. //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
  21. //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
  22. //_TessMin( "Tess Min Distance", Float ) = 10
  23. //_TessMax( "Tess Max Distance", Float ) = 25
  24. //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
  25. //_TessMaxDisp( "Tess Max Displacement", Float ) = 25
  26. }
  27. SubShader
  28. {
  29. LOD 0
  30. Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" }
  31. Cull Off
  32. AlphaToMask Off
  33. HLSLINCLUDE
  34. #pragma target 3.0
  35. #pragma prefer_hlslcc gles
  36. #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal vulkan nomrt
  37. #ifndef ASE_TESS_FUNCS
  38. #define ASE_TESS_FUNCS
  39. float4 FixedTess( float tessValue )
  40. {
  41. return tessValue;
  42. }
  43. float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
  44. {
  45. float3 wpos = mul(o2w,vertex).xyz;
  46. float dist = distance (wpos, cameraPos);
  47. float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
  48. return f;
  49. }
  50. float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
  51. {
  52. float4 tess;
  53. tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
  54. tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
  55. tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
  56. tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
  57. return tess;
  58. }
  59. float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
  60. {
  61. float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
  62. float len = distance(wpos0, wpos1);
  63. float f = max(len * scParams.y / (edgeLen * dist), 1.0);
  64. return f;
  65. }
  66. float DistanceFromPlane (float3 pos, float4 plane)
  67. {
  68. float d = dot (float4(pos,1.0f), plane);
  69. return d;
  70. }
  71. bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
  72. {
  73. float4 planeTest;
  74. planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  75. (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
  76. (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
  77. planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  78. (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
  79. (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
  80. planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  81. (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
  82. (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
  83. planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  84. (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
  85. (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
  86. return !all (planeTest);
  87. }
  88. float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
  89. {
  90. float3 f;
  91. f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
  92. f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
  93. f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
  94. return CalcTriEdgeTessFactors (f);
  95. }
  96. float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
  97. {
  98. float3 pos0 = mul(o2w,v0).xyz;
  99. float3 pos1 = mul(o2w,v1).xyz;
  100. float3 pos2 = mul(o2w,v2).xyz;
  101. float4 tess;
  102. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  103. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  104. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  105. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  106. return tess;
  107. }
  108. float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
  109. {
  110. float3 pos0 = mul(o2w,v0).xyz;
  111. float3 pos1 = mul(o2w,v1).xyz;
  112. float3 pos2 = mul(o2w,v2).xyz;
  113. float4 tess;
  114. if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
  115. {
  116. tess = 0.0f;
  117. }
  118. else
  119. {
  120. tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
  121. tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
  122. tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
  123. tess.w = (tess.x + tess.y + tess.z) / 3.0f;
  124. }
  125. return tess;
  126. }
  127. #endif //ASE_TESS_FUNCS
  128. ENDHLSL
  129. Pass
  130. {
  131. Name "Forward"
  132. Tags { "LightMode"="UniversalForwardOnly" }
  133. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  134. ZWrite Off
  135. ZTest LEqual
  136. Offset 0 , 0
  137. ColorMask RGBA
  138. HLSLPROGRAM
  139. #pragma multi_compile_instancing
  140. #define _RECEIVE_SHADOWS_OFF 1
  141. #define ASE_SRP_VERSION 999999
  142. #pragma multi_compile _ LIGHTMAP_ON
  143. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  144. #pragma shader_feature _ _SAMPLE_GI
  145. #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  146. #pragma multi_compile _ DEBUG_DISPLAY
  147. #define SHADERPASS SHADERPASS_UNLIT
  148. #pragma vertex vert
  149. #pragma fragment frag
  150. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  151. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  152. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  153. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  154. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  155. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  156. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  157. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  158. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl"
  159. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  160. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceData.hlsl"
  161. #define ASE_NEEDS_FRAG_COLOR
  162. struct VertexInput
  163. {
  164. float4 vertex : POSITION;
  165. float3 ase_normal : NORMAL;
  166. float4 ase_texcoord : TEXCOORD0;
  167. float4 ase_color : COLOR;
  168. UNITY_VERTEX_INPUT_INSTANCE_ID
  169. };
  170. struct VertexOutput
  171. {
  172. float4 clipPos : SV_POSITION;
  173. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  174. float3 worldPos : TEXCOORD0;
  175. #endif
  176. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  177. float4 shadowCoord : TEXCOORD1;
  178. #endif
  179. #ifdef ASE_FOG
  180. float fogFactor : TEXCOORD2;
  181. #endif
  182. float4 ase_texcoord3 : TEXCOORD3;
  183. float4 ase_color : COLOR;
  184. UNITY_VERTEX_INPUT_INSTANCE_ID
  185. UNITY_VERTEX_OUTPUT_STEREO
  186. };
  187. CBUFFER_START(UnityPerMaterial)
  188. float4 _Color;
  189. float4 _MainTexChannel;
  190. float _MainTexRotation;
  191. float _Intensity;
  192. float _ca;
  193. #ifdef TESSELLATION_ON
  194. float _TessPhongStrength;
  195. float _TessValue;
  196. float _TessMin;
  197. float _TessMax;
  198. float _TessEdgeLength;
  199. float _TessMaxDisp;
  200. #endif
  201. CBUFFER_END
  202. sampler2D _MainTex;
  203. VertexOutput VertexFunction ( VertexInput v )
  204. {
  205. VertexOutput o = (VertexOutput)0;
  206. UNITY_SETUP_INSTANCE_ID(v);
  207. UNITY_TRANSFER_INSTANCE_ID(v, o);
  208. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  209. o.ase_texcoord3.xy = v.ase_texcoord.xy;
  210. o.ase_color = v.ase_color;
  211. //setting value to unused interpolator channels and avoid initialization warnings
  212. o.ase_texcoord3.zw = 0;
  213. #ifdef ASE_ABSOLUTE_VERTEX_POS
  214. float3 defaultVertexValue = v.vertex.xyz;
  215. #else
  216. float3 defaultVertexValue = float3(0, 0, 0);
  217. #endif
  218. float3 vertexValue = defaultVertexValue;
  219. #ifdef ASE_ABSOLUTE_VERTEX_POS
  220. v.vertex.xyz = vertexValue;
  221. #else
  222. v.vertex.xyz += vertexValue;
  223. #endif
  224. v.ase_normal = v.ase_normal;
  225. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  226. float4 positionCS = TransformWorldToHClip( positionWS );
  227. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  228. o.worldPos = positionWS;
  229. #endif
  230. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  231. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  232. vertexInput.positionWS = positionWS;
  233. vertexInput.positionCS = positionCS;
  234. o.shadowCoord = GetShadowCoord( vertexInput );
  235. #endif
  236. #ifdef ASE_FOG
  237. o.fogFactor = ComputeFogFactor( positionCS.z );
  238. #endif
  239. o.clipPos = positionCS;
  240. return o;
  241. }
  242. #if defined(TESSELLATION_ON)
  243. struct VertexControl
  244. {
  245. float4 vertex : INTERNALTESSPOS;
  246. float3 ase_normal : NORMAL;
  247. float4 ase_texcoord : TEXCOORD0;
  248. float4 ase_color : COLOR;
  249. UNITY_VERTEX_INPUT_INSTANCE_ID
  250. };
  251. struct TessellationFactors
  252. {
  253. float edge[3] : SV_TessFactor;
  254. float inside : SV_InsideTessFactor;
  255. };
  256. VertexControl vert ( VertexInput v )
  257. {
  258. VertexControl o;
  259. UNITY_SETUP_INSTANCE_ID(v);
  260. UNITY_TRANSFER_INSTANCE_ID(v, o);
  261. o.vertex = v.vertex;
  262. o.ase_normal = v.ase_normal;
  263. o.ase_texcoord = v.ase_texcoord;
  264. o.ase_color = v.ase_color;
  265. return o;
  266. }
  267. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  268. {
  269. TessellationFactors o;
  270. float4 tf = 1;
  271. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  272. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  273. #if defined(ASE_FIXED_TESSELLATION)
  274. tf = FixedTess( tessValue );
  275. #elif defined(ASE_DISTANCE_TESSELLATION)
  276. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  277. #elif defined(ASE_LENGTH_TESSELLATION)
  278. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  279. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  280. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  281. #endif
  282. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  283. return o;
  284. }
  285. [domain("tri")]
  286. [partitioning("fractional_odd")]
  287. [outputtopology("triangle_cw")]
  288. [patchconstantfunc("TessellationFunction")]
  289. [outputcontrolpoints(3)]
  290. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  291. {
  292. return patch[id];
  293. }
  294. [domain("tri")]
  295. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  296. {
  297. VertexInput o = (VertexInput) 0;
  298. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  299. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  300. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  301. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  302. #if defined(ASE_PHONG_TESSELLATION)
  303. float3 pp[3];
  304. for (int i = 0; i < 3; ++i)
  305. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  306. float phongStrength = _TessPhongStrength;
  307. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  308. #endif
  309. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  310. return VertexFunction(o);
  311. }
  312. #else
  313. VertexOutput vert ( VertexInput v )
  314. {
  315. return VertexFunction( v );
  316. }
  317. #endif
  318. half4 frag ( VertexOutput IN ) : SV_Target
  319. {
  320. UNITY_SETUP_INSTANCE_ID( IN );
  321. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  322. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  323. float3 WorldPosition = IN.worldPos;
  324. #endif
  325. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  326. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  327. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  328. ShadowCoords = IN.shadowCoord;
  329. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  330. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  331. #endif
  332. #endif
  333. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  334. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  335. float2 rotator22 = mul( IN.ase_texcoord3.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  336. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  337. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  338. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  339. float3 BakedAlbedo = 0;
  340. float3 BakedEmission = 0;
  341. float3 Color = ( tex2DNode11 * _Intensity * IN.ase_color * _Color ).rgb;
  342. float Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  343. float AlphaClipThreshold = 0.5;
  344. float AlphaClipThresholdShadow = 0.5;
  345. #ifdef _ALPHATEST_ON
  346. clip( Alpha - AlphaClipThreshold );
  347. #endif
  348. #if defined(_DBUFFER)
  349. ApplyDecalToBaseColor(IN.clipPos, Color);
  350. #endif
  351. #if defined(_ALPHAPREMULTIPLY_ON)
  352. Color *= Alpha;
  353. #endif
  354. #ifdef LOD_FADE_CROSSFADE
  355. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  356. #endif
  357. #ifdef ASE_FOG
  358. Color = MixFog( Color, IN.fogFactor );
  359. #endif
  360. return half4( Color, Alpha );
  361. }
  362. ENDHLSL
  363. }
  364. Pass
  365. {
  366. Name "DepthOnly"
  367. Tags { "LightMode"="DepthOnly" }
  368. ZWrite On
  369. ColorMask 0
  370. AlphaToMask Off
  371. HLSLPROGRAM
  372. #pragma multi_compile_instancing
  373. #define _RECEIVE_SHADOWS_OFF 1
  374. #define ASE_SRP_VERSION 999999
  375. #pragma vertex vert
  376. #pragma fragment frag
  377. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  378. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  379. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  380. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  381. struct VertexInput
  382. {
  383. float4 vertex : POSITION;
  384. float3 ase_normal : NORMAL;
  385. float4 ase_texcoord : TEXCOORD0;
  386. float4 ase_color : COLOR;
  387. UNITY_VERTEX_INPUT_INSTANCE_ID
  388. };
  389. struct VertexOutput
  390. {
  391. float4 clipPos : SV_POSITION;
  392. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  393. float3 worldPos : TEXCOORD0;
  394. #endif
  395. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  396. float4 shadowCoord : TEXCOORD1;
  397. #endif
  398. float4 ase_texcoord2 : TEXCOORD2;
  399. float4 ase_color : COLOR;
  400. UNITY_VERTEX_INPUT_INSTANCE_ID
  401. UNITY_VERTEX_OUTPUT_STEREO
  402. };
  403. CBUFFER_START(UnityPerMaterial)
  404. float4 _Color;
  405. float4 _MainTexChannel;
  406. float _MainTexRotation;
  407. float _Intensity;
  408. float _ca;
  409. #ifdef TESSELLATION_ON
  410. float _TessPhongStrength;
  411. float _TessValue;
  412. float _TessMin;
  413. float _TessMax;
  414. float _TessEdgeLength;
  415. float _TessMaxDisp;
  416. #endif
  417. CBUFFER_END
  418. sampler2D _MainTex;
  419. VertexOutput VertexFunction( VertexInput v )
  420. {
  421. VertexOutput o = (VertexOutput)0;
  422. UNITY_SETUP_INSTANCE_ID(v);
  423. UNITY_TRANSFER_INSTANCE_ID(v, o);
  424. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  425. o.ase_texcoord2.xy = v.ase_texcoord.xy;
  426. o.ase_color = v.ase_color;
  427. //setting value to unused interpolator channels and avoid initialization warnings
  428. o.ase_texcoord2.zw = 0;
  429. #ifdef ASE_ABSOLUTE_VERTEX_POS
  430. float3 defaultVertexValue = v.vertex.xyz;
  431. #else
  432. float3 defaultVertexValue = float3(0, 0, 0);
  433. #endif
  434. float3 vertexValue = defaultVertexValue;
  435. #ifdef ASE_ABSOLUTE_VERTEX_POS
  436. v.vertex.xyz = vertexValue;
  437. #else
  438. v.vertex.xyz += vertexValue;
  439. #endif
  440. v.ase_normal = v.ase_normal;
  441. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  442. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  443. o.worldPos = positionWS;
  444. #endif
  445. o.clipPos = TransformWorldToHClip( positionWS );
  446. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  447. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  448. vertexInput.positionWS = positionWS;
  449. vertexInput.positionCS = o.clipPos;
  450. o.shadowCoord = GetShadowCoord( vertexInput );
  451. #endif
  452. return o;
  453. }
  454. #if defined(TESSELLATION_ON)
  455. struct VertexControl
  456. {
  457. float4 vertex : INTERNALTESSPOS;
  458. float3 ase_normal : NORMAL;
  459. float4 ase_texcoord : TEXCOORD0;
  460. float4 ase_color : COLOR;
  461. UNITY_VERTEX_INPUT_INSTANCE_ID
  462. };
  463. struct TessellationFactors
  464. {
  465. float edge[3] : SV_TessFactor;
  466. float inside : SV_InsideTessFactor;
  467. };
  468. VertexControl vert ( VertexInput v )
  469. {
  470. VertexControl o;
  471. UNITY_SETUP_INSTANCE_ID(v);
  472. UNITY_TRANSFER_INSTANCE_ID(v, o);
  473. o.vertex = v.vertex;
  474. o.ase_normal = v.ase_normal;
  475. o.ase_texcoord = v.ase_texcoord;
  476. o.ase_color = v.ase_color;
  477. return o;
  478. }
  479. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  480. {
  481. TessellationFactors o;
  482. float4 tf = 1;
  483. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  484. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  485. #if defined(ASE_FIXED_TESSELLATION)
  486. tf = FixedTess( tessValue );
  487. #elif defined(ASE_DISTANCE_TESSELLATION)
  488. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  489. #elif defined(ASE_LENGTH_TESSELLATION)
  490. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  491. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  492. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  493. #endif
  494. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  495. return o;
  496. }
  497. [domain("tri")]
  498. [partitioning("fractional_odd")]
  499. [outputtopology("triangle_cw")]
  500. [patchconstantfunc("TessellationFunction")]
  501. [outputcontrolpoints(3)]
  502. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  503. {
  504. return patch[id];
  505. }
  506. [domain("tri")]
  507. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  508. {
  509. VertexInput o = (VertexInput) 0;
  510. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  511. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  512. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  513. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  514. #if defined(ASE_PHONG_TESSELLATION)
  515. float3 pp[3];
  516. for (int i = 0; i < 3; ++i)
  517. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  518. float phongStrength = _TessPhongStrength;
  519. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  520. #endif
  521. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  522. return VertexFunction(o);
  523. }
  524. #else
  525. VertexOutput vert ( VertexInput v )
  526. {
  527. return VertexFunction( v );
  528. }
  529. #endif
  530. half4 frag(VertexOutput IN ) : SV_TARGET
  531. {
  532. UNITY_SETUP_INSTANCE_ID(IN);
  533. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  534. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  535. float3 WorldPosition = IN.worldPos;
  536. #endif
  537. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  538. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  539. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  540. ShadowCoords = IN.shadowCoord;
  541. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  542. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  543. #endif
  544. #endif
  545. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  546. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  547. float2 rotator22 = mul( IN.ase_texcoord2.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  548. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  549. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  550. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  551. float Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  552. float AlphaClipThreshold = 0.5;
  553. #ifdef _ALPHATEST_ON
  554. clip(Alpha - AlphaClipThreshold);
  555. #endif
  556. #ifdef LOD_FADE_CROSSFADE
  557. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  558. #endif
  559. return 0;
  560. }
  561. ENDHLSL
  562. }
  563. Pass
  564. {
  565. Name "Universal2D"
  566. Tags { "LightMode"="Universal2D" }
  567. Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
  568. ZWrite Off
  569. ZTest LEqual
  570. Offset 0 , 0
  571. ColorMask RGBA
  572. HLSLPROGRAM
  573. #pragma multi_compile_instancing
  574. #define _RECEIVE_SHADOWS_OFF 1
  575. #define ASE_SRP_VERSION 999999
  576. #pragma multi_compile _ LIGHTMAP_ON
  577. #pragma multi_compile _ DIRLIGHTMAP_COMBINED
  578. #pragma shader_feature _ _SAMPLE_GI
  579. #pragma multi_compile _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
  580. #pragma multi_compile _ DEBUG_DISPLAY
  581. #define SHADERPASS SHADERPASS_UNLIT
  582. #pragma vertex vert
  583. #pragma fragment frag
  584. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  585. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  586. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  587. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  588. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  589. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  590. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
  591. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  592. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl"
  593. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
  594. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceData.hlsl"
  595. #define ASE_NEEDS_FRAG_COLOR
  596. struct VertexInput
  597. {
  598. float4 vertex : POSITION;
  599. float3 ase_normal : NORMAL;
  600. float4 ase_texcoord : TEXCOORD0;
  601. float4 ase_color : COLOR;
  602. UNITY_VERTEX_INPUT_INSTANCE_ID
  603. };
  604. struct VertexOutput
  605. {
  606. float4 clipPos : SV_POSITION;
  607. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  608. float3 worldPos : TEXCOORD0;
  609. #endif
  610. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  611. float4 shadowCoord : TEXCOORD1;
  612. #endif
  613. #ifdef ASE_FOG
  614. float fogFactor : TEXCOORD2;
  615. #endif
  616. float4 ase_texcoord3 : TEXCOORD3;
  617. float4 ase_color : COLOR;
  618. UNITY_VERTEX_INPUT_INSTANCE_ID
  619. UNITY_VERTEX_OUTPUT_STEREO
  620. };
  621. CBUFFER_START(UnityPerMaterial)
  622. float4 _Color;
  623. float4 _MainTexChannel;
  624. float _MainTexRotation;
  625. float _Intensity;
  626. float _ca;
  627. #ifdef TESSELLATION_ON
  628. float _TessPhongStrength;
  629. float _TessValue;
  630. float _TessMin;
  631. float _TessMax;
  632. float _TessEdgeLength;
  633. float _TessMaxDisp;
  634. #endif
  635. CBUFFER_END
  636. sampler2D _MainTex;
  637. VertexOutput VertexFunction ( VertexInput v )
  638. {
  639. VertexOutput o = (VertexOutput)0;
  640. UNITY_SETUP_INSTANCE_ID(v);
  641. UNITY_TRANSFER_INSTANCE_ID(v, o);
  642. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  643. o.ase_texcoord3.xy = v.ase_texcoord.xy;
  644. o.ase_color = v.ase_color;
  645. //setting value to unused interpolator channels and avoid initialization warnings
  646. o.ase_texcoord3.zw = 0;
  647. #ifdef ASE_ABSOLUTE_VERTEX_POS
  648. float3 defaultVertexValue = v.vertex.xyz;
  649. #else
  650. float3 defaultVertexValue = float3(0, 0, 0);
  651. #endif
  652. float3 vertexValue = defaultVertexValue;
  653. #ifdef ASE_ABSOLUTE_VERTEX_POS
  654. v.vertex.xyz = vertexValue;
  655. #else
  656. v.vertex.xyz += vertexValue;
  657. #endif
  658. v.ase_normal = v.ase_normal;
  659. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  660. float4 positionCS = TransformWorldToHClip( positionWS );
  661. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  662. o.worldPos = positionWS;
  663. #endif
  664. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  665. VertexPositionInputs vertexInput = (VertexPositionInputs)0;
  666. vertexInput.positionWS = positionWS;
  667. vertexInput.positionCS = positionCS;
  668. o.shadowCoord = GetShadowCoord( vertexInput );
  669. #endif
  670. #ifdef ASE_FOG
  671. o.fogFactor = ComputeFogFactor( positionCS.z );
  672. #endif
  673. o.clipPos = positionCS;
  674. return o;
  675. }
  676. #if defined(TESSELLATION_ON)
  677. struct VertexControl
  678. {
  679. float4 vertex : INTERNALTESSPOS;
  680. float3 ase_normal : NORMAL;
  681. float4 ase_texcoord : TEXCOORD0;
  682. float4 ase_color : COLOR;
  683. UNITY_VERTEX_INPUT_INSTANCE_ID
  684. };
  685. struct TessellationFactors
  686. {
  687. float edge[3] : SV_TessFactor;
  688. float inside : SV_InsideTessFactor;
  689. };
  690. VertexControl vert ( VertexInput v )
  691. {
  692. VertexControl o;
  693. UNITY_SETUP_INSTANCE_ID(v);
  694. UNITY_TRANSFER_INSTANCE_ID(v, o);
  695. o.vertex = v.vertex;
  696. o.ase_normal = v.ase_normal;
  697. o.ase_texcoord = v.ase_texcoord;
  698. o.ase_color = v.ase_color;
  699. return o;
  700. }
  701. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  702. {
  703. TessellationFactors o;
  704. float4 tf = 1;
  705. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  706. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  707. #if defined(ASE_FIXED_TESSELLATION)
  708. tf = FixedTess( tessValue );
  709. #elif defined(ASE_DISTANCE_TESSELLATION)
  710. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  711. #elif defined(ASE_LENGTH_TESSELLATION)
  712. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  713. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  714. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  715. #endif
  716. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  717. return o;
  718. }
  719. [domain("tri")]
  720. [partitioning("fractional_odd")]
  721. [outputtopology("triangle_cw")]
  722. [patchconstantfunc("TessellationFunction")]
  723. [outputcontrolpoints(3)]
  724. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  725. {
  726. return patch[id];
  727. }
  728. [domain("tri")]
  729. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  730. {
  731. VertexInput o = (VertexInput) 0;
  732. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  733. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  734. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  735. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  736. #if defined(ASE_PHONG_TESSELLATION)
  737. float3 pp[3];
  738. for (int i = 0; i < 3; ++i)
  739. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  740. float phongStrength = _TessPhongStrength;
  741. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  742. #endif
  743. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  744. return VertexFunction(o);
  745. }
  746. #else
  747. VertexOutput vert ( VertexInput v )
  748. {
  749. return VertexFunction( v );
  750. }
  751. #endif
  752. half4 frag ( VertexOutput IN ) : SV_Target
  753. {
  754. UNITY_SETUP_INSTANCE_ID( IN );
  755. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
  756. #if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
  757. float3 WorldPosition = IN.worldPos;
  758. #endif
  759. float4 ShadowCoords = float4( 0, 0, 0, 0 );
  760. #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
  761. #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
  762. ShadowCoords = IN.shadowCoord;
  763. #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
  764. ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
  765. #endif
  766. #endif
  767. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  768. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  769. float2 rotator22 = mul( IN.ase_texcoord3.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  770. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  771. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  772. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  773. float3 BakedAlbedo = 0;
  774. float3 BakedEmission = 0;
  775. float3 Color = ( tex2DNode11 * _Intensity * IN.ase_color * _Color ).rgb;
  776. float Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  777. float AlphaClipThreshold = 0.5;
  778. float AlphaClipThresholdShadow = 0.5;
  779. #ifdef _ALPHATEST_ON
  780. clip( Alpha - AlphaClipThreshold );
  781. #endif
  782. #if defined(_DBUFFER)
  783. ApplyDecalToBaseColor(IN.clipPos, Color);
  784. #endif
  785. #if defined(_ALPHAPREMULTIPLY_ON)
  786. Color *= Alpha;
  787. #endif
  788. #ifdef LOD_FADE_CROSSFADE
  789. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  790. #endif
  791. #ifdef ASE_FOG
  792. Color = MixFog( Color, IN.fogFactor );
  793. #endif
  794. return half4( Color, Alpha );
  795. }
  796. ENDHLSL
  797. }
  798. Pass
  799. {
  800. Name "SceneSelectionPass"
  801. Tags { "LightMode"="SceneSelectionPass" }
  802. Cull Off
  803. HLSLPROGRAM
  804. #pragma multi_compile_instancing
  805. #define _RECEIVE_SHADOWS_OFF 1
  806. #define ASE_SRP_VERSION 999999
  807. #pragma only_renderers d3d11 glcore gles gles3
  808. #pragma vertex vert
  809. #pragma fragment frag
  810. #define ATTRIBUTES_NEED_NORMAL
  811. #define ATTRIBUTES_NEED_TANGENT
  812. #define SHADERPASS SHADERPASS_DEPTHONLY
  813. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  814. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  815. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  816. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  817. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  818. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  819. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  820. struct VertexInput
  821. {
  822. float4 vertex : POSITION;
  823. float3 ase_normal : NORMAL;
  824. float4 ase_texcoord : TEXCOORD0;
  825. float4 ase_color : COLOR;
  826. UNITY_VERTEX_INPUT_INSTANCE_ID
  827. };
  828. struct VertexOutput
  829. {
  830. float4 clipPos : SV_POSITION;
  831. float4 ase_texcoord : TEXCOORD0;
  832. float4 ase_color : COLOR;
  833. UNITY_VERTEX_INPUT_INSTANCE_ID
  834. UNITY_VERTEX_OUTPUT_STEREO
  835. };
  836. CBUFFER_START(UnityPerMaterial)
  837. float4 _Color;
  838. float4 _MainTexChannel;
  839. float _MainTexRotation;
  840. float _Intensity;
  841. float _ca;
  842. #ifdef TESSELLATION_ON
  843. float _TessPhongStrength;
  844. float _TessValue;
  845. float _TessMin;
  846. float _TessMax;
  847. float _TessEdgeLength;
  848. float _TessMaxDisp;
  849. #endif
  850. CBUFFER_END
  851. sampler2D _MainTex;
  852. int _ObjectId;
  853. int _PassValue;
  854. struct SurfaceDescription
  855. {
  856. float Alpha;
  857. float AlphaClipThreshold;
  858. };
  859. VertexOutput VertexFunction(VertexInput v )
  860. {
  861. VertexOutput o;
  862. ZERO_INITIALIZE(VertexOutput, o);
  863. UNITY_SETUP_INSTANCE_ID(v);
  864. UNITY_TRANSFER_INSTANCE_ID(v, o);
  865. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  866. o.ase_texcoord.xy = v.ase_texcoord.xy;
  867. o.ase_color = v.ase_color;
  868. //setting value to unused interpolator channels and avoid initialization warnings
  869. o.ase_texcoord.zw = 0;
  870. #ifdef ASE_ABSOLUTE_VERTEX_POS
  871. float3 defaultVertexValue = v.vertex.xyz;
  872. #else
  873. float3 defaultVertexValue = float3(0, 0, 0);
  874. #endif
  875. float3 vertexValue = defaultVertexValue;
  876. #ifdef ASE_ABSOLUTE_VERTEX_POS
  877. v.vertex.xyz = vertexValue;
  878. #else
  879. v.vertex.xyz += vertexValue;
  880. #endif
  881. v.ase_normal = v.ase_normal;
  882. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  883. o.clipPos = TransformWorldToHClip(positionWS);
  884. return o;
  885. }
  886. #if defined(TESSELLATION_ON)
  887. struct VertexControl
  888. {
  889. float4 vertex : INTERNALTESSPOS;
  890. float3 ase_normal : NORMAL;
  891. float4 ase_texcoord : TEXCOORD0;
  892. float4 ase_color : COLOR;
  893. UNITY_VERTEX_INPUT_INSTANCE_ID
  894. };
  895. struct TessellationFactors
  896. {
  897. float edge[3] : SV_TessFactor;
  898. float inside : SV_InsideTessFactor;
  899. };
  900. VertexControl vert ( VertexInput v )
  901. {
  902. VertexControl o;
  903. UNITY_SETUP_INSTANCE_ID(v);
  904. UNITY_TRANSFER_INSTANCE_ID(v, o);
  905. o.vertex = v.vertex;
  906. o.ase_normal = v.ase_normal;
  907. o.ase_texcoord = v.ase_texcoord;
  908. o.ase_color = v.ase_color;
  909. return o;
  910. }
  911. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  912. {
  913. TessellationFactors o;
  914. float4 tf = 1;
  915. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  916. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  917. #if defined(ASE_FIXED_TESSELLATION)
  918. tf = FixedTess( tessValue );
  919. #elif defined(ASE_DISTANCE_TESSELLATION)
  920. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  921. #elif defined(ASE_LENGTH_TESSELLATION)
  922. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  923. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  924. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  925. #endif
  926. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  927. return o;
  928. }
  929. [domain("tri")]
  930. [partitioning("fractional_odd")]
  931. [outputtopology("triangle_cw")]
  932. [patchconstantfunc("TessellationFunction")]
  933. [outputcontrolpoints(3)]
  934. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  935. {
  936. return patch[id];
  937. }
  938. [domain("tri")]
  939. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  940. {
  941. VertexInput o = (VertexInput) 0;
  942. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  943. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  944. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  945. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  946. #if defined(ASE_PHONG_TESSELLATION)
  947. float3 pp[3];
  948. for (int i = 0; i < 3; ++i)
  949. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  950. float phongStrength = _TessPhongStrength;
  951. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  952. #endif
  953. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  954. return VertexFunction(o);
  955. }
  956. #else
  957. VertexOutput vert ( VertexInput v )
  958. {
  959. return VertexFunction( v );
  960. }
  961. #endif
  962. half4 frag(VertexOutput IN ) : SV_TARGET
  963. {
  964. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  965. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  966. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  967. float2 rotator22 = mul( IN.ase_texcoord.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  968. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  969. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  970. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  971. surfaceDescription.Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  972. surfaceDescription.AlphaClipThreshold = 0.5;
  973. #if _ALPHATEST_ON
  974. float alphaClipThreshold = 0.01f;
  975. #if ALPHA_CLIP_THRESHOLD
  976. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  977. #endif
  978. clip(surfaceDescription.Alpha - alphaClipThreshold);
  979. #endif
  980. half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
  981. return outColor;
  982. }
  983. ENDHLSL
  984. }
  985. Pass
  986. {
  987. Name "ScenePickingPass"
  988. Tags { "LightMode"="Picking" }
  989. HLSLPROGRAM
  990. #pragma multi_compile_instancing
  991. #define _RECEIVE_SHADOWS_OFF 1
  992. #define ASE_SRP_VERSION 999999
  993. #pragma only_renderers d3d11 glcore gles gles3
  994. #pragma vertex vert
  995. #pragma fragment frag
  996. #define ATTRIBUTES_NEED_NORMAL
  997. #define ATTRIBUTES_NEED_TANGENT
  998. #define SHADERPASS SHADERPASS_DEPTHONLY
  999. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1000. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1001. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1002. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1003. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1004. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1005. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1006. struct VertexInput
  1007. {
  1008. float4 vertex : POSITION;
  1009. float3 ase_normal : NORMAL;
  1010. float4 ase_texcoord : TEXCOORD0;
  1011. float4 ase_color : COLOR;
  1012. UNITY_VERTEX_INPUT_INSTANCE_ID
  1013. };
  1014. struct VertexOutput
  1015. {
  1016. float4 clipPos : SV_POSITION;
  1017. float4 ase_texcoord : TEXCOORD0;
  1018. float4 ase_color : COLOR;
  1019. UNITY_VERTEX_INPUT_INSTANCE_ID
  1020. UNITY_VERTEX_OUTPUT_STEREO
  1021. };
  1022. CBUFFER_START(UnityPerMaterial)
  1023. float4 _Color;
  1024. float4 _MainTexChannel;
  1025. float _MainTexRotation;
  1026. float _Intensity;
  1027. float _ca;
  1028. #ifdef TESSELLATION_ON
  1029. float _TessPhongStrength;
  1030. float _TessValue;
  1031. float _TessMin;
  1032. float _TessMax;
  1033. float _TessEdgeLength;
  1034. float _TessMaxDisp;
  1035. #endif
  1036. CBUFFER_END
  1037. sampler2D _MainTex;
  1038. float4 _SelectionID;
  1039. struct SurfaceDescription
  1040. {
  1041. float Alpha;
  1042. float AlphaClipThreshold;
  1043. };
  1044. VertexOutput VertexFunction(VertexInput v )
  1045. {
  1046. VertexOutput o;
  1047. ZERO_INITIALIZE(VertexOutput, o);
  1048. UNITY_SETUP_INSTANCE_ID(v);
  1049. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1050. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1051. o.ase_texcoord.xy = v.ase_texcoord.xy;
  1052. o.ase_color = v.ase_color;
  1053. //setting value to unused interpolator channels and avoid initialization warnings
  1054. o.ase_texcoord.zw = 0;
  1055. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1056. float3 defaultVertexValue = v.vertex.xyz;
  1057. #else
  1058. float3 defaultVertexValue = float3(0, 0, 0);
  1059. #endif
  1060. float3 vertexValue = defaultVertexValue;
  1061. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1062. v.vertex.xyz = vertexValue;
  1063. #else
  1064. v.vertex.xyz += vertexValue;
  1065. #endif
  1066. v.ase_normal = v.ase_normal;
  1067. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  1068. o.clipPos = TransformWorldToHClip(positionWS);
  1069. return o;
  1070. }
  1071. #if defined(TESSELLATION_ON)
  1072. struct VertexControl
  1073. {
  1074. float4 vertex : INTERNALTESSPOS;
  1075. float3 ase_normal : NORMAL;
  1076. float4 ase_texcoord : TEXCOORD0;
  1077. float4 ase_color : COLOR;
  1078. UNITY_VERTEX_INPUT_INSTANCE_ID
  1079. };
  1080. struct TessellationFactors
  1081. {
  1082. float edge[3] : SV_TessFactor;
  1083. float inside : SV_InsideTessFactor;
  1084. };
  1085. VertexControl vert ( VertexInput v )
  1086. {
  1087. VertexControl o;
  1088. UNITY_SETUP_INSTANCE_ID(v);
  1089. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1090. o.vertex = v.vertex;
  1091. o.ase_normal = v.ase_normal;
  1092. o.ase_texcoord = v.ase_texcoord;
  1093. o.ase_color = v.ase_color;
  1094. return o;
  1095. }
  1096. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1097. {
  1098. TessellationFactors o;
  1099. float4 tf = 1;
  1100. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1101. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1102. #if defined(ASE_FIXED_TESSELLATION)
  1103. tf = FixedTess( tessValue );
  1104. #elif defined(ASE_DISTANCE_TESSELLATION)
  1105. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1106. #elif defined(ASE_LENGTH_TESSELLATION)
  1107. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1108. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1109. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1110. #endif
  1111. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1112. return o;
  1113. }
  1114. [domain("tri")]
  1115. [partitioning("fractional_odd")]
  1116. [outputtopology("triangle_cw")]
  1117. [patchconstantfunc("TessellationFunction")]
  1118. [outputcontrolpoints(3)]
  1119. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1120. {
  1121. return patch[id];
  1122. }
  1123. [domain("tri")]
  1124. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1125. {
  1126. VertexInput o = (VertexInput) 0;
  1127. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1128. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  1129. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  1130. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1131. #if defined(ASE_PHONG_TESSELLATION)
  1132. float3 pp[3];
  1133. for (int i = 0; i < 3; ++i)
  1134. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1135. float phongStrength = _TessPhongStrength;
  1136. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1137. #endif
  1138. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1139. return VertexFunction(o);
  1140. }
  1141. #else
  1142. VertexOutput vert ( VertexInput v )
  1143. {
  1144. return VertexFunction( v );
  1145. }
  1146. #endif
  1147. half4 frag(VertexOutput IN ) : SV_TARGET
  1148. {
  1149. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1150. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  1151. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  1152. float2 rotator22 = mul( IN.ase_texcoord.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  1153. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  1154. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  1155. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  1156. surfaceDescription.Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  1157. surfaceDescription.AlphaClipThreshold = 0.5;
  1158. #if _ALPHATEST_ON
  1159. float alphaClipThreshold = 0.01f;
  1160. #if ALPHA_CLIP_THRESHOLD
  1161. alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
  1162. #endif
  1163. clip(surfaceDescription.Alpha - alphaClipThreshold);
  1164. #endif
  1165. half4 outColor = 0;
  1166. outColor = _SelectionID;
  1167. return outColor;
  1168. }
  1169. ENDHLSL
  1170. }
  1171. Pass
  1172. {
  1173. Name "DepthNormals"
  1174. Tags { "LightMode"="DepthNormalsOnly" }
  1175. ZTest LEqual
  1176. ZWrite On
  1177. HLSLPROGRAM
  1178. #pragma multi_compile_instancing
  1179. #define _RECEIVE_SHADOWS_OFF 1
  1180. #define ASE_SRP_VERSION 999999
  1181. #pragma only_renderers d3d11 glcore gles gles3
  1182. #pragma multi_compile_fog
  1183. #pragma instancing_options renderinglayer
  1184. #pragma vertex vert
  1185. #pragma fragment frag
  1186. #define ATTRIBUTES_NEED_NORMAL
  1187. #define ATTRIBUTES_NEED_TANGENT
  1188. #define VARYINGS_NEED_NORMAL_WS
  1189. #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
  1190. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1191. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1192. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1193. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1194. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1195. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1196. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1197. struct VertexInput
  1198. {
  1199. float4 vertex : POSITION;
  1200. float3 ase_normal : NORMAL;
  1201. float4 ase_texcoord : TEXCOORD0;
  1202. float4 ase_color : COLOR;
  1203. UNITY_VERTEX_INPUT_INSTANCE_ID
  1204. };
  1205. struct VertexOutput
  1206. {
  1207. float4 clipPos : SV_POSITION;
  1208. float3 normalWS : TEXCOORD0;
  1209. float4 ase_texcoord1 : TEXCOORD1;
  1210. float4 ase_color : COLOR;
  1211. UNITY_VERTEX_INPUT_INSTANCE_ID
  1212. UNITY_VERTEX_OUTPUT_STEREO
  1213. };
  1214. CBUFFER_START(UnityPerMaterial)
  1215. float4 _Color;
  1216. float4 _MainTexChannel;
  1217. float _MainTexRotation;
  1218. float _Intensity;
  1219. float _ca;
  1220. #ifdef TESSELLATION_ON
  1221. float _TessPhongStrength;
  1222. float _TessValue;
  1223. float _TessMin;
  1224. float _TessMax;
  1225. float _TessEdgeLength;
  1226. float _TessMaxDisp;
  1227. #endif
  1228. CBUFFER_END
  1229. sampler2D _MainTex;
  1230. struct SurfaceDescription
  1231. {
  1232. float Alpha;
  1233. float AlphaClipThreshold;
  1234. };
  1235. VertexOutput VertexFunction(VertexInput v )
  1236. {
  1237. VertexOutput o;
  1238. ZERO_INITIALIZE(VertexOutput, o);
  1239. UNITY_SETUP_INSTANCE_ID(v);
  1240. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1241. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1242. o.ase_texcoord1.xy = v.ase_texcoord.xy;
  1243. o.ase_color = v.ase_color;
  1244. //setting value to unused interpolator channels and avoid initialization warnings
  1245. o.ase_texcoord1.zw = 0;
  1246. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1247. float3 defaultVertexValue = v.vertex.xyz;
  1248. #else
  1249. float3 defaultVertexValue = float3(0, 0, 0);
  1250. #endif
  1251. float3 vertexValue = defaultVertexValue;
  1252. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1253. v.vertex.xyz = vertexValue;
  1254. #else
  1255. v.vertex.xyz += vertexValue;
  1256. #endif
  1257. v.ase_normal = v.ase_normal;
  1258. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  1259. float3 normalWS = TransformObjectToWorldNormal(v.ase_normal);
  1260. o.clipPos = TransformWorldToHClip(positionWS);
  1261. o.normalWS.xyz = normalWS;
  1262. return o;
  1263. }
  1264. #if defined(TESSELLATION_ON)
  1265. struct VertexControl
  1266. {
  1267. float4 vertex : INTERNALTESSPOS;
  1268. float3 ase_normal : NORMAL;
  1269. float4 ase_texcoord : TEXCOORD0;
  1270. float4 ase_color : COLOR;
  1271. UNITY_VERTEX_INPUT_INSTANCE_ID
  1272. };
  1273. struct TessellationFactors
  1274. {
  1275. float edge[3] : SV_TessFactor;
  1276. float inside : SV_InsideTessFactor;
  1277. };
  1278. VertexControl vert ( VertexInput v )
  1279. {
  1280. VertexControl o;
  1281. UNITY_SETUP_INSTANCE_ID(v);
  1282. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1283. o.vertex = v.vertex;
  1284. o.ase_normal = v.ase_normal;
  1285. o.ase_texcoord = v.ase_texcoord;
  1286. o.ase_color = v.ase_color;
  1287. return o;
  1288. }
  1289. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1290. {
  1291. TessellationFactors o;
  1292. float4 tf = 1;
  1293. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1294. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1295. #if defined(ASE_FIXED_TESSELLATION)
  1296. tf = FixedTess( tessValue );
  1297. #elif defined(ASE_DISTANCE_TESSELLATION)
  1298. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1299. #elif defined(ASE_LENGTH_TESSELLATION)
  1300. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1301. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1302. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1303. #endif
  1304. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1305. return o;
  1306. }
  1307. [domain("tri")]
  1308. [partitioning("fractional_odd")]
  1309. [outputtopology("triangle_cw")]
  1310. [patchconstantfunc("TessellationFunction")]
  1311. [outputcontrolpoints(3)]
  1312. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1313. {
  1314. return patch[id];
  1315. }
  1316. [domain("tri")]
  1317. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1318. {
  1319. VertexInput o = (VertexInput) 0;
  1320. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1321. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  1322. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  1323. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1324. #if defined(ASE_PHONG_TESSELLATION)
  1325. float3 pp[3];
  1326. for (int i = 0; i < 3; ++i)
  1327. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1328. float phongStrength = _TessPhongStrength;
  1329. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1330. #endif
  1331. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1332. return VertexFunction(o);
  1333. }
  1334. #else
  1335. VertexOutput vert ( VertexInput v )
  1336. {
  1337. return VertexFunction( v );
  1338. }
  1339. #endif
  1340. half4 frag(VertexOutput IN ) : SV_TARGET
  1341. {
  1342. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1343. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  1344. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  1345. float2 rotator22 = mul( IN.ase_texcoord1.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  1346. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  1347. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  1348. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  1349. surfaceDescription.Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  1350. surfaceDescription.AlphaClipThreshold = 0.5;
  1351. #if _ALPHATEST_ON
  1352. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  1353. #endif
  1354. #ifdef LOD_FADE_CROSSFADE
  1355. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  1356. #endif
  1357. float3 normalWS = IN.normalWS;
  1358. return half4(NormalizeNormalPerPixel(normalWS), 0.0);
  1359. }
  1360. ENDHLSL
  1361. }
  1362. Pass
  1363. {
  1364. Name "DepthNormalsOnly"
  1365. Tags { "LightMode"="DepthNormalsOnly" }
  1366. ZTest LEqual
  1367. ZWrite On
  1368. HLSLPROGRAM
  1369. #pragma multi_compile_instancing
  1370. #define _RECEIVE_SHADOWS_OFF 1
  1371. #define ASE_SRP_VERSION 999999
  1372. #pragma exclude_renderers glcore gles gles3
  1373. #pragma vertex vert
  1374. #pragma fragment frag
  1375. #define ATTRIBUTES_NEED_NORMAL
  1376. #define ATTRIBUTES_NEED_TANGENT
  1377. #define ATTRIBUTES_NEED_TEXCOORD1
  1378. #define VARYINGS_NEED_NORMAL_WS
  1379. #define VARYINGS_NEED_TANGENT_WS
  1380. #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
  1381. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
  1382. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
  1383. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  1384. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
  1385. #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
  1386. #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
  1387. #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
  1388. struct VertexInput
  1389. {
  1390. float4 vertex : POSITION;
  1391. float3 ase_normal : NORMAL;
  1392. float4 ase_texcoord : TEXCOORD0;
  1393. float4 ase_color : COLOR;
  1394. UNITY_VERTEX_INPUT_INSTANCE_ID
  1395. };
  1396. struct VertexOutput
  1397. {
  1398. float4 clipPos : SV_POSITION;
  1399. float3 normalWS : TEXCOORD0;
  1400. float4 ase_texcoord1 : TEXCOORD1;
  1401. float4 ase_color : COLOR;
  1402. UNITY_VERTEX_INPUT_INSTANCE_ID
  1403. UNITY_VERTEX_OUTPUT_STEREO
  1404. };
  1405. CBUFFER_START(UnityPerMaterial)
  1406. float4 _Color;
  1407. float4 _MainTexChannel;
  1408. float _MainTexRotation;
  1409. float _Intensity;
  1410. float _ca;
  1411. #ifdef TESSELLATION_ON
  1412. float _TessPhongStrength;
  1413. float _TessValue;
  1414. float _TessMin;
  1415. float _TessMax;
  1416. float _TessEdgeLength;
  1417. float _TessMaxDisp;
  1418. #endif
  1419. CBUFFER_END
  1420. sampler2D _MainTex;
  1421. struct SurfaceDescription
  1422. {
  1423. float Alpha;
  1424. float AlphaClipThreshold;
  1425. };
  1426. VertexOutput VertexFunction(VertexInput v )
  1427. {
  1428. VertexOutput o;
  1429. ZERO_INITIALIZE(VertexOutput, o);
  1430. UNITY_SETUP_INSTANCE_ID(v);
  1431. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1432. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  1433. o.ase_texcoord1.xy = v.ase_texcoord.xy;
  1434. o.ase_color = v.ase_color;
  1435. //setting value to unused interpolator channels and avoid initialization warnings
  1436. o.ase_texcoord1.zw = 0;
  1437. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1438. float3 defaultVertexValue = v.vertex.xyz;
  1439. #else
  1440. float3 defaultVertexValue = float3(0, 0, 0);
  1441. #endif
  1442. float3 vertexValue = defaultVertexValue;
  1443. #ifdef ASE_ABSOLUTE_VERTEX_POS
  1444. v.vertex.xyz = vertexValue;
  1445. #else
  1446. v.vertex.xyz += vertexValue;
  1447. #endif
  1448. v.ase_normal = v.ase_normal;
  1449. float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
  1450. float3 normalWS = TransformObjectToWorldNormal(v.ase_normal);
  1451. o.clipPos = TransformWorldToHClip(positionWS);
  1452. o.normalWS.xyz = normalWS;
  1453. return o;
  1454. }
  1455. #if defined(TESSELLATION_ON)
  1456. struct VertexControl
  1457. {
  1458. float4 vertex : INTERNALTESSPOS;
  1459. float3 ase_normal : NORMAL;
  1460. float4 ase_texcoord : TEXCOORD0;
  1461. float4 ase_color : COLOR;
  1462. UNITY_VERTEX_INPUT_INSTANCE_ID
  1463. };
  1464. struct TessellationFactors
  1465. {
  1466. float edge[3] : SV_TessFactor;
  1467. float inside : SV_InsideTessFactor;
  1468. };
  1469. VertexControl vert ( VertexInput v )
  1470. {
  1471. VertexControl o;
  1472. UNITY_SETUP_INSTANCE_ID(v);
  1473. UNITY_TRANSFER_INSTANCE_ID(v, o);
  1474. o.vertex = v.vertex;
  1475. o.ase_normal = v.ase_normal;
  1476. o.ase_texcoord = v.ase_texcoord;
  1477. o.ase_color = v.ase_color;
  1478. return o;
  1479. }
  1480. TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
  1481. {
  1482. TessellationFactors o;
  1483. float4 tf = 1;
  1484. float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
  1485. float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
  1486. #if defined(ASE_FIXED_TESSELLATION)
  1487. tf = FixedTess( tessValue );
  1488. #elif defined(ASE_DISTANCE_TESSELLATION)
  1489. tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
  1490. #elif defined(ASE_LENGTH_TESSELLATION)
  1491. tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
  1492. #elif defined(ASE_LENGTH_CULL_TESSELLATION)
  1493. tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
  1494. #endif
  1495. o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
  1496. return o;
  1497. }
  1498. [domain("tri")]
  1499. [partitioning("fractional_odd")]
  1500. [outputtopology("triangle_cw")]
  1501. [patchconstantfunc("TessellationFunction")]
  1502. [outputcontrolpoints(3)]
  1503. VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
  1504. {
  1505. return patch[id];
  1506. }
  1507. [domain("tri")]
  1508. VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
  1509. {
  1510. VertexInput o = (VertexInput) 0;
  1511. o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
  1512. o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
  1513. o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
  1514. o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
  1515. #if defined(ASE_PHONG_TESSELLATION)
  1516. float3 pp[3];
  1517. for (int i = 0; i < 3; ++i)
  1518. pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
  1519. float phongStrength = _TessPhongStrength;
  1520. o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
  1521. #endif
  1522. UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
  1523. return VertexFunction(o);
  1524. }
  1525. #else
  1526. VertexOutput vert ( VertexInput v )
  1527. {
  1528. return VertexFunction( v );
  1529. }
  1530. #endif
  1531. half4 frag(VertexOutput IN ) : SV_TARGET
  1532. {
  1533. SurfaceDescription surfaceDescription = (SurfaceDescription)0;
  1534. float cos22 = cos( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  1535. float sin22 = sin( (0.0 + (_MainTexRotation - 0.0) * (( 2.0 * PI ) - 0.0) / (1.0 - 0.0)) );
  1536. float2 rotator22 = mul( IN.ase_texcoord1.xy - float2( 0.5,0.5 ) , float2x2( cos22 , -sin22 , sin22 , cos22 )) + float2( 0.5,0.5 );
  1537. float4 tex2DNode11 = tex2D( _MainTex, rotator22 );
  1538. float4 break19 = ( tex2DNode11 * _MainTexChannel );
  1539. float clampResult21 = clamp( ( break19.r + break19.g + break19.b + break19.a ) , 0.0 , 1.0 );
  1540. surfaceDescription.Alpha = ( _ca * ( tex2DNode11.a * IN.ase_color.a * clampResult21 ) * _Color.a );
  1541. surfaceDescription.AlphaClipThreshold = 0.5;
  1542. #if _ALPHATEST_ON
  1543. clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
  1544. #endif
  1545. #ifdef LOD_FADE_CROSSFADE
  1546. LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
  1547. #endif
  1548. float3 normalWS = IN.normalWS;
  1549. return half4(NormalizeNormalPerPixel(normalWS), 0.0);
  1550. }
  1551. ENDHLSL
  1552. }
  1553. }
  1554. CustomEditor "UnityEditor.ShaderGraphUnlitGUI"
  1555. Fallback "Hidden/InternalErrorShader"
  1556. }
  1557. /*ASEBEGIN
  1558. Version=18935
  1559. -1702;157.3333;1576.667;777;1112.467;480.7043;1.3;True;False
  1560. Node;AmplifyShaderEditor.PiNode;26;-1752.545,26.32182;Inherit;False;1;0;FLOAT;2;False;1;FLOAT;0
  1561. Node;AmplifyShaderEditor.RangedFloatNode;24;-1842.471,-133.7063;Inherit;False;Property;_MainTexRotation;贴图旋转;4;0;Create;False;0;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
  1562. Node;AmplifyShaderEditor.TexCoordVertexDataNode;23;-1581.544,-356.6783;Inherit;False;0;2;0;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1563. Node;AmplifyShaderEditor.TFHCRemapNode;25;-1512.544,-143.6782;Inherit;True;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
  1564. Node;AmplifyShaderEditor.RotatorNode;22;-1226.443,-327.2644;Inherit;True;3;0;FLOAT2;0,0;False;1;FLOAT2;0.5,0.5;False;2;FLOAT;0;False;1;FLOAT2;0
  1565. Node;AmplifyShaderEditor.SamplerNode;11;-927.8995,-396.8804;Inherit;True;Property;_MainTex;MainTex;0;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1566. Node;AmplifyShaderEditor.Vector4Node;17;-874.3092,-98.87162;Inherit;False;Property;_MainTexChannel;通道选择;3;0;Create;False;0;0;0;False;0;False;1,0,0,0;0,0,0,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1567. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;18;-634.3928,-60.52053;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;COLOR;0
  1568. Node;AmplifyShaderEditor.BreakToComponentsNode;19;-457.1129,-113.2291;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
  1569. Node;AmplifyShaderEditor.SimpleAddOpNode;20;-295.4679,-141.1914;Inherit;False;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0
  1570. Node;AmplifyShaderEditor.ClampOpNode;21;-138.7577,-160.9294;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
  1571. Node;AmplifyShaderEditor.VertexColorNode;14;-201,99.10001;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1572. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;16;113.4666,45.09998;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  1573. Node;AmplifyShaderEditor.RangedFloatNode;27;168.6014,-66.09914;Inherit;False;Property;_ca;_ca;5;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
  1574. Node;AmplifyShaderEditor.ColorNode;15;-169.3334,264.7;Inherit;False;Property;_Color;Color;1;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
  1575. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;273.1014,-10.19915;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
  1576. Node;AmplifyShaderEditor.RangedFloatNode;13;-375.0909,-250.7844;Inherit;False;Property;_Intensity;Intensity;2;0;Create;True;0;0;0;False;0;False;1;0;0;60;0;1;FLOAT;0
  1577. Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;160.4446,-295.1582;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;COLOR;0
  1578. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1579. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;5;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1580. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;4;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1581. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;6;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;True;1;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;2;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=Universal2D;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1582. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;9;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthNormals;0;8;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;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;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormalsOnly;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1583. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;7;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;SceneSelectionPass;0;6;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1584. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;10;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthNormalsOnly;0;9;DepthNormalsOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;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;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=DepthNormalsOnly;False;True;15;d3d9;d3d11_9x;d3d11;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1585. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;3;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;True;False;False;False;False;0;False;-1;False;False;False;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1586. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;8;345,-196;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ScenePickingPass;0;7;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;0;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;2;True;17;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;xbox360;xboxone;xboxseries;ps4;playstation;psp2;n3ds;wiiu;switch;nomrt;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;False;False;False;False;True;1;LightMode=Picking;False;True;4;d3d11;glcore;gles;gles3;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
  1587. Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;2;485.8,-231.6;Float;False;True;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;3;LT/AlphaBlend;2992e84f91cbeb14eab234972e07ea9d;True;Forward;0;1;Forward;8;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;2;False;-1;False;False;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;True;8;d3d9;d3d11;glcore;gles;gles3;metal;vulkan;nomrt;0;False;True;1;5;False;-1;10;False;-1;1;1;False;-1;10;False;-1;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;False;True;2;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=UniversalForwardOnly;False;False;0;Hidden/InternalErrorShader;0;0;Standard;22;Surface;1;637800577331334891; Blend;0;637805954579877271;Two Sided;0;637811189211308996;Cast Shadows;0;637800577346088376; Use Shadow Threshold;0;0;Receive Shadows;0;637800577359265521;GPU Instancing;1;0;LOD CrossFade;0;0;Built-in Fog;0;0;DOTS Instancing;0;0;Meta Pass;0;0;Extra Pre Pass;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,-1;0; Type;0;0; Tess;16,False,-1;0; Min;10,False,-1;0; Max;25,False,-1;0; Edge Length;16,False,-1;0; Max Displacement;25,False,-1;0;Vertex Position,InvertActionOnDeselection;1;0;0;10;False;True;False;True;False;True;True;True;True;True;False;;False;0
  1588. WireConnection;25;0;24;0
  1589. WireConnection;25;4;26;0
  1590. WireConnection;22;0;23;0
  1591. WireConnection;22;2;25;0
  1592. WireConnection;11;1;22;0
  1593. WireConnection;18;0;11;0
  1594. WireConnection;18;1;17;0
  1595. WireConnection;19;0;18;0
  1596. WireConnection;20;0;19;0
  1597. WireConnection;20;1;19;1
  1598. WireConnection;20;2;19;2
  1599. WireConnection;20;3;19;3
  1600. WireConnection;21;0;20;0
  1601. WireConnection;16;0;11;4
  1602. WireConnection;16;1;14;4
  1603. WireConnection;16;2;21;0
  1604. WireConnection;28;0;27;0
  1605. WireConnection;28;1;16;0
  1606. WireConnection;28;2;15;4
  1607. WireConnection;12;0;11;0
  1608. WireConnection;12;1;13;0
  1609. WireConnection;12;2;14;0
  1610. WireConnection;12;3;15;0
  1611. WireConnection;2;2;12;0
  1612. WireConnection;2;3;28;0
  1613. ASEEND*/
  1614. //CHKSM=51B77FE1AEC3D0AC4B788940684FA9EC3D9BD9FA