chunk-5242SYQJ.js 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062
  1. import {
  2. C as C3,
  3. O as O3,
  4. W,
  5. _ as _2,
  6. a as a5,
  7. o as o3,
  8. r as r7
  9. } from "./chunk-LDMWL65U.js";
  10. import {
  11. E as E2,
  12. a as a7
  13. } from "./chunk-WBWQJQK4.js";
  14. import {
  15. u as u3,
  16. u2 as u4
  17. } from "./chunk-2UEXES4O.js";
  18. import {
  19. e as e9,
  20. x
  21. } from "./chunk-UUVY36LI.js";
  22. import {
  23. a as a6,
  24. a2 as a8,
  25. a3 as a9,
  26. e as e10,
  27. e2 as e11,
  28. f as f2,
  29. i,
  30. i2,
  31. n as n4,
  32. o3 as o4,
  33. r as r6,
  34. t as t3,
  35. u as u2
  36. } from "./chunk-FQZKJNXZ.js";
  37. import {
  38. r as r5
  39. } from "./chunk-L5R6EFI6.js";
  40. import {
  41. r as r4
  42. } from "./chunk-A22ACVMF.js";
  43. import {
  44. e as e8
  45. } from "./chunk-QHWZYJGI.js";
  46. import {
  47. a as a4
  48. } from "./chunk-H2VOWDMO.js";
  49. import {
  50. O as O2
  51. } from "./chunk-RUM3DXFX.js";
  52. import {
  53. t as t2
  54. } from "./chunk-4OM3EX6P.js";
  55. import {
  56. C as C2,
  57. E,
  58. F
  59. } from "./chunk-3OFVLRSL.js";
  60. import {
  61. e as e7,
  62. o as o2
  63. } from "./chunk-44FMXGSC.js";
  64. import {
  65. e as e6
  66. } from "./chunk-GHN7C53L.js";
  67. import {
  68. a as a3,
  69. d,
  70. q
  71. } from "./chunk-ECY35CJI.js";
  72. import {
  73. n as n2,
  74. r as r3
  75. } from "./chunk-C7742RNZ.js";
  76. import {
  77. e as e5
  78. } from "./chunk-FZQZIM7U.js";
  79. import {
  80. c as c2
  81. } from "./chunk-VGWC3IKZ.js";
  82. import {
  83. n as n3
  84. } from "./chunk-O6VYMEIX.js";
  85. import {
  86. a as a2,
  87. h,
  88. m
  89. } from "./chunk-RYY6632W.js";
  90. import {
  91. O,
  92. _,
  93. e as e4,
  94. o,
  95. u,
  96. z
  97. } from "./chunk-DW42UVIT.js";
  98. import {
  99. r as r2
  100. } from "./chunk-YAEIHDJH.js";
  101. import {
  102. f,
  103. n
  104. } from "./chunk-TJNOJH33.js";
  105. import {
  106. e,
  107. e4 as e3,
  108. l
  109. } from "./chunk-2Z2TG5CU.js";
  110. import {
  111. C
  112. } from "./chunk-V6P2MAQQ.js";
  113. import {
  114. has
  115. } from "./chunk-SPWQ3AWG.js";
  116. import {
  117. c
  118. } from "./chunk-2TIUKVZN.js";
  119. import {
  120. a,
  121. e as e2,
  122. r,
  123. t,
  124. w
  125. } from "./chunk-YXWMMD76.js";
  126. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js
  127. var h2;
  128. !function(h10) {
  129. h10[h10.Color = 0] = "Color", h10[h10.Depth = 1] = "Depth", h10[h10.Normal = 2] = "Normal", h10[h10.Shadow = 3] = "Shadow", h10[h10.ShadowHighlight = 4] = "ShadowHighlight", h10[h10.ShadowExludeHighlight = 5] = "ShadowExludeHighlight", h10[h10.Highlight = 6] = "Highlight", h10[h10.Alpha = 7] = "Alpha", h10[h10.ObjectAndLayerIdColor = 8] = "ObjectAndLayerIdColor", h10[h10.COUNT = 9] = "COUNT";
  130. }(h2 || (h2 = {}));
  131. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js
  132. function o5(o26) {
  133. const f7 = n4`vec3 decodeNormal(vec2 f) {
  134. float z = 1.0 - abs(f.x) - abs(f.y);
  135. return vec3(f + sign(f) * min(z, 0.0), z);
  136. }`;
  137. o26.vertex.code.add(f7);
  138. }
  139. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js
  140. function o6(o26, d9) {
  141. d9.normalType === i3.Attribute && (o26.attributes.add(O2.NORMAL, "vec3"), o26.vertex.code.add(n4`vec3 normalModel() {
  142. return normal;
  143. }`)), d9.normalType === i3.CompressedAttribute && (o26.include(o5), o26.attributes.add(O2.NORMALCOMPRESSED, "vec2"), o26.vertex.code.add(n4`vec3 normalModel() {
  144. return decodeNormal(normalCompressed);
  145. }`)), d9.normalType === i3.ScreenDerivative && (o26.extensions.add("GL_OES_standard_derivatives"), o26.fragment.code.add(n4`vec3 screenDerivativeNormal(vec3 positionView) {
  146. return normalize(cross(dFdx(positionView), dFdy(positionView)));
  147. }`));
  148. }
  149. var i3;
  150. !function(e28) {
  151. e28[e28.Attribute = 0] = "Attribute", e28[e28.CompressedAttribute = 1] = "CompressedAttribute", e28[e28.Ground = 2] = "Ground", e28[e28.ScreenDerivative = 3] = "ScreenDerivative", e28[e28.COUNT = 4] = "COUNT";
  152. }(i3 || (i3 = {}));
  153. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js
  154. var d2;
  155. function o7(o26, v6) {
  156. switch (v6.textureCoordinateType) {
  157. case d2.Default:
  158. return o26.attributes.add(O2.UV0, "vec2"), o26.varyings.add("vuv0", "vec2"), void o26.vertex.code.add(n4`void forwardTextureCoordinates() {
  159. vuv0 = uv0;
  160. }`);
  161. case d2.Compressed:
  162. return o26.attributes.add(O2.UV0, "vec2"), o26.varyings.add("vuv0", "vec2"), void o26.vertex.code.add(n4`vec2 getUV0() {
  163. return uv0 / 16384.0;
  164. }
  165. void forwardTextureCoordinates() {
  166. vuv0 = getUV0();
  167. }`);
  168. case d2.Atlas:
  169. return o26.attributes.add(O2.UV0, "vec2"), o26.varyings.add("vuv0", "vec2"), o26.attributes.add(O2.UVREGION, "vec4"), o26.varyings.add("vuvRegion", "vec4"), void o26.vertex.code.add(n4`void forwardTextureCoordinates() {
  170. vuv0 = uv0;
  171. vuvRegion = uvRegion;
  172. }`);
  173. default:
  174. n3(v6.textureCoordinateType);
  175. case d2.None:
  176. return void o26.vertex.code.add(n4`void forwardTextureCoordinates() {}`);
  177. case d2.COUNT:
  178. return;
  179. }
  180. }
  181. !function(e28) {
  182. e28[e28.None = 0] = "None", e28[e28.Default = 1] = "Default", e28[e28.Atlas = 2] = "Atlas", e28[e28.Compressed = 3] = "Compressed", e28[e28.COUNT = 4] = "COUNT";
  183. }(d2 || (d2 = {}));
  184. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js
  185. var e12 = class extends i {
  186. constructor(r18, e28) {
  187. super(r18, "vec3", a6.Pass, (s5, o26, t17) => s5.setUniform3fv(r18, e28(o26, t17)));
  188. }
  189. };
  190. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl.js
  191. function t4(t17) {
  192. t17.extensions.add("GL_EXT_shader_texture_lod"), t17.extensions.add("GL_OES_standard_derivatives"), t17.fragment.code.add(n4`#ifndef GL_EXT_shader_texture_lod
  193. float calcMipMapLevel(const vec2 ddx, const vec2 ddy) {
  194. float deltaMaxSqr = max(dot(ddx, ddx), dot(ddy, ddy));
  195. return max(0.0, 0.5 * log2(deltaMaxSqr));
  196. }
  197. #endif
  198. vec4 textureAtlasLookup(sampler2D texture, vec2 textureSize, vec2 textureCoordinates, vec4 atlasRegion) {
  199. vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
  200. vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
  201. float maxdUV = 0.125;
  202. vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
  203. vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
  204. #ifdef GL_EXT_shader_texture_lod
  205. return texture2DGradEXT(texture, uvAtlas, dUVdx, dUVdy);
  206. #else
  207. vec2 dUVdxAuto = dFdx(uvAtlas);
  208. vec2 dUVdyAuto = dFdy(uvAtlas);
  209. float mipMapLevel = calcMipMapLevel(dUVdx * textureSize, dUVdy * textureSize);
  210. float autoMipMapLevel = calcMipMapLevel(dUVdxAuto * textureSize, dUVdyAuto * textureSize);
  211. return texture2D(texture, uvAtlas, mipMapLevel - autoMipMapLevel);
  212. #endif
  213. }`);
  214. }
  215. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js
  216. function a10(a15, s5) {
  217. switch (a15.include(o7, s5), a15.fragment.code.add(n4`
  218. struct TextureLookupParameter {
  219. vec2 uv;
  220. ${s5.supportsTextureAtlas ? "vec2 size;" : ""}
  221. } vtc;
  222. `), s5.textureCoordinateType) {
  223. case d2.Default:
  224. case d2.Compressed:
  225. return void a15.fragment.code.add(n4`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
  226. return texture2D(texture, params.uv);
  227. }`);
  228. case d2.Atlas:
  229. return a15.include(t4), void a15.fragment.code.add(n4`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
  230. return textureAtlasLookup(texture, params.size, params.uv, vuvRegion);
  231. }`);
  232. default:
  233. n3(s5.textureCoordinateType);
  234. case d2.None:
  235. case d2.COUNT:
  236. return;
  237. }
  238. }
  239. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js
  240. var o8 = class extends i {
  241. constructor(r18, o26) {
  242. super(r18, "vec3", a6.Draw, (e28, s5, t17, i12) => e28.setUniform3fv(r18, o26(s5, t17, i12)));
  243. }
  244. };
  245. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLMaterial.js
  246. var t5 = class {
  247. constructor(e28) {
  248. this._material = e28.material, this._techniqueRepository = e28.techniqueRep, this._output = e28.output;
  249. }
  250. dispose() {
  251. this._techniqueRepository.release(this._technique);
  252. }
  253. get technique() {
  254. return this._technique;
  255. }
  256. get _stippleTextureRepository() {
  257. return this._techniqueRepository.constructionContext.stippleTextureRepository;
  258. }
  259. ensureTechnique(e28, t17, i12 = this._output) {
  260. return this._technique = this._techniqueRepository.releaseAndAcquire(e28, this._material.getConfiguration(i12, t17), this._technique), this._technique;
  261. }
  262. ensureResources(t17) {
  263. return O3.LOADED;
  264. }
  265. };
  266. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLTextureMaterial.js
  267. var h3 = class extends t5 {
  268. constructor(t17) {
  269. super(t17), this._numLoading = 0, this._disposed = false, this._textureRepository = t17.textureRep, this._textureId = t17.textureId, this._acquire(t17.textureId, (t18) => this._texture = t18), this._acquire(t17.normalTextureId, (t18) => this._textureNormal = t18), this._acquire(t17.emissiveTextureId, (t18) => this._textureEmissive = t18), this._acquire(t17.occlusionTextureId, (t18) => this._textureOcclusion = t18), this._acquire(t17.metallicRoughnessTextureId, (t18) => this._textureMetallicRoughness = t18);
  270. }
  271. dispose() {
  272. this._texture = w(this._texture), this._textureNormal = w(this._textureNormal), this._textureEmissive = w(this._textureEmissive), this._textureOcclusion = w(this._textureOcclusion), this._textureMetallicRoughness = w(this._textureMetallicRoughness), this._disposed = true;
  273. }
  274. ensureResources(t17) {
  275. return 0 === this._numLoading ? O3.LOADED : O3.LOADING;
  276. }
  277. get textureBindParameters() {
  278. return new o9(r(this._texture) ? this._texture.glTexture : null, r(this._textureNormal) ? this._textureNormal.glTexture : null, r(this._textureEmissive) ? this._textureEmissive.glTexture : null, r(this._textureOcclusion) ? this._textureOcclusion.glTexture : null, r(this._textureMetallicRoughness) ? this._textureMetallicRoughness.glTexture : null);
  279. }
  280. updateTexture(e28) {
  281. (t(this._texture) || e28 !== this._texture.id) && (this._texture = w(this._texture), this._textureId = e28, this._acquire(this._textureId, (t17) => this._texture = t17));
  282. }
  283. _acquire(e28, r18) {
  284. if (t(e28))
  285. return void r18(null);
  286. const u10 = this._textureRepository.acquire(e28);
  287. if (C(u10))
  288. return ++this._numLoading, void u10.then((e29) => {
  289. if (this._disposed)
  290. return w(e29), void r18(null);
  291. r18(e29);
  292. }).finally(() => --this._numLoading);
  293. r18(u10);
  294. }
  295. };
  296. var o9 = class extends t3 {
  297. constructor(t17 = null, e28 = null, s5 = null, i12 = null, r18 = null) {
  298. super(), this.texture = t17, this.textureNormal = e28, this.textureEmissive = s5, this.textureOcclusion = i12, this.textureMetallicRoughness = r18;
  299. }
  300. };
  301. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
  302. var m2 = r4(0, 0.6, 0.2);
  303. var d3;
  304. !function(e28) {
  305. e28[e28.Disabled = 0] = "Disabled", e28[e28.Normal = 1] = "Normal", e28[e28.Schematic = 2] = "Schematic", e28[e28.Water = 3] = "Water", e28[e28.WaterOnIntegratedMesh = 4] = "WaterOnIntegratedMesh", e28[e28.COUNT = 5] = "COUNT";
  306. }(d3 || (d3 = {}));
  307. function x2(e28, l8) {
  308. const m5 = e28.fragment, p4 = l8.hasMetallicRoughnessTexture || l8.hasEmissionTexture || l8.hasOcclusionTexture;
  309. if (l8.pbrMode === d3.Normal && p4 && e28.include(a10, l8), l8.pbrMode !== d3.Schematic)
  310. if (l8.pbrMode !== d3.Disabled) {
  311. if (l8.pbrMode === d3.Normal) {
  312. m5.code.add(n4`vec3 mrr;
  313. vec3 emission;
  314. float occlusion;`);
  315. const e29 = l8.supportsTextureAtlas ? l8.hasWebGL2Context ? e11.None : e11.Size : e11.None, s5 = l8.pbrTextureBindType;
  316. l8.hasMetallicRoughnessTexture && (m5.uniforms.add(s5 === a6.Pass ? u2("texMetallicRoughness", (e30) => e30.textureMetallicRoughness, e29) : u3("texMetallicRoughness", (e30) => e30.textureMetallicRoughness, e29)), m5.code.add(n4`void applyMetallnessAndRoughness(TextureLookupParameter params) {
  317. vec3 metallicRoughness = textureLookup(texMetallicRoughness, params).rgb;
  318. mrr[0] *= metallicRoughness.b;
  319. mrr[1] *= metallicRoughness.g;
  320. }`)), l8.hasEmissionTexture && (m5.uniforms.add(s5 === a6.Pass ? u2("texEmission", (e30) => e30.textureEmissive, e29) : u3("texEmission", (e30) => e30.textureEmissive, e29)), m5.code.add(n4`void applyEmission(TextureLookupParameter params) {
  321. emission *= textureLookup(texEmission, params).rgb;
  322. }`)), l8.hasOcclusionTexture ? (m5.uniforms.add(s5 === a6.Pass ? u2("texOcclusion", (e30) => e30.textureOcclusion, e29) : u3("texOcclusion", (e30) => e30.textureOcclusion, e29)), m5.code.add(n4`void applyOcclusion(TextureLookupParameter params) {
  323. occlusion *= textureLookup(texOcclusion, params).r;
  324. }
  325. float getBakedOcclusion() {
  326. return occlusion;
  327. }`)) : m5.code.add(n4`float getBakedOcclusion() { return 1.0; }`), m5.uniforms.add(s5 === a6.Pass ? [new e12("emissionFactor", (e30) => e30.emissiveFactor), new e12("mrrFactors", (e30) => e30.mrrFactors)] : [new o8("emissionFactor", (e30) => e30.emissiveFactor), new o8("mrrFactors", (e30) => e30.mrrFactors)]), m5.code.add(n4`
  328. void applyPBRFactors() {
  329. mrr = mrrFactors;
  330. emission = emissionFactor;
  331. occlusion = 1.0;
  332. ${p4 ? n4`vtc.uv = vuv0;` : ""}
  333. ${l8.hasMetallicRoughnessTextureTransform ? n4`vtc.uv = metallicRoughnessUV;` : ""}
  334. ${l8.hasMetallicRoughnessTexture ? l8.supportsTextureAtlas ? n4`
  335. vtc.size = ${r6(l8, "texMetallicRoughness")};
  336. applyMetallnessAndRoughness(vtc);` : n4`applyMetallnessAndRoughness(vtc);` : ""}
  337. ${l8.hasEmissiveTextureTransform ? n4`vtc.uv = emissiveUV;` : ""}
  338. ${l8.hasEmissionTexture ? l8.supportsTextureAtlas ? n4`
  339. vtc.size = ${r6(l8, "texEmission")};
  340. applyEmission(vtc);` : n4`applyEmission(vtc);` : ""}
  341. ${l8.hasOcclusionTextureTransform ? n4`vtc.uv = occlusionUV;` : ""}
  342. ${l8.hasOcclusionTexture ? l8.supportsTextureAtlas ? n4`
  343. vtc.size = ${r6(l8, "texOcclusion")};
  344. applyOcclusion(vtc);` : n4`applyOcclusion(vtc);` : ""}
  345. }
  346. `);
  347. }
  348. } else
  349. m5.code.add(n4`float getBakedOcclusion() { return 1.0; }`);
  350. else
  351. m5.code.add(n4`vec3 mrr = vec3(0.0, 0.6, 0.2);
  352. vec3 emission = vec3(0.0);
  353. float occlusion = 1.0;
  354. void applyPBRFactors() {}
  355. float getBakedOcclusion() { return 1.0; }`);
  356. }
  357. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js
  358. function o10(o26) {
  359. o26.attributes.add(O2.POSITION, "vec3"), o26.vertex.code.add(n4`vec3 positionModel() { return position; }`);
  360. }
  361. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js
  362. var e13 = class extends i {
  363. constructor(r18, e28) {
  364. super(r18, "mat4", a6.Pass, (s5, o26, t17) => s5.setUniformMatrix4fv(r18, e28(o26, t17)));
  365. }
  366. };
  367. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl.js
  368. function c3({ code: c9 }, i12) {
  369. i12.doublePrecisionRequiresObfuscation ? c9.add(n4`vec3 dpPlusFrc(vec3 a, vec3 b) {
  370. return mix(a, a + b, vec3(notEqual(b, vec3(0))));
  371. }
  372. vec3 dpMinusFrc(vec3 a, vec3 b) {
  373. return mix(vec3(0), a - b, vec3(notEqual(a, b)));
  374. }
  375. vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
  376. vec3 t1 = dpPlusFrc(hiA, hiB);
  377. vec3 e = dpMinusFrc(t1, hiA);
  378. vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
  379. return t1 + t2;
  380. }`) : c9.add(n4`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
  381. vec3 t1 = hiA + hiB;
  382. vec3 e = t1 - hiA;
  383. vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
  384. return t1 + t2;
  385. }`);
  386. }
  387. function i4(e28) {
  388. return !!has("force-double-precision-obfuscation") || e28.driverTest.doublePrecisionRequiresObfuscation;
  389. }
  390. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js
  391. var o11 = class extends i {
  392. constructor(r18, o26) {
  393. super(r18, "mat3", a6.Draw, (e28, s5, t17) => e28.setUniformMatrix3fv(r18, o26(s5, t17)));
  394. }
  395. };
  396. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js
  397. var e14 = class extends i {
  398. constructor(r18, e28) {
  399. super(r18, "mat3", a6.Pass, (s5, o26, t17) => s5.setUniformMatrix3fv(r18, e28(o26, t17)));
  400. }
  401. };
  402. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js
  403. function F2(r18, o26) {
  404. r18.include(o10);
  405. const e28 = r18.vertex;
  406. e28.include(c3, o26), r18.varyings.add("vPositionWorldCameraRelative", "vec3"), r18.varyings.add("vPosition_view", "vec3"), e28.uniforms.add([new e12("transformWorldFromViewTH", (r19) => r19.transformWorldFromViewTH), new e12("transformWorldFromViewTL", (r19) => r19.transformWorldFromViewTL), new e14("transformViewFromCameraRelativeRS", (r19) => r19.transformViewFromCameraRelativeRS), new e13("transformProjFromView", (r19) => r19.transformProjFromView), new o11("transformWorldFromModelRS", (r19) => r19.transformWorldFromModelRS), new o8("transformWorldFromModelTH", (r19) => r19.transformWorldFromModelTH), new o8("transformWorldFromModelTL", (r19) => r19.transformWorldFromModelTL)]), e28.code.add(n4`vec3 positionWorldCameraRelative() {
  407. vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
  408. vec3 transform_CameraRelativeFromModel = dpAdd(
  409. transformWorldFromModelTL,
  410. transformWorldFromModelTH,
  411. -transformWorldFromViewTL,
  412. -transformWorldFromViewTH
  413. );
  414. return transform_CameraRelativeFromModel + rotatedModelPosition;
  415. }`), e28.code.add(n4`
  416. void forwardPosition(float fOffset) {
  417. vPositionWorldCameraRelative = positionWorldCameraRelative();
  418. if (fOffset != 0.0) {
  419. vPositionWorldCameraRelative += fOffset * ${o26.spherical ? n4`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)` : n4`vec3(0.0, 0.0, 1.0)`};
  420. }
  421. vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
  422. gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
  423. }
  424. `), r18.fragment.uniforms.add(new e12("transformWorldFromViewTL", (r19) => r19.transformWorldFromViewTL)), e28.code.add(n4`vec3 positionWorld() {
  425. return transformWorldFromViewTL + vPositionWorldCameraRelative;
  426. }`), r18.fragment.code.add(n4`vec3 positionWorld() {
  427. return transformWorldFromViewTL + vPositionWorldCameraRelative;
  428. }`);
  429. }
  430. var c4 = class extends t3 {
  431. constructor() {
  432. super(...arguments), this.transformWorldFromViewTH = n(), this.transformWorldFromViewTL = n(), this.transformViewFromCameraRelativeRS = e6(), this.transformProjFromView = e7();
  433. }
  434. };
  435. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js
  436. function n6(r18, o26) {
  437. o26.normalType === i3.Attribute || o26.normalType === i3.CompressedAttribute ? (r18.include(o6, o26), r18.varyings.add("vNormalWorld", "vec3"), r18.varyings.add("vNormalView", "vec3"), r18.vertex.uniforms.add([new o11("transformNormalGlobalFromModel", (r19) => r19.transformNormalGlobalFromModel), new e14("transformNormalViewFromGlobal", (r19) => r19.transformNormalViewFromGlobal)]), r18.vertex.code.add(n4`void forwardNormal() {
  438. vNormalWorld = transformNormalGlobalFromModel * normalModel();
  439. vNormalView = transformNormalViewFromGlobal * vNormalWorld;
  440. }`)) : o26.normalType === i3.Ground ? (r18.include(F2, o26), r18.varyings.add("vNormalWorld", "vec3"), r18.vertex.code.add(n4`
  441. void forwardNormal() {
  442. vNormalWorld = ${o26.spherical ? n4`normalize(vPositionWorldCameraRelative);` : n4`vec3(0.0, 0.0, 1.0);`}
  443. }
  444. `)) : r18.vertex.code.add(n4`void forwardNormal() {}`);
  445. }
  446. var f3 = class extends c4 {
  447. constructor() {
  448. super(...arguments), this.transformNormalViewFromGlobal = e6();
  449. }
  450. };
  451. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js
  452. var o12 = 0.1;
  453. var t6 = 1e-3;
  454. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js
  455. function t7(e28) {
  456. e28.varyings.add("linearDepth", "float");
  457. }
  458. function i5(e28) {
  459. e28.vertex.uniforms.add(new e10("nearFar", (e29, r18) => r18.camera.nearFar));
  460. }
  461. function n7(e28) {
  462. e28.vertex.code.add(n4`float calculateLinearDepth(vec2 nearFar,float z) {
  463. return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
  464. }`);
  465. }
  466. function d4(a15, d9) {
  467. const { vertex: s5 } = a15;
  468. switch (d9.output) {
  469. case h2.Color:
  470. if (d9.receiveShadows)
  471. return t7(a15), void s5.code.add(n4`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);
  472. break;
  473. case h2.Depth:
  474. case h2.Shadow:
  475. case h2.ShadowHighlight:
  476. case h2.ShadowExludeHighlight:
  477. return a15.include(F2, d9), t7(a15), i5(a15), n7(a15), void s5.code.add(n4`void forwardLinearDepth() {
  478. linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
  479. }`);
  480. }
  481. s5.code.add(n4`void forwardLinearDepth() {}`);
  482. }
  483. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js
  484. function e15(e28) {
  485. e28.vertex.code.add(n4`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
  486. vec3 camToVert = posWorld - camPosWorld;
  487. bool isBackface = dot(camToVert, normalWorld) > 0.0;
  488. if (isBackface) {
  489. posClip.z += 0.0000003 * posClip.w;
  490. }
  491. return posClip;
  492. }`);
  493. }
  494. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js
  495. function u5(s5, i12) {
  496. H(s5, i12, [new o8("slicePlaneOrigin", (e28, s6) => b(i12, e28, s6)), new o8("slicePlaneBasis1", (s6, a15) => {
  497. var _a;
  498. return B(i12, s6, a15, (_a = e2(a15.slicePlane)) == null ? void 0 : _a.basis1);
  499. }), new o8("slicePlaneBasis2", (s6, a15) => {
  500. var _a;
  501. return B(i12, s6, a15, (_a = e2(a15.slicePlane)) == null ? void 0 : _a.basis2);
  502. })]);
  503. }
  504. function H(e28, s5, i12) {
  505. if (!s5.hasSlicePlane) {
  506. const i13 = n4`#define rejectBySlice(_pos_) false
  507. #define discardBySlice(_pos_) {}
  508. #define highlightSlice(_color_, _pos_) (_color_)`;
  509. return s5.hasSliceInVertexProgram && e28.vertex.code.add(i13), void e28.fragment.code.add(i13);
  510. }
  511. e28.extensions.add("GL_OES_standard_derivatives"), s5.hasSliceInVertexProgram && e28.vertex.uniforms.add(i12), e28.fragment.uniforms.add(i12);
  512. const a15 = n4`struct SliceFactors {
  513. float front;
  514. float side0;
  515. float side1;
  516. float side2;
  517. float side3;
  518. };
  519. SliceFactors calculateSliceFactors(vec3 pos) {
  520. vec3 rel = pos - slicePlaneOrigin;
  521. vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
  522. float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
  523. float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
  524. float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
  525. float basis1Dot = dot(slicePlaneBasis1, rel);
  526. float basis2Dot = dot(slicePlaneBasis2, rel);
  527. return SliceFactors(
  528. dot(slicePlaneNormal, pos) + slicePlaneW,
  529. -basis1Dot - basis1Len2,
  530. basis1Dot - basis1Len2,
  531. -basis2Dot - basis2Len2,
  532. basis2Dot - basis2Len2
  533. );
  534. }
  535. bool sliceByFactors(SliceFactors factors) {
  536. return factors.front < 0.0
  537. && factors.side0 < 0.0
  538. && factors.side1 < 0.0
  539. && factors.side2 < 0.0
  540. && factors.side3 < 0.0;
  541. }
  542. bool sliceEnabled() {
  543. return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
  544. }
  545. bool sliceByPlane(vec3 pos) {
  546. return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
  547. }
  548. #define rejectBySlice(_pos_) sliceByPlane(_pos_)
  549. #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`, o26 = n4`vec4 applySliceHighlight(vec4 color, vec3 pos) {
  550. SliceFactors factors = calculateSliceFactors(pos);
  551. const float HIGHLIGHT_WIDTH = 1.0;
  552. const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
  553. factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
  554. factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
  555. factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
  556. factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
  557. factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
  558. if (sliceByFactors(factors)) {
  559. return color;
  560. }
  561. float highlightFactor = (1.0 - step(0.5, factors.front))
  562. * (1.0 - step(0.5, factors.side0))
  563. * (1.0 - step(0.5, factors.side1))
  564. * (1.0 - step(0.5, factors.side2))
  565. * (1.0 - step(0.5, factors.side3));
  566. return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
  567. }`, c9 = s5.hasSliceHighlight ? n4`
  568. ${o26}
  569. #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
  570. ` : n4`#define highlightSlice(_color_, _pos_) (_color_)`;
  571. s5.hasSliceInVertexProgram && e28.vertex.code.add(a15), e28.fragment.code.add(a15), e28.fragment.code.add(c9);
  572. }
  573. function g(e28, s5, i12) {
  574. return e28.instancedDoublePrecision ? o(S, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]) : s5.slicePlaneLocalOrigin;
  575. }
  576. function I(e28, s5) {
  577. return r(e28) ? e4(L, s5.origin, e28) : s5.origin;
  578. }
  579. function v(e28, s5, o26) {
  580. return e28.hasSliceTranslatedView ? r(s5) ? c2(T, o26.camera.viewMatrix, s5) : o26.camera.viewMatrix : null;
  581. }
  582. function b(e28, a15, o26) {
  583. if (t(o26.slicePlane))
  584. return f;
  585. const r18 = g(e28, a15, o26), l8 = I(r18, o26.slicePlane), t17 = v(e28, r18, o26);
  586. return r(t17) ? O(L, l8, t17) : l8;
  587. }
  588. function B(e28, a15, o26, t17) {
  589. if (t(t17) || t(o26.slicePlane))
  590. return f;
  591. const f7 = g(e28, a15, o26), d9 = I(f7, o26.slicePlane), _4 = v(e28, f7, o26);
  592. return r(_4) ? (u(G, t17, d9), O(L, d9, _4), O(G, G, _4), e4(G, G, L)) : t17;
  593. }
  594. var S = n();
  595. var L = n();
  596. var G = n();
  597. var T = e7();
  598. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js
  599. function r8(r18, t17) {
  600. if (n7(r18), t17.hasModelTransformation)
  601. return r18.vertex.code.add(n4`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
  602. vec4 eye = view * (model * vec4(pos, 1.0));
  603. depth = calculateLinearDepth(nearFar, eye.z);
  604. return proj * eye;
  605. }`), void r18.vertex.code.add(n4`vec4 transformPosition(mat4 proj, mat4 view, mat4 model, vec3 pos) {
  606. return proj * (view * (model * vec4(pos, 1.0)));
  607. }`);
  608. r18.vertex.code.add(n4`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
  609. vec4 eye = view * vec4(pos, 1.0);
  610. depth = calculateLinearDepth(nearFar,eye.z);
  611. return proj * eye;
  612. }`), r18.vertex.code.add(n4`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
  613. return proj * (view * vec4(pos, 1.0));
  614. }`);
  615. }
  616. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js
  617. var o13 = class extends i {
  618. constructor(r18, o26) {
  619. super(r18, "mat4", a6.Draw, (e28, s5, t17) => e28.setUniformMatrix4fv(r18, o26(s5, t17)));
  620. }
  621. };
  622. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js
  623. function c5(r18, e28) {
  624. e28.instancedDoublePrecision ? r18.constants.add("cameraPosition", "vec3", f) : r18.uniforms.add(new o8("cameraPosition", (r19, e29) => o(w2, e29.camera.viewInverseTransposeMatrix[3] - r19.origin[0], e29.camera.viewInverseTransposeMatrix[7] - r19.origin[1], e29.camera.viewInverseTransposeMatrix[11] - r19.origin[2])));
  625. }
  626. function v2(e28, i12) {
  627. if (!i12.instancedDoublePrecision)
  628. return void e28.uniforms.add([new e13("proj", (r18, e29) => e29.camera.projectionMatrix), new o13("view", (e29, a15) => c2(f4, a15.camera.viewMatrix, e29.origin)), new o8("localOrigin", (r18) => r18.origin)]);
  629. const o26 = (r18) => o(w2, r18.camera.viewInverseTransposeMatrix[3], r18.camera.viewInverseTransposeMatrix[7], r18.camera.viewInverseTransposeMatrix[11]);
  630. e28.uniforms.add([new e13("proj", (r18, e29) => e29.camera.projectionMatrix), new e13("view", (e29, a15) => c2(f4, a15.camera.viewMatrix, o26(a15))), new e12("localOrigin", (r18, e29) => o26(e29))]);
  631. }
  632. var f4 = e5();
  633. var w2 = n();
  634. function d5(r18) {
  635. r18.uniforms.add(new e13("viewNormal", (r19, e28) => e28.camera.viewInverseTransposeMatrix));
  636. }
  637. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js
  638. var t8 = class {
  639. constructor() {
  640. this._key = "", this._keyDirty = false, this._parameterBits = this._parameterBits ? this._parameterBits.map(() => 0) : [], this._parameterNames || (this._parameterNames = []);
  641. }
  642. get key() {
  643. return this._keyDirty && (this._keyDirty = false, this._key = String.fromCharCode.apply(String, this._parameterBits)), this._key;
  644. }
  645. snapshot() {
  646. const t17 = this._parameterNames, e28 = { key: this.key };
  647. for (const r18 of t17)
  648. e28[r18] = this[r18];
  649. return e28;
  650. }
  651. };
  652. function e16(t17 = {}) {
  653. return (e28, r18) => {
  654. var _a, _b;
  655. if (e28._parameterNames = (_a = e28._parameterNames) != null ? _a : [], e28._parameterNames.push(r18), null != t17.constValue)
  656. Object.defineProperty(e28, r18, { get: () => t17.constValue });
  657. else {
  658. const s5 = e28._parameterNames.length - 1, a15 = t17.count || 2, i12 = Math.ceil(Math.log2(a15)), o26 = (_b = e28._parameterBits) != null ? _b : [0];
  659. let h10 = 0;
  660. for (; o26[h10] + i12 > 16; )
  661. h10++, h10 >= o26.length && o26.push(0);
  662. e28._parameterBits = o26;
  663. const n18 = o26[h10], m5 = (1 << i12) - 1 << n18;
  664. o26[h10] += i12, Object.defineProperty(e28, r18, { get() {
  665. return this[s5];
  666. }, set(t18) {
  667. if (this[s5] !== t18 && (this[s5] = t18, this._keyDirty = true, this._parameterBits[h10] = this._parameterBits[h10] & ~m5 | +t18 << n18 & m5, "number" != typeof t18 && "boolean" != typeof t18))
  668. throw "Configuration value for " + r18 + " must be boolean or number, got " + typeof t18;
  669. } });
  670. }
  671. };
  672. }
  673. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js
  674. var v3 = class extends t8 {
  675. constructor() {
  676. super(...arguments), this.instancedDoublePrecision = false;
  677. }
  678. };
  679. function p(e28, i12) {
  680. i12.instanced && i12.instancedDoublePrecision && (e28.attributes.add(O2.MODELORIGINHI, "vec3"), e28.attributes.add(O2.MODELORIGINLO, "vec3"), e28.attributes.add(O2.MODEL, "mat3"), e28.attributes.add(O2.MODELNORMAL, "mat3"));
  681. const c9 = e28.vertex;
  682. i12.instancedDoublePrecision && (c9.include(c3, i12), c9.uniforms.add(new o8("viewOriginHi", (e29, i13) => o3(o(b2, i13.camera.viewInverseTransposeMatrix[3], i13.camera.viewInverseTransposeMatrix[7], i13.camera.viewInverseTransposeMatrix[11]), b2))), c9.uniforms.add(new o8("viewOriginLo", (e29, i13) => r7(o(b2, i13.camera.viewInverseTransposeMatrix[3], i13.camera.viewInverseTransposeMatrix[7], i13.camera.viewInverseTransposeMatrix[11]), b2)))), c9.code.add(n4`
  683. vec3 calculateVPos() {
  684. ${i12.instancedDoublePrecision ? "return model * localPosition().xyz;" : "return localPosition().xyz;"}
  685. }
  686. `), c9.code.add(n4`
  687. vec3 subtractOrigin(vec3 _pos) {
  688. ${i12.instancedDoublePrecision ? n4`
  689. vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);
  690. return _pos - originDelta;` : "return vpos;"}
  691. }
  692. `), c9.code.add(n4`
  693. vec3 dpNormal(vec4 _normal) {
  694. ${i12.instancedDoublePrecision ? "return normalize(modelNormal * _normal.xyz);" : "return normalize(_normal.xyz);"}
  695. }
  696. `), i12.output === h2.Normal && (d5(c9), c9.code.add(n4`
  697. vec3 dpNormalView(vec4 _normal) {
  698. ${i12.instancedDoublePrecision ? "return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);" : "return normalize((viewNormal * _normal).xyz);"}
  699. }
  700. `)), i12.hasVertexTangents && c9.code.add(n4`
  701. vec4 dpTransformVertexTangent(vec4 _tangent) {
  702. ${i12.instancedDoublePrecision ? "return vec4(modelNormal * _tangent.xyz, _tangent.w);" : "return _tangent;"}
  703. }
  704. `);
  705. }
  706. e([e16()], v3.prototype, "instancedDoublePrecision", void 0);
  707. var b2 = n();
  708. // node_modules/@arcgis/core/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl.js
  709. function e17(e28) {
  710. e28.vertex.code.add(n4`
  711. vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
  712. float symbolAlpha = 0.0;
  713. const float maxTint = 85.0;
  714. const float maxReplace = 170.0;
  715. const float scaleAlpha = 3.0;
  716. if (symbolColor.a > maxReplace) {
  717. colorMixMode = ${n4.int(r5.Multiply)};
  718. symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
  719. } else if (symbolColor.a > maxTint) {
  720. colorMixMode = ${n4.int(r5.Replace)};
  721. symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
  722. } else if (symbolColor.a > 0.0) {
  723. colorMixMode = ${n4.int(r5.Tint)};
  724. symbolAlpha = scaleAlpha * symbolColor.a;
  725. } else {
  726. colorMixMode = ${n4.int(r5.Multiply)};
  727. symbolAlpha = 0.0;
  728. }
  729. return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
  730. }
  731. `);
  732. }
  733. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js
  734. var e18 = class extends i {
  735. constructor(r18, e28) {
  736. super(r18, "int", a6.Pass, (s5, o26, i12) => s5.setUniform1i(r18, e28(o26, i12)));
  737. }
  738. };
  739. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js
  740. function l3(e28) {
  741. return Math.abs(e28 * e28 * e28);
  742. }
  743. function s(e28, t17, a15) {
  744. const i12 = a15.parameters, r18 = a15.paddingPixelsOverride;
  745. return x3.scale = Math.min(i12.divisor / (t17 - i12.offset), 1), x3.factor = l3(e28), x3.minPixelSize = i12.minPixelSize, x3.paddingPixels = r18, x3;
  746. }
  747. function c6(e28, t17) {
  748. return 0 === e28 ? t17.minPixelSize : t17.minPixelSize * (1 + 2 * t17.paddingPixels / e28);
  749. }
  750. function o14(t17, a15) {
  751. return Math.max(h(t17 * a15.scale, t17, a15.factor), c6(t17, a15));
  752. }
  753. function m3(e28, t17, a15, i12) {
  754. return o14(e28, s(t17, a15, i12));
  755. }
  756. var h4 = { curvatureDependent: { min: { curvature: m(10), tiltAngle: m(12), scaleFallOffFactor: 0.5 }, max: { curvature: m(70), tiltAngle: m(40), scaleFallOffFactor: 0.8 } }, scaleStart: 0.3, scaleFallOffRange: 0.65, minPixelSize: 0 };
  757. var x3 = { scale: 0, factor: 0, minPixelSize: 0, paddingPixels: 0 };
  758. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/renderers/utils.js
  759. function u7(t17) {
  760. return !!r(t17) && !t17.visible;
  761. }
  762. var g2 = new Float64Array(3);
  763. var b3 = new Float32Array(6);
  764. var j = e7();
  765. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/MaterialUtil.js
  766. var g3 = a3();
  767. function x4(t17, n18, e28, o26, i12, r18, s5) {
  768. if (!u7(n18))
  769. if (t17.boundingInfo) {
  770. e8(t17.primitiveType === a5.Triangle);
  771. const n19 = e28.tolerance;
  772. M(t17.boundingInfo, o26, i12, n19, r18, s5);
  773. } else {
  774. const n19 = t17.indices.get(O2.POSITION), e29 = t17.vertexAttributes.get(O2.POSITION);
  775. v4(o26, i12, 0, n19.length / 3, n19, e29, void 0, r18, s5);
  776. }
  777. }
  778. var b4 = n();
  779. function M(t17, n18, i12, r18, s5, c9) {
  780. if (t(t17))
  781. return;
  782. const f7 = N(n18, i12, b4);
  783. if (d(g3, t17.getBBMin()), q(g3, t17.getBBMax()), r(s5) && s5.applyToAabb(g3), O4(g3, n18, f7, r18)) {
  784. const { primitiveIndices: e28, indices: o26, position: f8 } = t17, a15 = e28 ? e28.length : o26.length / 3;
  785. if (a15 > W3) {
  786. const e29 = t17.getChildren();
  787. if (void 0 !== e29) {
  788. for (let t18 = 0; t18 < 8; ++t18)
  789. void 0 !== e29[t18] && M(e29[t18], n18, i12, r18, s5, c9);
  790. return;
  791. }
  792. }
  793. v4(n18, i12, 0, a15, o26, f8, e28, s5, c9);
  794. }
  795. }
  796. var y = n();
  797. function v4(t17, n18, e28, i12, r18, s5, c9, f7, a15) {
  798. if (c9)
  799. return I2(t17, n18, e28, i12, r18, s5, c9, f7, a15);
  800. const l8 = s5.data, u10 = s5.stride || s5.size, m5 = t17[0], p4 = t17[1], h10 = t17[2], d9 = n18[0] - m5, g6 = n18[1] - p4, x6 = n18[2] - h10;
  801. for (let b6 = e28, M4 = 3 * e28; b6 < i12; ++b6) {
  802. let t18 = u10 * r18[M4++], n19 = l8[t18++], e29 = l8[t18++], i13 = l8[t18];
  803. t18 = u10 * r18[M4++];
  804. let s6 = l8[t18++], c10 = l8[t18++], v6 = l8[t18];
  805. t18 = u10 * r18[M4++];
  806. let I4 = l8[t18++], T3 = l8[t18++], j4 = l8[t18];
  807. r(f7) && ([n19, e29, i13] = f7.applyToVertex(n19, e29, i13, b6), [s6, c10, v6] = f7.applyToVertex(s6, c10, v6, b6), [I4, T3, j4] = f7.applyToVertex(I4, T3, j4, b6));
  808. const N2 = s6 - n19, O5 = c10 - e29, V3 = v6 - i13, L4 = I4 - n19, S3 = T3 - e29, B3 = j4 - i13, E5 = g6 * B3 - S3 * x6, P4 = x6 * L4 - B3 * d9, U2 = d9 * S3 - L4 * g6, W4 = N2 * E5 + O5 * P4 + V3 * U2;
  809. if (Math.abs(W4) <= Number.EPSILON)
  810. continue;
  811. const z2 = m5 - n19, k = p4 - e29, R = h10 - i13, C4 = z2 * E5 + k * P4 + R * U2;
  812. if (W4 > 0) {
  813. if (C4 < 0 || C4 > W4)
  814. continue;
  815. } else if (C4 > 0 || C4 < W4)
  816. continue;
  817. const H2 = k * V3 - O5 * R, X = R * N2 - V3 * z2, Y2 = z2 * O5 - N2 * k, Z = d9 * H2 + g6 * X + x6 * Y2;
  818. if (W4 > 0) {
  819. if (Z < 0 || C4 + Z > W4)
  820. continue;
  821. } else if (Z > 0 || C4 + Z < W4)
  822. continue;
  823. const _4 = (L4 * H2 + S3 * X + B3 * Y2) / W4;
  824. if (_4 >= 0) {
  825. a15(_4, A(N2, O5, V3, L4, S3, B3, y), b6, false);
  826. }
  827. }
  828. }
  829. function I2(t17, n18, e28, i12, r18, s5, c9, f7, a15) {
  830. const l8 = s5.data, u10 = s5.stride || s5.size, m5 = t17[0], p4 = t17[1], h10 = t17[2], d9 = n18[0] - m5, g6 = n18[1] - p4, x6 = n18[2] - h10;
  831. for (let b6 = e28; b6 < i12; ++b6) {
  832. const t18 = c9[b6];
  833. let n19 = 3 * t18, e29 = u10 * r18[n19++], i13 = l8[e29++], s6 = l8[e29++], M4 = l8[e29];
  834. e29 = u10 * r18[n19++];
  835. let v6 = l8[e29++], I4 = l8[e29++], T3 = l8[e29];
  836. e29 = u10 * r18[n19];
  837. let j4 = l8[e29++], N2 = l8[e29++], O5 = l8[e29];
  838. r(f7) && ([i13, s6, M4] = f7.applyToVertex(i13, s6, M4, b6), [v6, I4, T3] = f7.applyToVertex(v6, I4, T3, b6), [j4, N2, O5] = f7.applyToVertex(j4, N2, O5, b6));
  839. const V3 = v6 - i13, L4 = I4 - s6, S3 = T3 - M4, B3 = j4 - i13, E5 = N2 - s6, P4 = O5 - M4, U2 = g6 * P4 - E5 * x6, W4 = x6 * B3 - P4 * d9, z2 = d9 * E5 - B3 * g6, k = V3 * U2 + L4 * W4 + S3 * z2;
  840. if (Math.abs(k) <= Number.EPSILON)
  841. continue;
  842. const R = m5 - i13, C4 = p4 - s6, H2 = h10 - M4, X = R * U2 + C4 * W4 + H2 * z2;
  843. if (k > 0) {
  844. if (X < 0 || X > k)
  845. continue;
  846. } else if (X > 0 || X < k)
  847. continue;
  848. const Y2 = C4 * S3 - L4 * H2, Z = H2 * V3 - S3 * R, _4 = R * L4 - V3 * C4, q2 = d9 * Y2 + g6 * Z + x6 * _4;
  849. if (k > 0) {
  850. if (q2 < 0 || X + q2 > k)
  851. continue;
  852. } else if (q2 > 0 || X + q2 < k)
  853. continue;
  854. const w5 = (B3 * Y2 + E5 * Z + P4 * _4) / k;
  855. if (w5 >= 0) {
  856. a15(w5, A(V3, L4, S3, B3, E5, P4, y), t18, false);
  857. }
  858. }
  859. }
  860. var T2 = n();
  861. var j2 = n();
  862. function A(t17, n18, e28, o26, c9, f7, a15) {
  863. return o(T2, t17, n18, e28), o(j2, o26, c9, f7), _(a15, T2, j2), z(a15, a15), a15;
  864. }
  865. function N(t17, n18, e28) {
  866. return o(e28, 1 / (n18[0] - t17[0]), 1 / (n18[1] - t17[1]), 1 / (n18[2] - t17[2]));
  867. }
  868. function O4(t17, n18, e28, o26) {
  869. return V(t17, n18, e28, o26, 1 / 0);
  870. }
  871. function V(t17, n18, e28, o26, i12) {
  872. const r18 = (t17[0] - o26 - n18[0]) * e28[0], s5 = (t17[3] + o26 - n18[0]) * e28[0];
  873. let c9 = Math.min(r18, s5), f7 = Math.max(r18, s5);
  874. const a15 = (t17[1] - o26 - n18[1]) * e28[1], l8 = (t17[4] + o26 - n18[1]) * e28[1];
  875. if (f7 = Math.min(f7, Math.max(a15, l8)), f7 < 0)
  876. return false;
  877. if (c9 = Math.max(c9, Math.min(a15, l8)), c9 > f7)
  878. return false;
  879. const u10 = (t17[2] - o26 - n18[2]) * e28[2], m5 = (t17[5] + o26 - n18[2]) * e28[2];
  880. return f7 = Math.min(f7, Math.max(u10, m5)), !(f7 < 0) && (c9 = Math.max(c9, Math.min(u10, m5)), !(c9 > f7) && c9 < i12);
  881. }
  882. function L2(t17, e28, i12, r18, s5) {
  883. let c9 = (i12.screenLength || 0) * t17.pixelRatio;
  884. r(s5) && (c9 = m3(c9, r18, e28, s5));
  885. const f7 = c9 * Math.tan(0.5 * t17.fovY) / (0.5 * t17.fullHeight);
  886. return a2(f7 * e28, i12.minWorldLength || 0, null != i12.maxWorldLength ? i12.maxWorldLength : 1 / 0);
  887. }
  888. function S2(t17, n18) {
  889. const e28 = n18 ? S2(n18) : {};
  890. for (const o26 in t17) {
  891. let n19 = t17[o26];
  892. n19 && n19.forEach && (n19 = P(n19)), null == n19 && o26 in e28 || (e28[o26] = n19);
  893. }
  894. return e28;
  895. }
  896. function B2(n18, e28) {
  897. let o26 = false;
  898. for (const i12 in e28) {
  899. const r18 = e28[i12];
  900. void 0 !== r18 && (Array.isArray(r18) ? null === n18[i12] ? (n18[i12] = r18.slice(), o26 = true) : c(n18[i12], r18) && (o26 = true) : n18[i12] !== r18 && (o26 = true, n18[i12] = r18));
  901. }
  902. return o26;
  903. }
  904. function P(t17) {
  905. const n18 = [];
  906. return t17.forEach((t18) => n18.push(t18)), n18;
  907. }
  908. var U = { multiply: 1, ignore: 2, replace: 3, tint: 4 };
  909. var W3 = 1e3;
  910. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js
  911. function i6(i12, t17) {
  912. t17.hasSymbolColors ? (i12.include(e17), i12.attributes.add(O2.SYMBOLCOLOR, "vec4"), i12.varyings.add("colorMixMode", "mediump float"), i12.vertex.code.add(n4`int symbolColorMixMode;
  913. vec4 getSymbolColor() {
  914. return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
  915. }
  916. void forwardColorMixMode() {
  917. colorMixMode = float(symbolColorMixMode) + 0.5;
  918. }`)) : (i12.fragment.uniforms.add(new e18("colorMixMode", (o26) => U[o26.colorMixMode])), i12.vertex.code.add(n4`vec4 getSymbolColor() { return vec4(1.0); }
  919. void forwardColorMixMode() {}`));
  920. }
  921. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js
  922. function e19(e28, d9) {
  923. d9.hasVertexColors ? (e28.attributes.add(O2.COLOR, "vec4"), e28.varyings.add("vColor", "vec4"), e28.vertex.code.add(n4`void forwardVertexColor() { vColor = color; }`), e28.vertex.code.add(n4`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)) : e28.vertex.code.add(n4`void forwardVertexColor() {}
  924. void forwardNormalizedVertexColor() {}`);
  925. }
  926. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js
  927. function c7(e28) {
  928. e28.vertex.code.add(n4`float screenSizePerspectiveMinSize(float size, vec4 factor) {
  929. float nonZeroSize = 1.0 - step(size, 0.0);
  930. return (
  931. factor.z * (
  932. 1.0 +
  933. nonZeroSize *
  934. 2.0 * factor.w / (
  935. size + (1.0 - nonZeroSize)
  936. )
  937. )
  938. );
  939. }`), e28.vertex.code.add(n4`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
  940. return absCosAngle * absCosAngle * absCosAngle;
  941. }`), e28.vertex.code.add(n4`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {
  942. return vec4(
  943. min(params.x / (distanceToCamera - params.y), 1.0),
  944. screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
  945. params.z,
  946. params.w
  947. );
  948. }`), e28.vertex.code.add(n4`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {
  949. return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));
  950. }`), e28.vertex.code.add(n4`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {
  951. return applyScreenSizePerspectiveScaleFactorFloat(
  952. size,
  953. screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
  954. );
  955. }`), e28.vertex.code.add(n4`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {
  956. return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / max(1e-5, size.y), 1.0), size, factor.y);
  957. }`), e28.vertex.code.add(n4`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {
  958. return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
  959. }`);
  960. }
  961. function i7(e28) {
  962. e28.uniforms.add(new e9("screenSizePerspectiveAlignment", (e29) => o16(e29.screenSizePerspectiveAlignment || e29.screenSizePerspective)));
  963. }
  964. function o16(a15) {
  965. return r2(n9, a15.parameters.divisor, a15.parameters.offset, a15.parameters.minPixelSize, a15.paddingPixelsOverride);
  966. }
  967. var n9 = n2();
  968. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js
  969. function a11(e28, r18) {
  970. const c9 = e28.vertex;
  971. r18.hasVerticalOffset ? (f5(c9), r18.hasScreenSizePerspective && (e28.include(c7), i7(c9), c5(e28.vertex, r18)), c9.code.add(n4`
  972. vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
  973. float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
  974. ${r18.spherical ? n4`vec3 worldNormal = normalize(worldPos + localOrigin);` : n4`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
  975. ${r18.hasScreenSizePerspective ? n4`
  976. float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
  977. float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);` : n4`
  978. float verticalOffsetScreenHeight = verticalOffset.x;`}
  979. // Screen sized offset in world space, used for example for line callouts
  980. float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
  981. return worldNormal * worldOffset;
  982. }
  983. vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
  984. return worldPos + calculateVerticalOffset(worldPos, localOrigin);
  985. }
  986. `)) : c9.code.add(n4`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`);
  987. }
  988. var i8 = n2();
  989. function f5(r18) {
  990. r18.uniforms.add(new e9("verticalOffset", (r19, t17) => {
  991. const { minWorldLength: l8, maxWorldLength: o26, screenLength: c9 } = r19.verticalOffset, s5 = Math.tan(0.5 * t17.camera.fovY) / (0.5 * t17.camera.fullViewport[3]), a15 = t17.camera.pixelRatio || 1;
  992. return r2(i8, c9 * a15, s5, l8, o26);
  993. }));
  994. }
  995. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js
  996. var e20 = class extends i {
  997. constructor(r18, e28, o26) {
  998. super(r18, "vec4", a6.Pass, (s5, o27, t17) => s5.setUniform4fv(r18, e28(o27, t17)), o26);
  999. }
  1000. };
  1001. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js
  1002. var o17 = class extends i {
  1003. constructor(r18, o26, e28) {
  1004. super(r18, "float", a6.Pass, (s5, e29, t17) => s5.setUniform1fv(r18, o26(e29, t17)), e28);
  1005. }
  1006. };
  1007. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObject.js
  1008. var r9 = class {
  1009. constructor() {
  1010. this.id = e3();
  1011. }
  1012. unload() {
  1013. }
  1014. };
  1015. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObjectType.js
  1016. var e21;
  1017. !function(e28) {
  1018. e28[e28.Layer = 0] = "Layer", e28[e28.Object = 1] = "Object", e28[e28.Geometry = 2] = "Geometry", e28[e28.Material = 3] = "Material", e28[e28.Texture = 4] = "Texture", e28[e28.COUNT = 5] = "COUNT";
  1019. }(e21 || (e21 = {}));
  1020. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js
  1021. var E3 = /* @__PURE__ */ new Map([[O2.POSITION, 0], [O2.NORMAL, 1], [O2.UV0, 2], [O2.COLOR, 3], [O2.SIZE, 4], [O2.TANGENT, 4], [O2.AUXPOS1, 5], [O2.SYMBOLCOLOR, 5], [O2.AUXPOS2, 6], [O2.FEATUREATTRIBUTE, 6], [O2.INSTANCEFEATUREATTRIBUTE, 6], [O2.INSTANCECOLOR, 7], [O2.OBJECTANDLAYERIDCOLOR, 7], [O2.OBJECTANDLAYERIDCOLOR_INSTANCED, 7], [O2.MODEL, 8], [O2.MODELNORMAL, 12], [O2.MODELORIGINHI, 11], [O2.MODELORIGINLO, 15]]);
  1022. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Material.js
  1023. var d6 = class extends r9 {
  1024. constructor(e28, r18) {
  1025. super(), this.type = e21.Material, this.supportsEdges = false, this._visible = true, this._renderPriority = 0, this._insertOrder = 0, this._vertexAttributeLocations = E3, this._parameters = S2(e28, r18), this.validateParameters(this._parameters);
  1026. }
  1027. dispose() {
  1028. }
  1029. get parameters() {
  1030. return this._parameters;
  1031. }
  1032. update(e28) {
  1033. return false;
  1034. }
  1035. setParameters(e28, r18 = true) {
  1036. B2(this._parameters, e28) && (this.validateParameters(this._parameters), r18 && this.parametersChanged());
  1037. }
  1038. validateParameters(e28) {
  1039. }
  1040. get visible() {
  1041. return this._visible;
  1042. }
  1043. set visible(e28) {
  1044. e28 !== this._visible && (this._visible = e28, this.parametersChanged());
  1045. }
  1046. shouldRender(e28) {
  1047. return this.isVisible() && this.isVisibleForOutput(e28.output) && 0 != (this.renderOccluded & e28.renderOccludedMask);
  1048. }
  1049. isVisibleForOutput(e28) {
  1050. return true;
  1051. }
  1052. get renderOccluded() {
  1053. return this.parameters.renderOccluded;
  1054. }
  1055. get renderPriority() {
  1056. return this._renderPriority;
  1057. }
  1058. set renderPriority(e28) {
  1059. e28 !== this._renderPriority && (this._renderPriority = e28, this.parametersChanged());
  1060. }
  1061. get insertOrder() {
  1062. return this._insertOrder;
  1063. }
  1064. set insertOrder(e28) {
  1065. e28 !== this._insertOrder && (this._insertOrder = e28, this.parametersChanged());
  1066. }
  1067. get vertexAttributeLocations() {
  1068. return this._vertexAttributeLocations;
  1069. }
  1070. isVisible() {
  1071. return this._visible;
  1072. }
  1073. parametersChanged() {
  1074. r(this.repository) && this.repository.materialChanged(this);
  1075. }
  1076. };
  1077. var o18;
  1078. !function(e28) {
  1079. e28[e28.Occlude = 1] = "Occlude", e28[e28.Transparent = 2] = "Transparent", e28[e28.OccludeAndTransparent = 4] = "OccludeAndTransparent", e28[e28.OccludeAndTransparentStencil = 8] = "OccludeAndTransparentStencil", e28[e28.Opaque = 16] = "Opaque";
  1080. }(o18 || (o18 = {}));
  1081. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/VisualVariablePassParameters.js
  1082. var o19 = 8;
  1083. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js
  1084. function s2(s5, n18) {
  1085. n18.hasVvInstancing && (n18.vvSize || n18.vvColor) && s5.attributes.add(O2.INSTANCEFEATUREATTRIBUTE, "vec4");
  1086. const l8 = s5.vertex;
  1087. n18.vvSize ? (l8.uniforms.add(new e12("vvSizeMinSize", (e28) => e28.vvSizeMinSize)), l8.uniforms.add(new e12("vvSizeMaxSize", (e28) => e28.vvSizeMaxSize)), l8.uniforms.add(new e12("vvSizeOffset", (e28) => e28.vvSizeOffset)), l8.uniforms.add(new e12("vvSizeFactor", (e28) => e28.vvSizeFactor)), l8.uniforms.add(new e14("vvSymbolRotationMatrix", (e28) => e28.vvSymbolRotationMatrix)), l8.uniforms.add(new e12("vvSymbolAnchor", (e28) => e28.vvSymbolAnchor)), l8.code.add(n4`vec3 vvScale(vec4 _featureAttribute) {
  1088. return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
  1089. }
  1090. vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
  1091. return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
  1092. }`), l8.code.add(n4`
  1093. const float eps = 1.192092896e-07;
  1094. vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
  1095. vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
  1096. return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
  1097. }
  1098. ${n18.hasVvInstancing ? n4`
  1099. vec4 vvLocalNormal(vec3 _normal) {
  1100. return vvTransformNormal(_normal, instanceFeatureAttribute);
  1101. }
  1102. vec4 localPosition() {
  1103. return vvTransformPosition(position, instanceFeatureAttribute);
  1104. }` : ""}
  1105. `)) : l8.code.add(n4`vec4 localPosition() { return vec4(position, 1.0); }
  1106. vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`), n18.vvColor ? (l8.constants.add("vvColorNumber", "int", o19), n18.hasVvInstancing && l8.uniforms.add([new o17("vvColorValues", (e28) => e28.vvColorValues, o19), new e20("vvColorColors", (e28) => e28.vvColorColors, o19)]), l8.code.add(n4`
  1107. vec4 vvGetColor(vec4 featureAttribute, float values[vvColorNumber], vec4 colors[vvColorNumber]) {
  1108. float value = featureAttribute.y;
  1109. if (value <= values[0]) {
  1110. return colors[0];
  1111. }
  1112. for (int i = 1; i < vvColorNumber; ++i) {
  1113. if (values[i] >= value) {
  1114. float f = (value - values[i-1]) / (values[i] - values[i-1]);
  1115. return mix(colors[i-1], colors[i], f);
  1116. }
  1117. }
  1118. return colors[vvColorNumber - 1];
  1119. }
  1120. ${n18.hasVvInstancing ? n4`
  1121. vec4 vvColor() {
  1122. return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);
  1123. }` : ""}
  1124. `)) : l8.code.add(n4`vec4 vvColor() { return vec4(1.0); }`);
  1125. }
  1126. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js
  1127. function d7(d9) {
  1128. d9.fragment.code.add(n4`
  1129. #define discardOrAdjustAlpha(color) { if (color.a < ${n4.float(t6)}) { discard; } }
  1130. `);
  1131. }
  1132. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js
  1133. function s3(a15, e28) {
  1134. l4(a15, e28, new o4("textureAlphaCutoff", (a16) => a16.textureAlphaCutoff));
  1135. }
  1136. function l4(e28, r18, s5) {
  1137. const t17 = e28.fragment;
  1138. switch (r18.alphaDiscardMode !== C3.Mask && r18.alphaDiscardMode !== C3.MaskBlend || t17.uniforms.add(s5), r18.alphaDiscardMode) {
  1139. case C3.Blend:
  1140. return e28.include(d7);
  1141. case C3.Opaque:
  1142. t17.code.add(n4`void discardOrAdjustAlpha(inout vec4 color) {
  1143. color.a = 1.0;
  1144. }`);
  1145. break;
  1146. case C3.Mask:
  1147. t17.code.add(n4`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);
  1148. break;
  1149. case C3.MaskBlend:
  1150. e28.fragment.code.add(n4`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`);
  1151. }
  1152. }
  1153. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js
  1154. function d8(d9, t17) {
  1155. const a15 = t17.output === h2.ObjectAndLayerIdColor, n18 = t17.objectAndLayerIdColorInstanced;
  1156. a15 && (d9.varyings.add("objectAndLayerIdColorVarying", "vec4"), n18 ? d9.attributes.add(O2.OBJECTANDLAYERIDCOLOR_INSTANCED, "vec4") : d9.attributes.add(O2.OBJECTANDLAYERIDCOLOR, "vec4")), d9.vertex.code.add(n4`
  1157. void forwardObjectAndLayerIdColor() {
  1158. ${a15 ? n18 ? n4`objectAndLayerIdColorVarying = objectAndLayerIdColor_instanced * 0.003921568627451;` : n4`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;` : n4``} }`), d9.fragment.code.add(n4`
  1159. void outputObjectAndLayerIdColor() {
  1160. ${a15 ? n4`gl_FragColor = objectAndLayerIdColorVarying;` : n4``} }`);
  1161. }
  1162. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js
  1163. function o20(o26, l8) {
  1164. switch (o26.fragment.include(a8), l8.output) {
  1165. case h2.Shadow:
  1166. case h2.ShadowHighlight:
  1167. case h2.ShadowExludeHighlight:
  1168. o26.extensions.add("GL_OES_standard_derivatives"), o26.fragment.code.add(n4`float _calculateFragDepth(const in float depth) {
  1169. const float SLOPE_SCALE = 2.0;
  1170. const float BIAS = 20.0 * .000015259;
  1171. float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
  1172. float result = depth + SLOPE_SCALE * m + BIAS;
  1173. return clamp(result, .0, .999999);
  1174. }
  1175. void outputDepth(float _linearDepth) {
  1176. gl_FragColor = float2rgba(_calculateFragDepth(_linearDepth));
  1177. }`);
  1178. break;
  1179. case h2.Depth:
  1180. o26.fragment.code.add(n4`void outputDepth(float _linearDepth) {
  1181. gl_FragColor = float2rgba(_linearDepth);
  1182. }`);
  1183. }
  1184. }
  1185. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js
  1186. var g4 = r3(1, 1, 0, 1);
  1187. var i9 = r3(1, 0, 1, 1);
  1188. function a12(e28, a15) {
  1189. e28.fragment.uniforms.add(u2("depthTex", (e29, o26) => o26.highlightDepthTexture, a15.hasWebGL2Context ? e11.None : e11.InvSize)), e28.fragment.constants.add("occludedHighlightFlag", "vec4", g4).add("unoccludedHighlightFlag", "vec4", i9), e28.fragment.code.add(n4`
  1190. void outputHighlight() {
  1191. vec3 fragCoord = gl_FragCoord.xyz;
  1192. float sceneDepth = ${i2(a15, "depthTex", "fragCoord.xy")}.x;
  1193. if (fragCoord.z > sceneDepth + 5e-7) {
  1194. gl_FragColor = occludedHighlightFlag;
  1195. }
  1196. else {
  1197. gl_FragColor = unoccludedHighlightFlag;
  1198. }
  1199. }
  1200. `);
  1201. }
  1202. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
  1203. function b5(b6, O5) {
  1204. const { vertex: w5, fragment: C4 } = b6, T3 = O5.hasModelTransformation;
  1205. T3 && w5.uniforms.add(new e13("model", (e28) => r(e28.modelTransformation) ? e28.modelTransformation : o2));
  1206. const V3 = O5.hasColorTexture && O5.alphaDiscardMode !== C3.Opaque;
  1207. switch (O5.output) {
  1208. case h2.Depth:
  1209. case h2.Shadow:
  1210. case h2.ShadowHighlight:
  1211. case h2.ShadowExludeHighlight:
  1212. case h2.ObjectAndLayerIdColor:
  1213. v2(w5, O5), b6.include(r8, O5), b6.include(o7, O5), b6.include(s2, O5), b6.include(o20, O5), b6.include(u5, O5), b6.include(d8, O5), i5(b6), b6.varyings.add("depth", "float"), V3 && C4.uniforms.add(new f2("tex", (o26) => o26.texture)), w5.code.add(n4`
  1214. void main(void) {
  1215. vpos = calculateVPos();
  1216. vpos = subtractOrigin(vpos);
  1217. vpos = addVerticalOffset(vpos, localOrigin);
  1218. gl_Position = transformPositionWithDepth(proj, view, ${T3 ? "model," : ""} vpos, nearFar, depth);
  1219. forwardTextureCoordinates();
  1220. forwardObjectAndLayerIdColor();
  1221. }
  1222. `), b6.include(s3, O5), C4.code.add(n4`
  1223. void main(void) {
  1224. discardBySlice(vpos);
  1225. ${V3 ? n4`
  1226. vec4 texColor = texture2D(tex, ${O5.hasColorTextureTransform ? n4`colorUV` : n4`vuv0`});
  1227. discardOrAdjustAlpha(texColor);` : ""}
  1228. ${O5.output === h2.ObjectAndLayerIdColor ? n4`outputObjectAndLayerIdColor();` : n4`outputDepth(depth);`}
  1229. }
  1230. `);
  1231. break;
  1232. case h2.Normal:
  1233. v2(w5, O5), b6.include(r8, O5), b6.include(o6, O5), b6.include(n6, O5), b6.include(o7, O5), b6.include(s2, O5), V3 && C4.uniforms.add(new f2("tex", (o26) => o26.texture)), b6.varyings.add("vPositionView", "vec3"), w5.code.add(n4`
  1234. void main(void) {
  1235. vpos = calculateVPos();
  1236. vpos = subtractOrigin(vpos);
  1237. ${O5.normalType === i3.Attribute ? n4`
  1238. vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));` : ""}
  1239. vpos = addVerticalOffset(vpos, localOrigin);
  1240. gl_Position = transformPosition(proj, view, ${T3 ? "model," : ""} vpos);
  1241. forwardTextureCoordinates();
  1242. }
  1243. `), b6.include(u5, O5), b6.include(s3, O5), C4.code.add(n4`
  1244. void main() {
  1245. discardBySlice(vpos);
  1246. ${V3 ? n4`
  1247. vec4 texColor = texture2D(tex, ${O5.hasColorTextureTransform ? n4`colorUV` : n4`vuv0`});
  1248. discardOrAdjustAlpha(texColor);` : ""}
  1249. ${O5.normalType === i3.ScreenDerivative ? n4`
  1250. vec3 normal = screenDerivativeNormal(vPositionView);` : n4`
  1251. vec3 normal = normalize(vNormalWorld);
  1252. if (gl_FrontFacing == false) normal = -normal;`}
  1253. gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
  1254. }
  1255. `);
  1256. break;
  1257. case h2.Highlight:
  1258. v2(w5, O5), b6.include(r8, O5), b6.include(o7, O5), b6.include(s2, O5), V3 && C4.uniforms.add(new f2("tex", (o26) => o26.texture)), w5.code.add(n4`
  1259. void main(void) {
  1260. vpos = calculateVPos();
  1261. vpos = subtractOrigin(vpos);
  1262. vpos = addVerticalOffset(vpos, localOrigin);
  1263. gl_Position = transformPosition(proj, view, ${T3 ? "model," : ""} vpos);
  1264. forwardTextureCoordinates();
  1265. }
  1266. `), b6.include(u5, O5), b6.include(s3, O5), b6.include(a12, O5), C4.code.add(n4`
  1267. void main() {
  1268. discardBySlice(vpos);
  1269. ${V3 ? n4`
  1270. vec4 texColor = texture2D(tex, ${O5.hasColorTextureTransform ? n4`colorUV` : n4`vuv0`});
  1271. discardOrAdjustAlpha(texColor);` : ""}
  1272. outputHighlight();
  1273. }
  1274. `);
  1275. }
  1276. }
  1277. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js
  1278. var n10 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 12)];
  1279. var w3 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 20), new t2(O2.UV0, 2, C2.FLOAT, 12, 20)];
  1280. var I3 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 32), new t2(O2.NORMAL, 3, C2.FLOAT, 12, 32), new t2(O2.UV0, 2, C2.FLOAT, 24, 32)];
  1281. var r11 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 16), new t2(O2.COLOR, 4, C2.UNSIGNED_BYTE, 12, 16)];
  1282. var t10 = [new t2(O2.POSITION, 2, C2.FLOAT, 0, 8)];
  1283. var A2 = [new t2(O2.POSITION, 2, C2.FLOAT, 0, 16), new t2(O2.UV0, 2, C2.FLOAT, 8, 16)];
  1284. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/VertexArrayObject.js
  1285. var r12 = class extends a7 {
  1286. };
  1287. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/glUtil3D.js
  1288. function u8(i12, m5 = t10, l8 = E3, T3 = -1, f7 = 1) {
  1289. let u10 = null;
  1290. if (m5 === A2)
  1291. u10 = new Float32Array([T3, T3, 0, 0, f7, T3, 1, 0, T3, f7, 0, 1, f7, f7, 1, 1]);
  1292. else
  1293. u10 = new Float32Array([T3, T3, f7, T3, T3, f7, f7, f7]);
  1294. return new r12(i12, l8, { geometry: m5 }, { geometry: E2.createVertex(i12, F.STATIC_DRAW, u10) });
  1295. }
  1296. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule.js
  1297. var t11 = class {
  1298. constructor(t17, o26) {
  1299. this._module = t17, this._loadModule = o26;
  1300. }
  1301. get() {
  1302. return this._module;
  1303. }
  1304. async reload() {
  1305. return this._module = await this._loadModule(), this._module;
  1306. }
  1307. };
  1308. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js
  1309. var e23 = class {
  1310. constructor(i12, t17, e28) {
  1311. this.release = e28, this.initializeConfiguration(i12, t17), this._configuration = t17.snapshot(), this._program = this.initializeProgram(i12), this._pipeline = this.initializePipeline(i12.rctx.capabilities);
  1312. }
  1313. destroy() {
  1314. this._program = a(this._program), this._pipeline = this._configuration = null;
  1315. }
  1316. reload(t17) {
  1317. a(this._program), this._program = this.initializeProgram(t17), this._pipeline = this.initializePipeline(t17.rctx.capabilities);
  1318. }
  1319. get program() {
  1320. return this._program;
  1321. }
  1322. get compiled() {
  1323. return this.program.isCompiled;
  1324. }
  1325. get key() {
  1326. return this._configuration.key;
  1327. }
  1328. get configuration() {
  1329. return this._configuration;
  1330. }
  1331. bindPipelineState(i12, t17 = null, e28) {
  1332. i12.setPipelineState(this.getPipelineState(t17, e28));
  1333. }
  1334. ensureAttributeLocations(i12) {
  1335. this.program.assertCompatibleVertexAttributeLocations(i12);
  1336. }
  1337. get primitiveType() {
  1338. return E.TRIANGLES;
  1339. }
  1340. getPipelineState(i12, t17) {
  1341. return this._pipeline;
  1342. }
  1343. initializeConfiguration(i12, t17) {
  1344. }
  1345. };
  1346. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Program.js
  1347. var o21 = class {
  1348. constructor(t17, e28, o26) {
  1349. this._context = t17, this._locations = o26, this._textures = /* @__PURE__ */ new Map(), this._freeTextureUnits = new l({ deallocator: null }), this._glProgram = t17.programCache.acquire(e28.generate("vertex"), e28.generate("fragment"), o26), this._glProgram.stop = () => {
  1350. throw new Error("Wrapped _glProgram used directly");
  1351. }, this.bindPass = e28.generateBind(a6.Pass, this), this.bindDraw = e28.generateBind(a6.Draw, this), this._fragmentUniforms = a4() ? e28.fragmentUniforms : null;
  1352. }
  1353. dispose() {
  1354. this._glProgram.dispose();
  1355. }
  1356. get glName() {
  1357. return this._glProgram.glName;
  1358. }
  1359. get isCompiled() {
  1360. return this._glProgram.isCompiled;
  1361. }
  1362. setUniform1b(t17, e28) {
  1363. this._glProgram.setUniform1i(t17, e28 ? 1 : 0);
  1364. }
  1365. setUniform1i(t17, e28) {
  1366. this._glProgram.setUniform1i(t17, e28);
  1367. }
  1368. setUniform1f(t17, e28) {
  1369. this._glProgram.setUniform1f(t17, e28);
  1370. }
  1371. setUniform2fv(t17, e28) {
  1372. this._glProgram.setUniform2fv(t17, e28);
  1373. }
  1374. setUniform3fv(t17, e28) {
  1375. this._glProgram.setUniform3fv(t17, e28);
  1376. }
  1377. setUniform4fv(t17, e28) {
  1378. this._glProgram.setUniform4fv(t17, e28);
  1379. }
  1380. setUniformMatrix3fv(t17, e28) {
  1381. this._glProgram.setUniformMatrix3fv(t17, e28);
  1382. }
  1383. setUniformMatrix4fv(t17, e28) {
  1384. this._glProgram.setUniformMatrix4fv(t17, e28);
  1385. }
  1386. setUniform1fv(t17, e28) {
  1387. this._glProgram.setUniform1fv(t17, e28);
  1388. }
  1389. setUniform1iv(t17, e28) {
  1390. this._glProgram.setUniform1iv(t17, e28);
  1391. }
  1392. setUniform2iv(t17, e28) {
  1393. this._glProgram.setUniform3iv(t17, e28);
  1394. }
  1395. setUniform3iv(t17, e28) {
  1396. this._glProgram.setUniform3iv(t17, e28);
  1397. }
  1398. setUniform4iv(t17, e28) {
  1399. this._glProgram.setUniform4iv(t17, e28);
  1400. }
  1401. assertCompatibleVertexAttributeLocations(t17) {
  1402. t17.locations !== this._locations && console.error("VertexAttributeLocations are incompatible");
  1403. }
  1404. stop() {
  1405. this._textures.clear(), this._freeTextureUnits.clear();
  1406. }
  1407. bindTexture(e28, r18) {
  1408. if (t(r18) || null == r18.glName) {
  1409. const t17 = this._textures.get(e28);
  1410. return t17 && (this._context.bindTexture(null, t17.unit), this._freeTextureUnit(t17), this._textures.delete(e28)), null;
  1411. }
  1412. let i12 = this._textures.get(e28);
  1413. return null == i12 ? (i12 = this._allocTextureUnit(r18), this._textures.set(e28, i12)) : i12.texture = r18, this._context.useProgram(this), this.setUniform1i(e28, i12.unit), this._context.bindTexture(r18, i12.unit), i12.unit;
  1414. }
  1415. rebindTextures() {
  1416. this._context.useProgram(this), this._textures.forEach((t17, e28) => {
  1417. this._context.bindTexture(t17.texture, t17.unit), this.setUniform1i(e28, t17.unit);
  1418. }), r(this._fragmentUniforms) && this._fragmentUniforms.forEach((t17) => {
  1419. "sampler2D" !== t17.type && "samplerCube" !== t17.type || this._textures.has(t17.name) || console.error(`Texture sampler ${t17.name} has no bound texture`);
  1420. });
  1421. }
  1422. _allocTextureUnit(t17) {
  1423. return { texture: t17, unit: 0 === this._freeTextureUnits.length ? this._textures.size : this._freeTextureUnits.pop() };
  1424. }
  1425. _freeTextureUnit(t17) {
  1426. this._freeTextureUnits.push(t17.unit);
  1427. }
  1428. };
  1429. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/SSAOBlurTechnique.js
  1430. var l5 = class extends e23 {
  1431. initializeProgram(r18) {
  1432. return new o21(r18.rctx, l5.shader.get().build(), E3);
  1433. }
  1434. initializePipeline() {
  1435. return W({ colorWrite: _2 });
  1436. }
  1437. };
  1438. l5.shader = new t11(u4, () => import("./SSAOBlur.glsl-RGDK4Z25.js"));
  1439. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/SSAOTechnique.js
  1440. var l6 = class extends e23 {
  1441. initializeProgram(e28) {
  1442. return new o21(e28.rctx, l6.shader.get().build(), E3);
  1443. }
  1444. initializePipeline() {
  1445. return W({ colorWrite: _2 });
  1446. }
  1447. };
  1448. l6.shader = new t11(x, () => import("./SSAO.glsl-W2N6BVJ3.js"));
  1449. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/SSAOHelper.js
  1450. var w4 = 2;
  1451. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js
  1452. function n13(n18, a15) {
  1453. const i12 = n18.fragment;
  1454. a15.receiveAmbientOcclusion ? (i12.uniforms.add(u2("ssaoTex", (e28, r18) => r18.ssaoHelper.colorTexture, a15.hasWebGL2Context ? e11.None : e11.InvSize)), i12.constants.add("blurSizePixelsInverse", "float", 1 / w4), i12.code.add(n4`
  1455. float evaluateAmbientOcclusionInverse() {
  1456. vec2 ssaoTextureSizeInverse = ${r6(a15, "ssaoTex", true)};
  1457. return texture2D(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).a;
  1458. }
  1459. float evaluateAmbientOcclusion() {
  1460. return 1.0 - evaluateAmbientOcclusionInverse();
  1461. }
  1462. `)) : i12.code.add(n4`float evaluateAmbientOcclusionInverse() { return 1.0; }
  1463. float evaluateAmbientOcclusion() { return 0.0; }`);
  1464. }
  1465. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js
  1466. function o24(n18) {
  1467. n18.uniforms.add(new e12("mainLightDirection", (i12, n19) => n19.lighting.mainLight.direction));
  1468. }
  1469. function a13(n18) {
  1470. n18.uniforms.add(new e12("mainLightIntensity", (i12, n19) => n19.lighting.mainLight.intensity));
  1471. }
  1472. function e24(i12, t17) {
  1473. t17.useLegacyTerrainShading ? i12.uniforms.add(new o4("lightingFixedFactor", (i13, n18) => n18.lighting.noonFactor * (1 - n18.lighting.globalFactor))) : i12.constants.add("lightingFixedFactor", "float", 0);
  1474. }
  1475. function r14(i12, n18) {
  1476. const r18 = i12.fragment;
  1477. o24(r18), a13(r18), e24(r18, n18), r18.code.add(n4`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
  1478. float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
  1479. dotVal = mix(dotVal, 1.0, lightingFixedFactor);
  1480. return mainLightIntensity * ((1.0 - shadowing) * dotVal);
  1481. }`);
  1482. }
  1483. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js
  1484. function t14(t17) {
  1485. const a15 = t17.fragment.code;
  1486. a15.add(n4`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
  1487. {
  1488. return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
  1489. }`), a15.add(n4`float integratedRadiance(float cosTheta2, float roughness)
  1490. {
  1491. return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
  1492. }`), a15.add(n4`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
  1493. {
  1494. float cosTheta2 = 1.0 - RdotNG * RdotNG;
  1495. float intRadTheta = integratedRadiance(cosTheta2, roughness);
  1496. float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
  1497. float sky = 2.0 - ground;
  1498. return (ground * ambientGround + sky * ambientSky) * 0.5;
  1499. }`);
  1500. }
  1501. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js
  1502. function t15(t17) {
  1503. t17.vertex.code.add(n4`const float PI = 3.141592653589793;`), t17.fragment.code.add(n4`const float PI = 3.141592653589793;
  1504. const float LIGHT_NORMALIZATION = 1.0 / PI;
  1505. const float INV_PI = 0.3183098861837907;
  1506. const float HALF_PI = 1.570796326794897;`);
  1507. }
  1508. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js
  1509. function n14(n18, r18) {
  1510. const l8 = n18.fragment.code;
  1511. n18.include(t15), r18.pbrMode === d3.Water || r18.pbrMode === d3.WaterOnIntegratedMesh ? (l8.add(n4`
  1512. struct PBRShadingWater
  1513. {
  1514. float NdotL; // cos angle between normal and light direction
  1515. float NdotV; // cos angle between normal and view direction
  1516. float NdotH; // cos angle between normal and half vector
  1517. float VdotH; // cos angle between view direction and half vector
  1518. float LdotH; // cos angle between light direction and half vector
  1519. float VdotN; // cos angle between view direction and normal vector
  1520. };
  1521. float dtrExponent = ${r18.useCustomDTRExponentForWater ? "2.2" : "2.0"};
  1522. `), l8.add(n4`vec3 fresnelReflection(float angle, vec3 f0, float f90) {
  1523. return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);
  1524. }`), l8.add(n4`float normalDistributionWater(float NdotH, float roughness)
  1525. {
  1526. float r2 = roughness * roughness;
  1527. float NdotH2 = NdotH * NdotH;
  1528. float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;
  1529. return r2 / denom;
  1530. }`), l8.add(n4`float geometricOcclusionKelemen(float LoH)
  1531. {
  1532. return 0.25 / (LoH * LoH);
  1533. }`), l8.add(n4`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)
  1534. {
  1535. vec3 F = fresnelReflection(props.VdotH, F0, F0Max);
  1536. float dSun = normalDistributionWater(props.NdotH, roughness);
  1537. float V = geometricOcclusionKelemen(props.LdotH);
  1538. float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);
  1539. float strengthSunHaze = 1.2;
  1540. float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;
  1541. return ((dSun + dSunHaze) * V) * F;
  1542. }
  1543. vec3 tonemapACES(const vec3 x) {
  1544. return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
  1545. }`)) : r18.pbrMode !== d3.Normal && r18.pbrMode !== d3.Schematic || (n18.include(t14), l8.add(n4`struct PBRShadingInfo
  1546. {
  1547. float NdotL;
  1548. float NdotV;
  1549. float NdotH;
  1550. float VdotH;
  1551. float LdotH;
  1552. float NdotNG;
  1553. float RdotNG;
  1554. float NdotAmbDir;
  1555. float NdotH_Horizon;
  1556. vec3 skyRadianceToSurface;
  1557. vec3 groundRadianceToSurface;
  1558. vec3 skyIrradianceToSurface;
  1559. vec3 groundIrradianceToSurface;
  1560. float averageAmbientRadiance;
  1561. float ssao;
  1562. vec3 albedoLinear;
  1563. vec3 f0;
  1564. vec3 f90;
  1565. vec3 diffuseColor;
  1566. float metalness;
  1567. float roughness;
  1568. };`), l8.add(n4`float normalDistribution(float NdotH, float roughness)
  1569. {
  1570. float a = NdotH * roughness;
  1571. float b = roughness / (1.0 - NdotH * NdotH + a * a);
  1572. return b * b * INV_PI;
  1573. }`), l8.add(n4`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
  1574. const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
  1575. const vec2 c2 = vec2(-1.04, 1.04);
  1576. vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
  1577. vec4 r = roughness * c0 + c1;
  1578. float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
  1579. return c2 * a004 + r.zw;
  1580. }`), l8.add(n4`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
  1581. vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
  1582. vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
  1583. vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
  1584. vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
  1585. vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
  1586. vec3 specularComponent = specularColor * indirectSpecular;
  1587. return (diffuseComponent + specularComponent);
  1588. }`), l8.add(n4`float gamutMapChanel(float x, vec2 p){
  1589. return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
  1590. }`), l8.add(n4`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
  1591. vec3 outColor;
  1592. vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
  1593. outColor.x = gamutMapChanel(inColor.x, p) ;
  1594. outColor.y = gamutMapChanel(inColor.y, p) ;
  1595. outColor.z = gamutMapChanel(inColor.z, p) ;
  1596. return outColor;
  1597. }`));
  1598. }
  1599. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js
  1600. function m4(n18, g6) {
  1601. const m5 = n18.fragment, o26 = void 0 !== g6.lightingSphericalHarmonicsOrder ? g6.lightingSphericalHarmonicsOrder : 2;
  1602. 0 === o26 ? (m5.uniforms.add(new e12("lightingAmbientSH0", (n19, t17) => o(a14, t17.lighting.sh.r[0], t17.lighting.sh.g[0], t17.lighting.sh.b[0]))), m5.code.add(n4`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
  1603. vec3 ambientLight = 0.282095 * lightingAmbientSH0;
  1604. return ambientLight * (1.0 - ambientOcclusion);
  1605. }`)) : 1 === o26 ? (m5.uniforms.add([new e9("lightingAmbientSH_R", (i12, n19) => r2(r15, n19.lighting.sh.r[0], n19.lighting.sh.r[1], n19.lighting.sh.r[2], n19.lighting.sh.r[3])), new e9("lightingAmbientSH_G", (i12, n19) => r2(r15, n19.lighting.sh.g[0], n19.lighting.sh.g[1], n19.lighting.sh.g[2], n19.lighting.sh.g[3])), new e9("lightingAmbientSH_B", (i12, n19) => r2(r15, n19.lighting.sh.b[0], n19.lighting.sh.b[1], n19.lighting.sh.b[2], n19.lighting.sh.b[3]))]), m5.code.add(n4`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
  1606. vec4 sh0 = vec4(
  1607. 0.282095,
  1608. 0.488603 * normal.x,
  1609. 0.488603 * normal.z,
  1610. 0.488603 * normal.y
  1611. );
  1612. vec3 ambientLight = vec3(
  1613. dot(lightingAmbientSH_R, sh0),
  1614. dot(lightingAmbientSH_G, sh0),
  1615. dot(lightingAmbientSH_B, sh0)
  1616. );
  1617. return ambientLight * (1.0 - ambientOcclusion);
  1618. }`)) : 2 === o26 && (m5.uniforms.add([new e12("lightingAmbientSH0", (n19, t17) => o(a14, t17.lighting.sh.r[0], t17.lighting.sh.g[0], t17.lighting.sh.b[0])), new e9("lightingAmbientSH_R1", (i12, n19) => r2(r15, n19.lighting.sh.r[1], n19.lighting.sh.r[2], n19.lighting.sh.r[3], n19.lighting.sh.r[4])), new e9("lightingAmbientSH_G1", (i12, n19) => r2(r15, n19.lighting.sh.g[1], n19.lighting.sh.g[2], n19.lighting.sh.g[3], n19.lighting.sh.g[4])), new e9("lightingAmbientSH_B1", (i12, n19) => r2(r15, n19.lighting.sh.b[1], n19.lighting.sh.b[2], n19.lighting.sh.b[3], n19.lighting.sh.b[4])), new e9("lightingAmbientSH_R2", (i12, n19) => r2(r15, n19.lighting.sh.r[5], n19.lighting.sh.r[6], n19.lighting.sh.r[7], n19.lighting.sh.r[8])), new e9("lightingAmbientSH_G2", (i12, n19) => r2(r15, n19.lighting.sh.g[5], n19.lighting.sh.g[6], n19.lighting.sh.g[7], n19.lighting.sh.g[8])), new e9("lightingAmbientSH_B2", (i12, n19) => r2(r15, n19.lighting.sh.b[5], n19.lighting.sh.b[6], n19.lighting.sh.b[7], n19.lighting.sh.b[8]))]), m5.code.add(n4`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
  1619. vec3 ambientLight = 0.282095 * lightingAmbientSH0;
  1620. vec4 sh1 = vec4(
  1621. 0.488603 * normal.x,
  1622. 0.488603 * normal.z,
  1623. 0.488603 * normal.y,
  1624. 1.092548 * normal.x * normal.y
  1625. );
  1626. vec4 sh2 = vec4(
  1627. 1.092548 * normal.y * normal.z,
  1628. 0.315392 * (3.0 * normal.z * normal.z - 1.0),
  1629. 1.092548 * normal.x * normal.z,
  1630. 0.546274 * (normal.x * normal.x - normal.y * normal.y)
  1631. );
  1632. ambientLight += vec3(
  1633. dot(lightingAmbientSH_R1, sh1),
  1634. dot(lightingAmbientSH_G1, sh1),
  1635. dot(lightingAmbientSH_B1, sh1)
  1636. );
  1637. ambientLight += vec3(
  1638. dot(lightingAmbientSH_R2, sh2),
  1639. dot(lightingAmbientSH_G2, sh2),
  1640. dot(lightingAmbientSH_B2, sh2)
  1641. );
  1642. return ambientLight * (1.0 - ambientOcclusion);
  1643. }`), g6.pbrMode !== d3.Normal && g6.pbrMode !== d3.Schematic || m5.code.add(n4`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
  1644. vec3 calculateAmbientRadiance(float ambientOcclusion)
  1645. {
  1646. vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
  1647. return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
  1648. }`));
  1649. }
  1650. var a14 = n();
  1651. var r15 = n2();
  1652. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js
  1653. var s4 = class extends i {
  1654. constructor(o26, s5) {
  1655. super(o26, "bool", a6.Pass, (r18, e28, t17) => r18.setUniform1b(o26, s5(e28, t17)));
  1656. }
  1657. };
  1658. // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SphericalHarmonics.js
  1659. var P3 = n();
  1660. // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SceneLighting.js
  1661. var _3 = 0.4;
  1662. var p2 = n();
  1663. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js
  1664. function h8(i12) {
  1665. i12.constants.add("ambientBoostFactor", "float", _3);
  1666. }
  1667. function u9(i12) {
  1668. i12.uniforms.add(new o4("lightingGlobalFactor", (i13, n18) => n18.lighting.globalFactor));
  1669. }
  1670. function p3(g6, p4) {
  1671. const v6 = g6.fragment;
  1672. switch (g6.include(n13, p4), p4.pbrMode !== d3.Disabled && g6.include(n14, p4), g6.include(m4, p4), g6.include(t15), v6.code.add(n4`
  1673. const float GAMMA_SRGB = 2.1;
  1674. const float INV_GAMMA_SRGB = 0.4761904;
  1675. ${p4.pbrMode === d3.Disabled ? "" : "const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
  1676. `), h8(v6), u9(v6), o24(v6), v6.code.add(n4`
  1677. float additionalDirectedAmbientLight(vec3 vPosWorld) {
  1678. float vndl = dot(${p4.spherical ? n4`normalize(vPosWorld)` : n4`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
  1679. return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
  1680. }
  1681. `), a13(v6), v6.code.add(n4`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
  1682. float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
  1683. return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
  1684. }`), p4.pbrMode) {
  1685. case d3.Disabled:
  1686. case d3.WaterOnIntegratedMesh:
  1687. case d3.Water:
  1688. g6.include(r14, p4), v6.code.add(n4`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
  1689. {
  1690. vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
  1691. vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
  1692. vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
  1693. vec3 totalLight = mainLighting + ambientLighting + additionalLight;
  1694. totalLight = min(totalLight, vec3(PI));
  1695. vec3 outColor = vec3((albedoLinear / PI) * totalLight);
  1696. return pow(outColor, vec3(INV_GAMMA_SRGB));
  1697. }`);
  1698. break;
  1699. case d3.Normal:
  1700. case d3.Schematic:
  1701. v6.code.add(n4`const float fillLightIntensity = 0.25;
  1702. const float horizonLightDiffusion = 0.4;
  1703. const float additionalAmbientIrradianceFactor = 0.02;
  1704. vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
  1705. {
  1706. vec3 viewDirection = -viewDir;
  1707. vec3 mainLightDirection = mainLightDirection;
  1708. vec3 h = normalize(viewDirection + mainLightDirection);
  1709. PBRShadingInfo inputs;
  1710. inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
  1711. inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
  1712. inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
  1713. inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
  1714. inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
  1715. vec3 reflectedView = normalize(reflect(viewDirection, normal));
  1716. inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
  1717. inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
  1718. inputs.ssao = ssao;
  1719. inputs.metalness = mrr[0];
  1720. inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`), v6.code.add(n4`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
  1721. inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
  1722. inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`), p4.useFillLights ? v6.uniforms.add(new s4("hasFillLights", (i12, n18) => n18.enableFillLights)) : v6.constants.add("hasFillLights", "bool", false), v6.code.add(n4`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
  1723. ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
  1724. inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
  1725. vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
  1726. vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
  1727. vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
  1728. inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
  1729. inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`), v6.uniforms.add([new o4("lightingSpecularStrength", (i12, n18) => n18.lighting.mainLight.specularStrength), new o4("lightingEnvironmentStrength", (i12, n18) => n18.lighting.mainLight.environmentStrength)]), v6.code.add(n4`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
  1730. vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
  1731. inputs.NdotH_Horizon = dot(normal, horizonRingH);
  1732. vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
  1733. vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
  1734. vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
  1735. inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
  1736. inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
  1737. inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`), v6.code.add(n4`
  1738. vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
  1739. vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
  1740. vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
  1741. vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
  1742. ${p4.pbrMode === d3.Schematic ? n4`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));` : n4`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
  1743. return outColor;
  1744. }
  1745. `);
  1746. break;
  1747. default:
  1748. n3(p4.pbrMode);
  1749. case d3.COUNT:
  1750. }
  1751. }
  1752. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js
  1753. function n17(n18, o26) {
  1754. o26.hasMultipassTerrain && (n18.fragment.include(a9), n18.fragment.uniforms.add(new f2("terrainDepthTexture", (e28, r18) => r18.multipassTerrain.linearDepthTexture)), n18.fragment.uniforms.add(new e10("nearFar", (e28, r18) => r18.camera.nearFar)), n18.fragment.uniforms.add(new e10("inverseViewport", (e28, r18) => r18.inverseViewport)), n18.fragment.code.add(n4`
  1755. void terrainDepthTest(vec4 fragCoord, float fragmentDepth){
  1756. float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar);
  1757. if(fragmentDepth ${o26.cullAboveGround ? ">" : "<="} terrainDepth){
  1758. discard;
  1759. }
  1760. }
  1761. `));
  1762. }
  1763. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js
  1764. var o25 = class extends i {
  1765. constructor(r18, o26, s5) {
  1766. super(r18, "mat4", a6.Draw, (e28, s6, t17) => e28.setUniformMatrix4fv(r18, o26(s6, t17)), s5);
  1767. }
  1768. };
  1769. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js
  1770. var e26 = class extends i {
  1771. constructor(r18, e28, o26) {
  1772. super(r18, "mat4", a6.Pass, (s5, o27, t17) => s5.setUniformMatrix4fv(r18, e28(o27, t17)), o26);
  1773. }
  1774. };
  1775. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js
  1776. function h9(e28, a15) {
  1777. a15.receiveShadows && (e28.fragment.uniforms.add(new e26("shadowMapMatrix", (e29, a16) => a16.shadowMap.getShadowMapMatrices(e29.origin), 4)), f6(e28, a15));
  1778. }
  1779. function v5(e28, a15) {
  1780. a15.receiveShadows && (e28.fragment.uniforms.add(new o25("shadowMapMatrix", (e29, a16) => a16.shadowMap.getShadowMapMatrices(e29.origin), 4)), f6(e28, a15));
  1781. }
  1782. function f6(e28, i12) {
  1783. const d9 = e28.fragment;
  1784. d9.include(a8), d9.uniforms.add([...u2("shadowMapTex", (e29, a15) => a15.shadowMap.depthTexture, i12.hasWebGL2Context ? e11.None : e11.Size), new e18("numCascades", (e29, a15) => a15.shadowMap.numCascades), new e9("cascadeDistances", (e29, a15) => a15.shadowMap.cascadeDistances)]), d9.code.add(n4`
  1785. int chooseCascade(float depth, out mat4 mat) {
  1786. vec4 distance = cascadeDistances;
  1787. // choose correct cascade
  1788. int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
  1789. mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
  1790. return i;
  1791. }
  1792. vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
  1793. vec4 lv = mat * vec4(_vpos, 1.0);
  1794. lv.xy /= lv.w;
  1795. return 0.5 * lv.xyz + vec3(0.5);
  1796. }
  1797. vec2 cascadeCoordinates(int i, vec3 lvpos) {
  1798. return vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;
  1799. }
  1800. float readShadowMapDepth(vec2 uv, sampler2D _depthTex) {
  1801. return rgba2float(texture2D(_depthTex, uv));
  1802. }
  1803. float posIsInShadow(vec2 uv, vec3 lvpos, sampler2D _depthTex) {
  1804. return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
  1805. }
  1806. float filterShadow(vec2 uv, vec3 lvpos, float textureSize, sampler2D _depthTex) {
  1807. float halfPixelSize = 0.5 / textureSize;
  1808. // filter, offset by half pixels
  1809. vec2 st = fract((vec2(halfPixelSize) + uv) * textureSize);
  1810. float s00 = posIsInShadow(uv + vec2(-halfPixelSize, -halfPixelSize), lvpos, _depthTex);
  1811. float s10 = posIsInShadow(uv + vec2(halfPixelSize, -halfPixelSize), lvpos, _depthTex);
  1812. float s11 = posIsInShadow(uv + vec2(halfPixelSize, halfPixelSize), lvpos, _depthTex);
  1813. float s01 = posIsInShadow(uv + vec2(-halfPixelSize, halfPixelSize), lvpos, _depthTex);
  1814. return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
  1815. }
  1816. float readShadowMap(const in vec3 _vpos, float _linearDepth) {
  1817. mat4 mat;
  1818. int i = chooseCascade(_linearDepth, mat);
  1819. if (i >= numCascades) { return 0.0; }
  1820. vec3 lvpos = lightSpacePosition(_vpos, mat);
  1821. // vertex completely outside? -> no shadow
  1822. if (lvpos.z >= 1.0) { return 0.0; }
  1823. if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
  1824. // calc coord in cascade texture
  1825. vec2 uv = cascadeCoordinates(i, lvpos);
  1826. vec2 textureSize = ${r6(i12, "shadowMapTex")};
  1827. return filterShadow(uv, lvpos, textureSize.x, shadowMapTex);
  1828. }
  1829. `);
  1830. }
  1831. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js
  1832. function e27(e28) {
  1833. e28.code.add(n4`vec4 premultiplyAlpha(vec4 v) {
  1834. return vec4(v.rgb * v.a, v.a);
  1835. }
  1836. vec3 rgb2hsv(vec3 c) {
  1837. vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
  1838. vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
  1839. vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
  1840. float d = q.x - min(q.w, q.y);
  1841. float e = 1.0e-10;
  1842. return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
  1843. }
  1844. vec3 hsv2rgb(vec3 c) {
  1845. vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
  1846. vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
  1847. return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
  1848. }
  1849. float rgb2v(vec3 c) {
  1850. return max(c.x, max(c.y, c.z));
  1851. }`);
  1852. }
  1853. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js
  1854. function i11(i12) {
  1855. i12.include(e27), i12.code.add(n4`
  1856. vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
  1857. // workaround for artifacts in OSX using Intel Iris Pro
  1858. // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
  1859. vec3 internalMixed = internalColor * textureColor;
  1860. vec3 allMixed = internalMixed * externalColor;
  1861. if (mode == ${n4.int(r5.Multiply)}) {
  1862. return allMixed;
  1863. }
  1864. if (mode == ${n4.int(r5.Ignore)}) {
  1865. return internalMixed;
  1866. }
  1867. if (mode == ${n4.int(r5.Replace)}) {
  1868. return externalColor;
  1869. }
  1870. // tint (or something invalid)
  1871. float vIn = rgb2v(internalMixed);
  1872. vec3 hsvTint = rgb2hsv(externalColor);
  1873. vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
  1874. return hsv2rgb(hsvOut);
  1875. }
  1876. float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
  1877. // workaround for artifacts in OSX using Intel Iris Pro
  1878. // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
  1879. float internalMixed = internalOpacity * textureOpacity;
  1880. float allMixed = internalMixed * externalOpacity;
  1881. if (mode == ${n4.int(r5.Ignore)}) {
  1882. return internalMixed;
  1883. }
  1884. if (mode == ${n4.int(r5.Replace)}) {
  1885. return externalOpacity;
  1886. }
  1887. // multiply or tint (or something invalid)
  1888. return allMixed;
  1889. }
  1890. `);
  1891. }
  1892. export {
  1893. r9 as r,
  1894. e21 as e,
  1895. E3 as E,
  1896. u8 as u,
  1897. h2 as h,
  1898. o6 as o,
  1899. i3 as i,
  1900. d2 as d,
  1901. o7 as o2,
  1902. a10 as a,
  1903. e12 as e2,
  1904. h3 as h2,
  1905. d3 as d2,
  1906. x2 as x,
  1907. x4 as x2,
  1908. L2 as L,
  1909. d6 as d3,
  1910. o18 as o3,
  1911. o10 as o4,
  1912. i4 as i2,
  1913. e14 as e3,
  1914. e13 as e4,
  1915. n6 as n,
  1916. f3 as f,
  1917. o12 as o5,
  1918. t6 as t,
  1919. t11 as t2,
  1920. e23 as e5,
  1921. o21 as o6,
  1922. d4,
  1923. e15 as e6,
  1924. u5 as u2,
  1925. r8 as r2,
  1926. c5 as c,
  1927. v2 as v,
  1928. t8 as t3,
  1929. e16 as e7,
  1930. p,
  1931. i6 as i3,
  1932. e19 as e8,
  1933. a11 as a2,
  1934. s2 as s,
  1935. s3 as s2,
  1936. b5 as b,
  1937. n13 as n2,
  1938. o24 as o7,
  1939. a13 as a3,
  1940. n14 as n3,
  1941. h8 as h3,
  1942. u9 as u3,
  1943. p3 as p2,
  1944. n17 as n4,
  1945. h9 as h4,
  1946. v5 as v2,
  1947. i11 as i4
  1948. };
  1949. //# sourceMappingURL=chunk-5242SYQJ.js.map