1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062 |
- import {
- C as C3,
- O as O3,
- W,
- _ as _2,
- a as a5,
- o as o3,
- r as r7
- } from "./chunk-LDMWL65U.js";
- import {
- E as E2,
- a as a7
- } from "./chunk-WBWQJQK4.js";
- import {
- u as u3,
- u2 as u4
- } from "./chunk-2UEXES4O.js";
- import {
- e as e9,
- x
- } from "./chunk-UUVY36LI.js";
- import {
- a as a6,
- a2 as a8,
- a3 as a9,
- e as e10,
- e2 as e11,
- f as f2,
- i,
- i2,
- n as n4,
- o3 as o4,
- r as r6,
- t as t3,
- u as u2
- } from "./chunk-FQZKJNXZ.js";
- import {
- r as r5
- } from "./chunk-L5R6EFI6.js";
- import {
- r as r4
- } from "./chunk-A22ACVMF.js";
- import {
- e as e8
- } from "./chunk-QHWZYJGI.js";
- import {
- a as a4
- } from "./chunk-H2VOWDMO.js";
- import {
- O as O2
- } from "./chunk-RUM3DXFX.js";
- import {
- t as t2
- } from "./chunk-4OM3EX6P.js";
- import {
- C as C2,
- E,
- F
- } from "./chunk-3OFVLRSL.js";
- import {
- e as e7,
- o as o2
- } from "./chunk-44FMXGSC.js";
- import {
- e as e6
- } from "./chunk-GHN7C53L.js";
- import {
- a as a3,
- d,
- q
- } from "./chunk-ECY35CJI.js";
- import {
- n as n2,
- r as r3
- } from "./chunk-C7742RNZ.js";
- import {
- e as e5
- } from "./chunk-FZQZIM7U.js";
- import {
- c as c2
- } from "./chunk-VGWC3IKZ.js";
- import {
- n as n3
- } from "./chunk-O6VYMEIX.js";
- import {
- a as a2,
- h,
- m
- } from "./chunk-RYY6632W.js";
- import {
- O,
- _,
- e as e4,
- o,
- u,
- z
- } from "./chunk-DW42UVIT.js";
- import {
- r as r2
- } from "./chunk-YAEIHDJH.js";
- import {
- f,
- n
- } from "./chunk-TJNOJH33.js";
- import {
- e,
- e4 as e3,
- l
- } from "./chunk-2Z2TG5CU.js";
- import {
- C
- } from "./chunk-V6P2MAQQ.js";
- import {
- has
- } from "./chunk-SPWQ3AWG.js";
- import {
- c
- } from "./chunk-2TIUKVZN.js";
- import {
- a,
- e as e2,
- r,
- t,
- w
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js
- var h2;
- !function(h10) {
- 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";
- }(h2 || (h2 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js
- function o5(o26) {
- const f7 = n4`vec3 decodeNormal(vec2 f) {
- float z = 1.0 - abs(f.x) - abs(f.y);
- return vec3(f + sign(f) * min(z, 0.0), z);
- }`;
- o26.vertex.code.add(f7);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js
- function o6(o26, d9) {
- d9.normalType === i3.Attribute && (o26.attributes.add(O2.NORMAL, "vec3"), o26.vertex.code.add(n4`vec3 normalModel() {
- return normal;
- }`)), d9.normalType === i3.CompressedAttribute && (o26.include(o5), o26.attributes.add(O2.NORMALCOMPRESSED, "vec2"), o26.vertex.code.add(n4`vec3 normalModel() {
- return decodeNormal(normalCompressed);
- }`)), d9.normalType === i3.ScreenDerivative && (o26.extensions.add("GL_OES_standard_derivatives"), o26.fragment.code.add(n4`vec3 screenDerivativeNormal(vec3 positionView) {
- return normalize(cross(dFdx(positionView), dFdy(positionView)));
- }`));
- }
- var i3;
- !function(e28) {
- 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";
- }(i3 || (i3 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js
- var d2;
- function o7(o26, v6) {
- switch (v6.textureCoordinateType) {
- case d2.Default:
- return o26.attributes.add(O2.UV0, "vec2"), o26.varyings.add("vuv0", "vec2"), void o26.vertex.code.add(n4`void forwardTextureCoordinates() {
- vuv0 = uv0;
- }`);
- case d2.Compressed:
- return o26.attributes.add(O2.UV0, "vec2"), o26.varyings.add("vuv0", "vec2"), void o26.vertex.code.add(n4`vec2 getUV0() {
- return uv0 / 16384.0;
- }
- void forwardTextureCoordinates() {
- vuv0 = getUV0();
- }`);
- case d2.Atlas:
- 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() {
- vuv0 = uv0;
- vuvRegion = uvRegion;
- }`);
- default:
- n3(v6.textureCoordinateType);
- case d2.None:
- return void o26.vertex.code.add(n4`void forwardTextureCoordinates() {}`);
- case d2.COUNT:
- return;
- }
- }
- !function(e28) {
- 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";
- }(d2 || (d2 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js
- var e12 = class extends i {
- constructor(r18, e28) {
- super(r18, "vec3", a6.Pass, (s5, o26, t17) => s5.setUniform3fv(r18, e28(o26, t17)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl.js
- function t4(t17) {
- 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
- float calcMipMapLevel(const vec2 ddx, const vec2 ddy) {
- float deltaMaxSqr = max(dot(ddx, ddx), dot(ddy, ddy));
- return max(0.0, 0.5 * log2(deltaMaxSqr));
- }
- #endif
- vec4 textureAtlasLookup(sampler2D texture, vec2 textureSize, vec2 textureCoordinates, vec4 atlasRegion) {
- vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
- vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
- float maxdUV = 0.125;
- vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
- vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
- #ifdef GL_EXT_shader_texture_lod
- return texture2DGradEXT(texture, uvAtlas, dUVdx, dUVdy);
- #else
- vec2 dUVdxAuto = dFdx(uvAtlas);
- vec2 dUVdyAuto = dFdy(uvAtlas);
- float mipMapLevel = calcMipMapLevel(dUVdx * textureSize, dUVdy * textureSize);
- float autoMipMapLevel = calcMipMapLevel(dUVdxAuto * textureSize, dUVdyAuto * textureSize);
- return texture2D(texture, uvAtlas, mipMapLevel - autoMipMapLevel);
- #endif
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js
- function a10(a15, s5) {
- switch (a15.include(o7, s5), a15.fragment.code.add(n4`
- struct TextureLookupParameter {
- vec2 uv;
- ${s5.supportsTextureAtlas ? "vec2 size;" : ""}
- } vtc;
- `), s5.textureCoordinateType) {
- case d2.Default:
- case d2.Compressed:
- return void a15.fragment.code.add(n4`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
- return texture2D(texture, params.uv);
- }`);
- case d2.Atlas:
- return a15.include(t4), void a15.fragment.code.add(n4`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
- return textureAtlasLookup(texture, params.size, params.uv, vuvRegion);
- }`);
- default:
- n3(s5.textureCoordinateType);
- case d2.None:
- case d2.COUNT:
- return;
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js
- var o8 = class extends i {
- constructor(r18, o26) {
- super(r18, "vec3", a6.Draw, (e28, s5, t17, i12) => e28.setUniform3fv(r18, o26(s5, t17, i12)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLMaterial.js
- var t5 = class {
- constructor(e28) {
- this._material = e28.material, this._techniqueRepository = e28.techniqueRep, this._output = e28.output;
- }
- dispose() {
- this._techniqueRepository.release(this._technique);
- }
- get technique() {
- return this._technique;
- }
- get _stippleTextureRepository() {
- return this._techniqueRepository.constructionContext.stippleTextureRepository;
- }
- ensureTechnique(e28, t17, i12 = this._output) {
- return this._technique = this._techniqueRepository.releaseAndAcquire(e28, this._material.getConfiguration(i12, t17), this._technique), this._technique;
- }
- ensureResources(t17) {
- return O3.LOADED;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLTextureMaterial.js
- var h3 = class extends t5 {
- constructor(t17) {
- 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);
- }
- dispose() {
- 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;
- }
- ensureResources(t17) {
- return 0 === this._numLoading ? O3.LOADED : O3.LOADING;
- }
- get textureBindParameters() {
- 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);
- }
- updateTexture(e28) {
- (t(this._texture) || e28 !== this._texture.id) && (this._texture = w(this._texture), this._textureId = e28, this._acquire(this._textureId, (t17) => this._texture = t17));
- }
- _acquire(e28, r18) {
- if (t(e28))
- return void r18(null);
- const u10 = this._textureRepository.acquire(e28);
- if (C(u10))
- return ++this._numLoading, void u10.then((e29) => {
- if (this._disposed)
- return w(e29), void r18(null);
- r18(e29);
- }).finally(() => --this._numLoading);
- r18(u10);
- }
- };
- var o9 = class extends t3 {
- constructor(t17 = null, e28 = null, s5 = null, i12 = null, r18 = null) {
- super(), this.texture = t17, this.textureNormal = e28, this.textureEmissive = s5, this.textureOcclusion = i12, this.textureMetallicRoughness = r18;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
- var m2 = r4(0, 0.6, 0.2);
- var d3;
- !function(e28) {
- 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";
- }(d3 || (d3 = {}));
- function x2(e28, l8) {
- const m5 = e28.fragment, p4 = l8.hasMetallicRoughnessTexture || l8.hasEmissionTexture || l8.hasOcclusionTexture;
- if (l8.pbrMode === d3.Normal && p4 && e28.include(a10, l8), l8.pbrMode !== d3.Schematic)
- if (l8.pbrMode !== d3.Disabled) {
- if (l8.pbrMode === d3.Normal) {
- m5.code.add(n4`vec3 mrr;
- vec3 emission;
- float occlusion;`);
- const e29 = l8.supportsTextureAtlas ? l8.hasWebGL2Context ? e11.None : e11.Size : e11.None, s5 = l8.pbrTextureBindType;
- 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) {
- vec3 metallicRoughness = textureLookup(texMetallicRoughness, params).rgb;
- mrr[0] *= metallicRoughness.b;
- mrr[1] *= metallicRoughness.g;
- }`)), 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) {
- emission *= textureLookup(texEmission, params).rgb;
- }`)), 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) {
- occlusion *= textureLookup(texOcclusion, params).r;
- }
- float getBakedOcclusion() {
- return occlusion;
- }`)) : 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`
- void applyPBRFactors() {
- mrr = mrrFactors;
- emission = emissionFactor;
- occlusion = 1.0;
- ${p4 ? n4`vtc.uv = vuv0;` : ""}
- ${l8.hasMetallicRoughnessTextureTransform ? n4`vtc.uv = metallicRoughnessUV;` : ""}
- ${l8.hasMetallicRoughnessTexture ? l8.supportsTextureAtlas ? n4`
- vtc.size = ${r6(l8, "texMetallicRoughness")};
- applyMetallnessAndRoughness(vtc);` : n4`applyMetallnessAndRoughness(vtc);` : ""}
- ${l8.hasEmissiveTextureTransform ? n4`vtc.uv = emissiveUV;` : ""}
- ${l8.hasEmissionTexture ? l8.supportsTextureAtlas ? n4`
- vtc.size = ${r6(l8, "texEmission")};
- applyEmission(vtc);` : n4`applyEmission(vtc);` : ""}
- ${l8.hasOcclusionTextureTransform ? n4`vtc.uv = occlusionUV;` : ""}
- ${l8.hasOcclusionTexture ? l8.supportsTextureAtlas ? n4`
- vtc.size = ${r6(l8, "texOcclusion")};
- applyOcclusion(vtc);` : n4`applyOcclusion(vtc);` : ""}
- }
- `);
- }
- } else
- m5.code.add(n4`float getBakedOcclusion() { return 1.0; }`);
- else
- m5.code.add(n4`vec3 mrr = vec3(0.0, 0.6, 0.2);
- vec3 emission = vec3(0.0);
- float occlusion = 1.0;
- void applyPBRFactors() {}
- float getBakedOcclusion() { return 1.0; }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js
- function o10(o26) {
- o26.attributes.add(O2.POSITION, "vec3"), o26.vertex.code.add(n4`vec3 positionModel() { return position; }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js
- var e13 = class extends i {
- constructor(r18, e28) {
- super(r18, "mat4", a6.Pass, (s5, o26, t17) => s5.setUniformMatrix4fv(r18, e28(o26, t17)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl.js
- function c3({ code: c9 }, i12) {
- i12.doublePrecisionRequiresObfuscation ? c9.add(n4`vec3 dpPlusFrc(vec3 a, vec3 b) {
- return mix(a, a + b, vec3(notEqual(b, vec3(0))));
- }
- vec3 dpMinusFrc(vec3 a, vec3 b) {
- return mix(vec3(0), a - b, vec3(notEqual(a, b)));
- }
- vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
- vec3 t1 = dpPlusFrc(hiA, hiB);
- vec3 e = dpMinusFrc(t1, hiA);
- vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
- return t1 + t2;
- }`) : c9.add(n4`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
- vec3 t1 = hiA + hiB;
- vec3 e = t1 - hiA;
- vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
- return t1 + t2;
- }`);
- }
- function i4(e28) {
- return !!has("force-double-precision-obfuscation") || e28.driverTest.doublePrecisionRequiresObfuscation;
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js
- var o11 = class extends i {
- constructor(r18, o26) {
- super(r18, "mat3", a6.Draw, (e28, s5, t17) => e28.setUniformMatrix3fv(r18, o26(s5, t17)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js
- var e14 = class extends i {
- constructor(r18, e28) {
- super(r18, "mat3", a6.Pass, (s5, o26, t17) => s5.setUniformMatrix3fv(r18, e28(o26, t17)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js
- function F2(r18, o26) {
- r18.include(o10);
- const e28 = r18.vertex;
- 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() {
- vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
- vec3 transform_CameraRelativeFromModel = dpAdd(
- transformWorldFromModelTL,
- transformWorldFromModelTH,
- -transformWorldFromViewTL,
- -transformWorldFromViewTH
- );
- return transform_CameraRelativeFromModel + rotatedModelPosition;
- }`), e28.code.add(n4`
- void forwardPosition(float fOffset) {
- vPositionWorldCameraRelative = positionWorldCameraRelative();
- if (fOffset != 0.0) {
- vPositionWorldCameraRelative += fOffset * ${o26.spherical ? n4`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)` : n4`vec3(0.0, 0.0, 1.0)`};
- }
- vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
- gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
- }
- `), r18.fragment.uniforms.add(new e12("transformWorldFromViewTL", (r19) => r19.transformWorldFromViewTL)), e28.code.add(n4`vec3 positionWorld() {
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
- }`), r18.fragment.code.add(n4`vec3 positionWorld() {
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
- }`);
- }
- var c4 = class extends t3 {
- constructor() {
- super(...arguments), this.transformWorldFromViewTH = n(), this.transformWorldFromViewTL = n(), this.transformViewFromCameraRelativeRS = e6(), this.transformProjFromView = e7();
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js
- function n6(r18, o26) {
- 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() {
- vNormalWorld = transformNormalGlobalFromModel * normalModel();
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;
- }`)) : o26.normalType === i3.Ground ? (r18.include(F2, o26), r18.varyings.add("vNormalWorld", "vec3"), r18.vertex.code.add(n4`
- void forwardNormal() {
- vNormalWorld = ${o26.spherical ? n4`normalize(vPositionWorldCameraRelative);` : n4`vec3(0.0, 0.0, 1.0);`}
- }
- `)) : r18.vertex.code.add(n4`void forwardNormal() {}`);
- }
- var f3 = class extends c4 {
- constructor() {
- super(...arguments), this.transformNormalViewFromGlobal = e6();
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js
- var o12 = 0.1;
- var t6 = 1e-3;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js
- function t7(e28) {
- e28.varyings.add("linearDepth", "float");
- }
- function i5(e28) {
- e28.vertex.uniforms.add(new e10("nearFar", (e29, r18) => r18.camera.nearFar));
- }
- function n7(e28) {
- e28.vertex.code.add(n4`float calculateLinearDepth(vec2 nearFar,float z) {
- return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
- }`);
- }
- function d4(a15, d9) {
- const { vertex: s5 } = a15;
- switch (d9.output) {
- case h2.Color:
- if (d9.receiveShadows)
- return t7(a15), void s5.code.add(n4`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);
- break;
- case h2.Depth:
- case h2.Shadow:
- case h2.ShadowHighlight:
- case h2.ShadowExludeHighlight:
- return a15.include(F2, d9), t7(a15), i5(a15), n7(a15), void s5.code.add(n4`void forwardLinearDepth() {
- linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
- }`);
- }
- s5.code.add(n4`void forwardLinearDepth() {}`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js
- function e15(e28) {
- e28.vertex.code.add(n4`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
- vec3 camToVert = posWorld - camPosWorld;
- bool isBackface = dot(camToVert, normalWorld) > 0.0;
- if (isBackface) {
- posClip.z += 0.0000003 * posClip.w;
- }
- return posClip;
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js
- function u5(s5, i12) {
- H(s5, i12, [new o8("slicePlaneOrigin", (e28, s6) => b(i12, e28, s6)), new o8("slicePlaneBasis1", (s6, a15) => {
- var _a;
- return B(i12, s6, a15, (_a = e2(a15.slicePlane)) == null ? void 0 : _a.basis1);
- }), new o8("slicePlaneBasis2", (s6, a15) => {
- var _a;
- return B(i12, s6, a15, (_a = e2(a15.slicePlane)) == null ? void 0 : _a.basis2);
- })]);
- }
- function H(e28, s5, i12) {
- if (!s5.hasSlicePlane) {
- const i13 = n4`#define rejectBySlice(_pos_) false
- #define discardBySlice(_pos_) {}
- #define highlightSlice(_color_, _pos_) (_color_)`;
- return s5.hasSliceInVertexProgram && e28.vertex.code.add(i13), void e28.fragment.code.add(i13);
- }
- e28.extensions.add("GL_OES_standard_derivatives"), s5.hasSliceInVertexProgram && e28.vertex.uniforms.add(i12), e28.fragment.uniforms.add(i12);
- const a15 = n4`struct SliceFactors {
- float front;
- float side0;
- float side1;
- float side2;
- float side3;
- };
- SliceFactors calculateSliceFactors(vec3 pos) {
- vec3 rel = pos - slicePlaneOrigin;
- vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
- float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
- float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
- float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
- float basis1Dot = dot(slicePlaneBasis1, rel);
- float basis2Dot = dot(slicePlaneBasis2, rel);
- return SliceFactors(
- dot(slicePlaneNormal, pos) + slicePlaneW,
- -basis1Dot - basis1Len2,
- basis1Dot - basis1Len2,
- -basis2Dot - basis2Len2,
- basis2Dot - basis2Len2
- );
- }
- bool sliceByFactors(SliceFactors factors) {
- return factors.front < 0.0
- && factors.side0 < 0.0
- && factors.side1 < 0.0
- && factors.side2 < 0.0
- && factors.side3 < 0.0;
- }
- bool sliceEnabled() {
- return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
- }
- bool sliceByPlane(vec3 pos) {
- return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
- }
- #define rejectBySlice(_pos_) sliceByPlane(_pos_)
- #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`, o26 = n4`vec4 applySliceHighlight(vec4 color, vec3 pos) {
- SliceFactors factors = calculateSliceFactors(pos);
- const float HIGHLIGHT_WIDTH = 1.0;
- const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
- factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
- factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
- factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
- factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
- factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
- if (sliceByFactors(factors)) {
- return color;
- }
- float highlightFactor = (1.0 - step(0.5, factors.front))
- * (1.0 - step(0.5, factors.side0))
- * (1.0 - step(0.5, factors.side1))
- * (1.0 - step(0.5, factors.side2))
- * (1.0 - step(0.5, factors.side3));
- return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
- }`, c9 = s5.hasSliceHighlight ? n4`
- ${o26}
- #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
- ` : n4`#define highlightSlice(_color_, _pos_) (_color_)`;
- s5.hasSliceInVertexProgram && e28.vertex.code.add(a15), e28.fragment.code.add(a15), e28.fragment.code.add(c9);
- }
- function g(e28, s5, i12) {
- return e28.instancedDoublePrecision ? o(S, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]) : s5.slicePlaneLocalOrigin;
- }
- function I(e28, s5) {
- return r(e28) ? e4(L, s5.origin, e28) : s5.origin;
- }
- function v(e28, s5, o26) {
- return e28.hasSliceTranslatedView ? r(s5) ? c2(T, o26.camera.viewMatrix, s5) : o26.camera.viewMatrix : null;
- }
- function b(e28, a15, o26) {
- if (t(o26.slicePlane))
- return f;
- const r18 = g(e28, a15, o26), l8 = I(r18, o26.slicePlane), t17 = v(e28, r18, o26);
- return r(t17) ? O(L, l8, t17) : l8;
- }
- function B(e28, a15, o26, t17) {
- if (t(t17) || t(o26.slicePlane))
- return f;
- const f7 = g(e28, a15, o26), d9 = I(f7, o26.slicePlane), _4 = v(e28, f7, o26);
- return r(_4) ? (u(G, t17, d9), O(L, d9, _4), O(G, G, _4), e4(G, G, L)) : t17;
- }
- var S = n();
- var L = n();
- var G = n();
- var T = e7();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js
- function r8(r18, t17) {
- if (n7(r18), t17.hasModelTransformation)
- return r18.vertex.code.add(n4`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
- vec4 eye = view * (model * vec4(pos, 1.0));
- depth = calculateLinearDepth(nearFar, eye.z);
- return proj * eye;
- }`), void r18.vertex.code.add(n4`vec4 transformPosition(mat4 proj, mat4 view, mat4 model, vec3 pos) {
- return proj * (view * (model * vec4(pos, 1.0)));
- }`);
- r18.vertex.code.add(n4`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
- vec4 eye = view * vec4(pos, 1.0);
- depth = calculateLinearDepth(nearFar,eye.z);
- return proj * eye;
- }`), r18.vertex.code.add(n4`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
- return proj * (view * vec4(pos, 1.0));
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js
- var o13 = class extends i {
- constructor(r18, o26) {
- super(r18, "mat4", a6.Draw, (e28, s5, t17) => e28.setUniformMatrix4fv(r18, o26(s5, t17)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js
- function c5(r18, e28) {
- 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])));
- }
- function v2(e28, i12) {
- if (!i12.instancedDoublePrecision)
- 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)]);
- const o26 = (r18) => o(w2, r18.camera.viewInverseTransposeMatrix[3], r18.camera.viewInverseTransposeMatrix[7], r18.camera.viewInverseTransposeMatrix[11]);
- 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))]);
- }
- var f4 = e5();
- var w2 = n();
- function d5(r18) {
- r18.uniforms.add(new e13("viewNormal", (r19, e28) => e28.camera.viewInverseTransposeMatrix));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js
- var t8 = class {
- constructor() {
- this._key = "", this._keyDirty = false, this._parameterBits = this._parameterBits ? this._parameterBits.map(() => 0) : [], this._parameterNames || (this._parameterNames = []);
- }
- get key() {
- return this._keyDirty && (this._keyDirty = false, this._key = String.fromCharCode.apply(String, this._parameterBits)), this._key;
- }
- snapshot() {
- const t17 = this._parameterNames, e28 = { key: this.key };
- for (const r18 of t17)
- e28[r18] = this[r18];
- return e28;
- }
- };
- function e16(t17 = {}) {
- return (e28, r18) => {
- var _a, _b;
- if (e28._parameterNames = (_a = e28._parameterNames) != null ? _a : [], e28._parameterNames.push(r18), null != t17.constValue)
- Object.defineProperty(e28, r18, { get: () => t17.constValue });
- else {
- const s5 = e28._parameterNames.length - 1, a15 = t17.count || 2, i12 = Math.ceil(Math.log2(a15)), o26 = (_b = e28._parameterBits) != null ? _b : [0];
- let h10 = 0;
- for (; o26[h10] + i12 > 16; )
- h10++, h10 >= o26.length && o26.push(0);
- e28._parameterBits = o26;
- const n18 = o26[h10], m5 = (1 << i12) - 1 << n18;
- o26[h10] += i12, Object.defineProperty(e28, r18, { get() {
- return this[s5];
- }, set(t18) {
- 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))
- throw "Configuration value for " + r18 + " must be boolean or number, got " + typeof t18;
- } });
- }
- };
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js
- var v3 = class extends t8 {
- constructor() {
- super(...arguments), this.instancedDoublePrecision = false;
- }
- };
- function p(e28, i12) {
- 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"));
- const c9 = e28.vertex;
- 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`
- vec3 calculateVPos() {
- ${i12.instancedDoublePrecision ? "return model * localPosition().xyz;" : "return localPosition().xyz;"}
- }
- `), c9.code.add(n4`
- vec3 subtractOrigin(vec3 _pos) {
- ${i12.instancedDoublePrecision ? n4`
- vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);
- return _pos - originDelta;` : "return vpos;"}
- }
- `), c9.code.add(n4`
- vec3 dpNormal(vec4 _normal) {
- ${i12.instancedDoublePrecision ? "return normalize(modelNormal * _normal.xyz);" : "return normalize(_normal.xyz);"}
- }
- `), i12.output === h2.Normal && (d5(c9), c9.code.add(n4`
- vec3 dpNormalView(vec4 _normal) {
- ${i12.instancedDoublePrecision ? "return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);" : "return normalize((viewNormal * _normal).xyz);"}
- }
- `)), i12.hasVertexTangents && c9.code.add(n4`
- vec4 dpTransformVertexTangent(vec4 _tangent) {
- ${i12.instancedDoublePrecision ? "return vec4(modelNormal * _tangent.xyz, _tangent.w);" : "return _tangent;"}
- }
- `);
- }
- e([e16()], v3.prototype, "instancedDoublePrecision", void 0);
- var b2 = n();
- // node_modules/@arcgis/core/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl.js
- function e17(e28) {
- e28.vertex.code.add(n4`
- vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
- float symbolAlpha = 0.0;
- const float maxTint = 85.0;
- const float maxReplace = 170.0;
- const float scaleAlpha = 3.0;
- if (symbolColor.a > maxReplace) {
- colorMixMode = ${n4.int(r5.Multiply)};
- symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
- } else if (symbolColor.a > maxTint) {
- colorMixMode = ${n4.int(r5.Replace)};
- symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
- } else if (symbolColor.a > 0.0) {
- colorMixMode = ${n4.int(r5.Tint)};
- symbolAlpha = scaleAlpha * symbolColor.a;
- } else {
- colorMixMode = ${n4.int(r5.Multiply)};
- symbolAlpha = 0.0;
- }
- return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
- }
- `);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js
- var e18 = class extends i {
- constructor(r18, e28) {
- super(r18, "int", a6.Pass, (s5, o26, i12) => s5.setUniform1i(r18, e28(o26, i12)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js
- function l3(e28) {
- return Math.abs(e28 * e28 * e28);
- }
- function s(e28, t17, a15) {
- const i12 = a15.parameters, r18 = a15.paddingPixelsOverride;
- return x3.scale = Math.min(i12.divisor / (t17 - i12.offset), 1), x3.factor = l3(e28), x3.minPixelSize = i12.minPixelSize, x3.paddingPixels = r18, x3;
- }
- function c6(e28, t17) {
- return 0 === e28 ? t17.minPixelSize : t17.minPixelSize * (1 + 2 * t17.paddingPixels / e28);
- }
- function o14(t17, a15) {
- return Math.max(h(t17 * a15.scale, t17, a15.factor), c6(t17, a15));
- }
- function m3(e28, t17, a15, i12) {
- return o14(e28, s(t17, a15, i12));
- }
- 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 };
- var x3 = { scale: 0, factor: 0, minPixelSize: 0, paddingPixels: 0 };
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/renderers/utils.js
- function u7(t17) {
- return !!r(t17) && !t17.visible;
- }
- var g2 = new Float64Array(3);
- var b3 = new Float32Array(6);
- var j = e7();
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/MaterialUtil.js
- var g3 = a3();
- function x4(t17, n18, e28, o26, i12, r18, s5) {
- if (!u7(n18))
- if (t17.boundingInfo) {
- e8(t17.primitiveType === a5.Triangle);
- const n19 = e28.tolerance;
- M(t17.boundingInfo, o26, i12, n19, r18, s5);
- } else {
- const n19 = t17.indices.get(O2.POSITION), e29 = t17.vertexAttributes.get(O2.POSITION);
- v4(o26, i12, 0, n19.length / 3, n19, e29, void 0, r18, s5);
- }
- }
- var b4 = n();
- function M(t17, n18, i12, r18, s5, c9) {
- if (t(t17))
- return;
- const f7 = N(n18, i12, b4);
- if (d(g3, t17.getBBMin()), q(g3, t17.getBBMax()), r(s5) && s5.applyToAabb(g3), O4(g3, n18, f7, r18)) {
- const { primitiveIndices: e28, indices: o26, position: f8 } = t17, a15 = e28 ? e28.length : o26.length / 3;
- if (a15 > W3) {
- const e29 = t17.getChildren();
- if (void 0 !== e29) {
- for (let t18 = 0; t18 < 8; ++t18)
- void 0 !== e29[t18] && M(e29[t18], n18, i12, r18, s5, c9);
- return;
- }
- }
- v4(n18, i12, 0, a15, o26, f8, e28, s5, c9);
- }
- }
- var y = n();
- function v4(t17, n18, e28, i12, r18, s5, c9, f7, a15) {
- if (c9)
- return I2(t17, n18, e28, i12, r18, s5, c9, f7, a15);
- 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;
- for (let b6 = e28, M4 = 3 * e28; b6 < i12; ++b6) {
- let t18 = u10 * r18[M4++], n19 = l8[t18++], e29 = l8[t18++], i13 = l8[t18];
- t18 = u10 * r18[M4++];
- let s6 = l8[t18++], c10 = l8[t18++], v6 = l8[t18];
- t18 = u10 * r18[M4++];
- let I4 = l8[t18++], T3 = l8[t18++], j4 = l8[t18];
- 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));
- 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;
- if (Math.abs(W4) <= Number.EPSILON)
- continue;
- const z2 = m5 - n19, k = p4 - e29, R = h10 - i13, C4 = z2 * E5 + k * P4 + R * U2;
- if (W4 > 0) {
- if (C4 < 0 || C4 > W4)
- continue;
- } else if (C4 > 0 || C4 < W4)
- continue;
- const H2 = k * V3 - O5 * R, X = R * N2 - V3 * z2, Y2 = z2 * O5 - N2 * k, Z = d9 * H2 + g6 * X + x6 * Y2;
- if (W4 > 0) {
- if (Z < 0 || C4 + Z > W4)
- continue;
- } else if (Z > 0 || C4 + Z < W4)
- continue;
- const _4 = (L4 * H2 + S3 * X + B3 * Y2) / W4;
- if (_4 >= 0) {
- a15(_4, A(N2, O5, V3, L4, S3, B3, y), b6, false);
- }
- }
- }
- function I2(t17, n18, e28, i12, r18, s5, c9, f7, a15) {
- 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;
- for (let b6 = e28; b6 < i12; ++b6) {
- const t18 = c9[b6];
- let n19 = 3 * t18, e29 = u10 * r18[n19++], i13 = l8[e29++], s6 = l8[e29++], M4 = l8[e29];
- e29 = u10 * r18[n19++];
- let v6 = l8[e29++], I4 = l8[e29++], T3 = l8[e29];
- e29 = u10 * r18[n19];
- let j4 = l8[e29++], N2 = l8[e29++], O5 = l8[e29];
- 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));
- 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;
- if (Math.abs(k) <= Number.EPSILON)
- continue;
- const R = m5 - i13, C4 = p4 - s6, H2 = h10 - M4, X = R * U2 + C4 * W4 + H2 * z2;
- if (k > 0) {
- if (X < 0 || X > k)
- continue;
- } else if (X > 0 || X < k)
- continue;
- const Y2 = C4 * S3 - L4 * H2, Z = H2 * V3 - S3 * R, _4 = R * L4 - V3 * C4, q2 = d9 * Y2 + g6 * Z + x6 * _4;
- if (k > 0) {
- if (q2 < 0 || X + q2 > k)
- continue;
- } else if (q2 > 0 || X + q2 < k)
- continue;
- const w5 = (B3 * Y2 + E5 * Z + P4 * _4) / k;
- if (w5 >= 0) {
- a15(w5, A(V3, L4, S3, B3, E5, P4, y), t18, false);
- }
- }
- }
- var T2 = n();
- var j2 = n();
- function A(t17, n18, e28, o26, c9, f7, a15) {
- return o(T2, t17, n18, e28), o(j2, o26, c9, f7), _(a15, T2, j2), z(a15, a15), a15;
- }
- function N(t17, n18, e28) {
- return o(e28, 1 / (n18[0] - t17[0]), 1 / (n18[1] - t17[1]), 1 / (n18[2] - t17[2]));
- }
- function O4(t17, n18, e28, o26) {
- return V(t17, n18, e28, o26, 1 / 0);
- }
- function V(t17, n18, e28, o26, i12) {
- const r18 = (t17[0] - o26 - n18[0]) * e28[0], s5 = (t17[3] + o26 - n18[0]) * e28[0];
- let c9 = Math.min(r18, s5), f7 = Math.max(r18, s5);
- const a15 = (t17[1] - o26 - n18[1]) * e28[1], l8 = (t17[4] + o26 - n18[1]) * e28[1];
- if (f7 = Math.min(f7, Math.max(a15, l8)), f7 < 0)
- return false;
- if (c9 = Math.max(c9, Math.min(a15, l8)), c9 > f7)
- return false;
- const u10 = (t17[2] - o26 - n18[2]) * e28[2], m5 = (t17[5] + o26 - n18[2]) * e28[2];
- return f7 = Math.min(f7, Math.max(u10, m5)), !(f7 < 0) && (c9 = Math.max(c9, Math.min(u10, m5)), !(c9 > f7) && c9 < i12);
- }
- function L2(t17, e28, i12, r18, s5) {
- let c9 = (i12.screenLength || 0) * t17.pixelRatio;
- r(s5) && (c9 = m3(c9, r18, e28, s5));
- const f7 = c9 * Math.tan(0.5 * t17.fovY) / (0.5 * t17.fullHeight);
- return a2(f7 * e28, i12.minWorldLength || 0, null != i12.maxWorldLength ? i12.maxWorldLength : 1 / 0);
- }
- function S2(t17, n18) {
- const e28 = n18 ? S2(n18) : {};
- for (const o26 in t17) {
- let n19 = t17[o26];
- n19 && n19.forEach && (n19 = P(n19)), null == n19 && o26 in e28 || (e28[o26] = n19);
- }
- return e28;
- }
- function B2(n18, e28) {
- let o26 = false;
- for (const i12 in e28) {
- const r18 = e28[i12];
- 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));
- }
- return o26;
- }
- function P(t17) {
- const n18 = [];
- return t17.forEach((t18) => n18.push(t18)), n18;
- }
- var U = { multiply: 1, ignore: 2, replace: 3, tint: 4 };
- var W3 = 1e3;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js
- function i6(i12, t17) {
- t17.hasSymbolColors ? (i12.include(e17), i12.attributes.add(O2.SYMBOLCOLOR, "vec4"), i12.varyings.add("colorMixMode", "mediump float"), i12.vertex.code.add(n4`int symbolColorMixMode;
- vec4 getSymbolColor() {
- return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
- }
- void forwardColorMixMode() {
- colorMixMode = float(symbolColorMixMode) + 0.5;
- }`)) : (i12.fragment.uniforms.add(new e18("colorMixMode", (o26) => U[o26.colorMixMode])), i12.vertex.code.add(n4`vec4 getSymbolColor() { return vec4(1.0); }
- void forwardColorMixMode() {}`));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js
- function e19(e28, d9) {
- 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() {}
- void forwardNormalizedVertexColor() {}`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js
- function c7(e28) {
- e28.vertex.code.add(n4`float screenSizePerspectiveMinSize(float size, vec4 factor) {
- float nonZeroSize = 1.0 - step(size, 0.0);
- return (
- factor.z * (
- 1.0 +
- nonZeroSize *
- 2.0 * factor.w / (
- size + (1.0 - nonZeroSize)
- )
- )
- );
- }`), e28.vertex.code.add(n4`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
- return absCosAngle * absCosAngle * absCosAngle;
- }`), e28.vertex.code.add(n4`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {
- return vec4(
- min(params.x / (distanceToCamera - params.y), 1.0),
- screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
- params.z,
- params.w
- );
- }`), e28.vertex.code.add(n4`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {
- return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));
- }`), e28.vertex.code.add(n4`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {
- return applyScreenSizePerspectiveScaleFactorFloat(
- size,
- screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
- );
- }`), e28.vertex.code.add(n4`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {
- return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / max(1e-5, size.y), 1.0), size, factor.y);
- }`), e28.vertex.code.add(n4`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {
- return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
- }`);
- }
- function i7(e28) {
- e28.uniforms.add(new e9("screenSizePerspectiveAlignment", (e29) => o16(e29.screenSizePerspectiveAlignment || e29.screenSizePerspective)));
- }
- function o16(a15) {
- return r2(n9, a15.parameters.divisor, a15.parameters.offset, a15.parameters.minPixelSize, a15.paddingPixelsOverride);
- }
- var n9 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js
- function a11(e28, r18) {
- const c9 = e28.vertex;
- r18.hasVerticalOffset ? (f5(c9), r18.hasScreenSizePerspective && (e28.include(c7), i7(c9), c5(e28.vertex, r18)), c9.code.add(n4`
- vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
- float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
- ${r18.spherical ? n4`vec3 worldNormal = normalize(worldPos + localOrigin);` : n4`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
- ${r18.hasScreenSizePerspective ? n4`
- float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
- float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);` : n4`
- float verticalOffsetScreenHeight = verticalOffset.x;`}
- // Screen sized offset in world space, used for example for line callouts
- float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
- return worldNormal * worldOffset;
- }
- vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
- return worldPos + calculateVerticalOffset(worldPos, localOrigin);
- }
- `)) : c9.code.add(n4`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`);
- }
- var i8 = n2();
- function f5(r18) {
- r18.uniforms.add(new e9("verticalOffset", (r19, t17) => {
- 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;
- return r2(i8, c9 * a15, s5, l8, o26);
- }));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js
- var e20 = class extends i {
- constructor(r18, e28, o26) {
- super(r18, "vec4", a6.Pass, (s5, o27, t17) => s5.setUniform4fv(r18, e28(o27, t17)), o26);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js
- var o17 = class extends i {
- constructor(r18, o26, e28) {
- super(r18, "float", a6.Pass, (s5, e29, t17) => s5.setUniform1fv(r18, o26(e29, t17)), e28);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObject.js
- var r9 = class {
- constructor() {
- this.id = e3();
- }
- unload() {
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObjectType.js
- var e21;
- !function(e28) {
- 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";
- }(e21 || (e21 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js
- 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]]);
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Material.js
- var d6 = class extends r9 {
- constructor(e28, r18) {
- 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);
- }
- dispose() {
- }
- get parameters() {
- return this._parameters;
- }
- update(e28) {
- return false;
- }
- setParameters(e28, r18 = true) {
- B2(this._parameters, e28) && (this.validateParameters(this._parameters), r18 && this.parametersChanged());
- }
- validateParameters(e28) {
- }
- get visible() {
- return this._visible;
- }
- set visible(e28) {
- e28 !== this._visible && (this._visible = e28, this.parametersChanged());
- }
- shouldRender(e28) {
- return this.isVisible() && this.isVisibleForOutput(e28.output) && 0 != (this.renderOccluded & e28.renderOccludedMask);
- }
- isVisibleForOutput(e28) {
- return true;
- }
- get renderOccluded() {
- return this.parameters.renderOccluded;
- }
- get renderPriority() {
- return this._renderPriority;
- }
- set renderPriority(e28) {
- e28 !== this._renderPriority && (this._renderPriority = e28, this.parametersChanged());
- }
- get insertOrder() {
- return this._insertOrder;
- }
- set insertOrder(e28) {
- e28 !== this._insertOrder && (this._insertOrder = e28, this.parametersChanged());
- }
- get vertexAttributeLocations() {
- return this._vertexAttributeLocations;
- }
- isVisible() {
- return this._visible;
- }
- parametersChanged() {
- r(this.repository) && this.repository.materialChanged(this);
- }
- };
- var o18;
- !function(e28) {
- 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";
- }(o18 || (o18 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/VisualVariablePassParameters.js
- var o19 = 8;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js
- function s2(s5, n18) {
- n18.hasVvInstancing && (n18.vvSize || n18.vvColor) && s5.attributes.add(O2.INSTANCEFEATUREATTRIBUTE, "vec4");
- const l8 = s5.vertex;
- 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) {
- return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
- }
- vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
- return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
- }`), l8.code.add(n4`
- const float eps = 1.192092896e-07;
- vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
- vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
- return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
- }
- ${n18.hasVvInstancing ? n4`
- vec4 vvLocalNormal(vec3 _normal) {
- return vvTransformNormal(_normal, instanceFeatureAttribute);
- }
- vec4 localPosition() {
- return vvTransformPosition(position, instanceFeatureAttribute);
- }` : ""}
- `)) : l8.code.add(n4`vec4 localPosition() { return vec4(position, 1.0); }
- 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`
- vec4 vvGetColor(vec4 featureAttribute, float values[vvColorNumber], vec4 colors[vvColorNumber]) {
- float value = featureAttribute.y;
- if (value <= values[0]) {
- return colors[0];
- }
- for (int i = 1; i < vvColorNumber; ++i) {
- if (values[i] >= value) {
- float f = (value - values[i-1]) / (values[i] - values[i-1]);
- return mix(colors[i-1], colors[i], f);
- }
- }
- return colors[vvColorNumber - 1];
- }
- ${n18.hasVvInstancing ? n4`
- vec4 vvColor() {
- return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);
- }` : ""}
- `)) : l8.code.add(n4`vec4 vvColor() { return vec4(1.0); }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js
- function d7(d9) {
- d9.fragment.code.add(n4`
- #define discardOrAdjustAlpha(color) { if (color.a < ${n4.float(t6)}) { discard; } }
- `);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js
- function s3(a15, e28) {
- l4(a15, e28, new o4("textureAlphaCutoff", (a16) => a16.textureAlphaCutoff));
- }
- function l4(e28, r18, s5) {
- const t17 = e28.fragment;
- switch (r18.alphaDiscardMode !== C3.Mask && r18.alphaDiscardMode !== C3.MaskBlend || t17.uniforms.add(s5), r18.alphaDiscardMode) {
- case C3.Blend:
- return e28.include(d7);
- case C3.Opaque:
- t17.code.add(n4`void discardOrAdjustAlpha(inout vec4 color) {
- color.a = 1.0;
- }`);
- break;
- case C3.Mask:
- t17.code.add(n4`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);
- break;
- case C3.MaskBlend:
- e28.fragment.code.add(n4`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`);
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js
- function d8(d9, t17) {
- const a15 = t17.output === h2.ObjectAndLayerIdColor, n18 = t17.objectAndLayerIdColorInstanced;
- 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`
- void forwardObjectAndLayerIdColor() {
- ${a15 ? n18 ? n4`objectAndLayerIdColorVarying = objectAndLayerIdColor_instanced * 0.003921568627451;` : n4`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;` : n4``} }`), d9.fragment.code.add(n4`
- void outputObjectAndLayerIdColor() {
- ${a15 ? n4`gl_FragColor = objectAndLayerIdColorVarying;` : n4``} }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js
- function o20(o26, l8) {
- switch (o26.fragment.include(a8), l8.output) {
- case h2.Shadow:
- case h2.ShadowHighlight:
- case h2.ShadowExludeHighlight:
- o26.extensions.add("GL_OES_standard_derivatives"), o26.fragment.code.add(n4`float _calculateFragDepth(const in float depth) {
- const float SLOPE_SCALE = 2.0;
- const float BIAS = 20.0 * .000015259;
- float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
- float result = depth + SLOPE_SCALE * m + BIAS;
- return clamp(result, .0, .999999);
- }
- void outputDepth(float _linearDepth) {
- gl_FragColor = float2rgba(_calculateFragDepth(_linearDepth));
- }`);
- break;
- case h2.Depth:
- o26.fragment.code.add(n4`void outputDepth(float _linearDepth) {
- gl_FragColor = float2rgba(_linearDepth);
- }`);
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js
- var g4 = r3(1, 1, 0, 1);
- var i9 = r3(1, 0, 1, 1);
- function a12(e28, a15) {
- 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`
- void outputHighlight() {
- vec3 fragCoord = gl_FragCoord.xyz;
- float sceneDepth = ${i2(a15, "depthTex", "fragCoord.xy")}.x;
- if (fragCoord.z > sceneDepth + 5e-7) {
- gl_FragColor = occludedHighlightFlag;
- }
- else {
- gl_FragColor = unoccludedHighlightFlag;
- }
- }
- `);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
- function b5(b6, O5) {
- const { vertex: w5, fragment: C4 } = b6, T3 = O5.hasModelTransformation;
- T3 && w5.uniforms.add(new e13("model", (e28) => r(e28.modelTransformation) ? e28.modelTransformation : o2));
- const V3 = O5.hasColorTexture && O5.alphaDiscardMode !== C3.Opaque;
- switch (O5.output) {
- case h2.Depth:
- case h2.Shadow:
- case h2.ShadowHighlight:
- case h2.ShadowExludeHighlight:
- case h2.ObjectAndLayerIdColor:
- 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`
- void main(void) {
- vpos = calculateVPos();
- vpos = subtractOrigin(vpos);
- vpos = addVerticalOffset(vpos, localOrigin);
- gl_Position = transformPositionWithDepth(proj, view, ${T3 ? "model," : ""} vpos, nearFar, depth);
- forwardTextureCoordinates();
- forwardObjectAndLayerIdColor();
- }
- `), b6.include(s3, O5), C4.code.add(n4`
- void main(void) {
- discardBySlice(vpos);
- ${V3 ? n4`
- vec4 texColor = texture2D(tex, ${O5.hasColorTextureTransform ? n4`colorUV` : n4`vuv0`});
- discardOrAdjustAlpha(texColor);` : ""}
- ${O5.output === h2.ObjectAndLayerIdColor ? n4`outputObjectAndLayerIdColor();` : n4`outputDepth(depth);`}
- }
- `);
- break;
- case h2.Normal:
- 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`
- void main(void) {
- vpos = calculateVPos();
- vpos = subtractOrigin(vpos);
- ${O5.normalType === i3.Attribute ? n4`
- vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));` : ""}
- vpos = addVerticalOffset(vpos, localOrigin);
- gl_Position = transformPosition(proj, view, ${T3 ? "model," : ""} vpos);
- forwardTextureCoordinates();
- }
- `), b6.include(u5, O5), b6.include(s3, O5), C4.code.add(n4`
- void main() {
- discardBySlice(vpos);
- ${V3 ? n4`
- vec4 texColor = texture2D(tex, ${O5.hasColorTextureTransform ? n4`colorUV` : n4`vuv0`});
- discardOrAdjustAlpha(texColor);` : ""}
- ${O5.normalType === i3.ScreenDerivative ? n4`
- vec3 normal = screenDerivativeNormal(vPositionView);` : n4`
- vec3 normal = normalize(vNormalWorld);
- if (gl_FrontFacing == false) normal = -normal;`}
- gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
- }
- `);
- break;
- case h2.Highlight:
- 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`
- void main(void) {
- vpos = calculateVPos();
- vpos = subtractOrigin(vpos);
- vpos = addVerticalOffset(vpos, localOrigin);
- gl_Position = transformPosition(proj, view, ${T3 ? "model," : ""} vpos);
- forwardTextureCoordinates();
- }
- `), b6.include(u5, O5), b6.include(s3, O5), b6.include(a12, O5), C4.code.add(n4`
- void main() {
- discardBySlice(vpos);
- ${V3 ? n4`
- vec4 texColor = texture2D(tex, ${O5.hasColorTextureTransform ? n4`colorUV` : n4`vuv0`});
- discardOrAdjustAlpha(texColor);` : ""}
- outputHighlight();
- }
- `);
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js
- var n10 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 12)];
- var w3 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 20), new t2(O2.UV0, 2, C2.FLOAT, 12, 20)];
- 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)];
- var r11 = [new t2(O2.POSITION, 3, C2.FLOAT, 0, 16), new t2(O2.COLOR, 4, C2.UNSIGNED_BYTE, 12, 16)];
- var t10 = [new t2(O2.POSITION, 2, C2.FLOAT, 0, 8)];
- var A2 = [new t2(O2.POSITION, 2, C2.FLOAT, 0, 16), new t2(O2.UV0, 2, C2.FLOAT, 8, 16)];
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/VertexArrayObject.js
- var r12 = class extends a7 {
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/glUtil3D.js
- function u8(i12, m5 = t10, l8 = E3, T3 = -1, f7 = 1) {
- let u10 = null;
- if (m5 === A2)
- u10 = new Float32Array([T3, T3, 0, 0, f7, T3, 1, 0, T3, f7, 0, 1, f7, f7, 1, 1]);
- else
- u10 = new Float32Array([T3, T3, f7, T3, T3, f7, f7, f7]);
- return new r12(i12, l8, { geometry: m5 }, { geometry: E2.createVertex(i12, F.STATIC_DRAW, u10) });
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule.js
- var t11 = class {
- constructor(t17, o26) {
- this._module = t17, this._loadModule = o26;
- }
- get() {
- return this._module;
- }
- async reload() {
- return this._module = await this._loadModule(), this._module;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js
- var e23 = class {
- constructor(i12, t17, e28) {
- this.release = e28, this.initializeConfiguration(i12, t17), this._configuration = t17.snapshot(), this._program = this.initializeProgram(i12), this._pipeline = this.initializePipeline(i12.rctx.capabilities);
- }
- destroy() {
- this._program = a(this._program), this._pipeline = this._configuration = null;
- }
- reload(t17) {
- a(this._program), this._program = this.initializeProgram(t17), this._pipeline = this.initializePipeline(t17.rctx.capabilities);
- }
- get program() {
- return this._program;
- }
- get compiled() {
- return this.program.isCompiled;
- }
- get key() {
- return this._configuration.key;
- }
- get configuration() {
- return this._configuration;
- }
- bindPipelineState(i12, t17 = null, e28) {
- i12.setPipelineState(this.getPipelineState(t17, e28));
- }
- ensureAttributeLocations(i12) {
- this.program.assertCompatibleVertexAttributeLocations(i12);
- }
- get primitiveType() {
- return E.TRIANGLES;
- }
- getPipelineState(i12, t17) {
- return this._pipeline;
- }
- initializeConfiguration(i12, t17) {
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Program.js
- var o21 = class {
- constructor(t17, e28, o26) {
- 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 = () => {
- throw new Error("Wrapped _glProgram used directly");
- }, this.bindPass = e28.generateBind(a6.Pass, this), this.bindDraw = e28.generateBind(a6.Draw, this), this._fragmentUniforms = a4() ? e28.fragmentUniforms : null;
- }
- dispose() {
- this._glProgram.dispose();
- }
- get glName() {
- return this._glProgram.glName;
- }
- get isCompiled() {
- return this._glProgram.isCompiled;
- }
- setUniform1b(t17, e28) {
- this._glProgram.setUniform1i(t17, e28 ? 1 : 0);
- }
- setUniform1i(t17, e28) {
- this._glProgram.setUniform1i(t17, e28);
- }
- setUniform1f(t17, e28) {
- this._glProgram.setUniform1f(t17, e28);
- }
- setUniform2fv(t17, e28) {
- this._glProgram.setUniform2fv(t17, e28);
- }
- setUniform3fv(t17, e28) {
- this._glProgram.setUniform3fv(t17, e28);
- }
- setUniform4fv(t17, e28) {
- this._glProgram.setUniform4fv(t17, e28);
- }
- setUniformMatrix3fv(t17, e28) {
- this._glProgram.setUniformMatrix3fv(t17, e28);
- }
- setUniformMatrix4fv(t17, e28) {
- this._glProgram.setUniformMatrix4fv(t17, e28);
- }
- setUniform1fv(t17, e28) {
- this._glProgram.setUniform1fv(t17, e28);
- }
- setUniform1iv(t17, e28) {
- this._glProgram.setUniform1iv(t17, e28);
- }
- setUniform2iv(t17, e28) {
- this._glProgram.setUniform3iv(t17, e28);
- }
- setUniform3iv(t17, e28) {
- this._glProgram.setUniform3iv(t17, e28);
- }
- setUniform4iv(t17, e28) {
- this._glProgram.setUniform4iv(t17, e28);
- }
- assertCompatibleVertexAttributeLocations(t17) {
- t17.locations !== this._locations && console.error("VertexAttributeLocations are incompatible");
- }
- stop() {
- this._textures.clear(), this._freeTextureUnits.clear();
- }
- bindTexture(e28, r18) {
- if (t(r18) || null == r18.glName) {
- const t17 = this._textures.get(e28);
- return t17 && (this._context.bindTexture(null, t17.unit), this._freeTextureUnit(t17), this._textures.delete(e28)), null;
- }
- let i12 = this._textures.get(e28);
- 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;
- }
- rebindTextures() {
- this._context.useProgram(this), this._textures.forEach((t17, e28) => {
- this._context.bindTexture(t17.texture, t17.unit), this.setUniform1i(e28, t17.unit);
- }), r(this._fragmentUniforms) && this._fragmentUniforms.forEach((t17) => {
- "sampler2D" !== t17.type && "samplerCube" !== t17.type || this._textures.has(t17.name) || console.error(`Texture sampler ${t17.name} has no bound texture`);
- });
- }
- _allocTextureUnit(t17) {
- return { texture: t17, unit: 0 === this._freeTextureUnits.length ? this._textures.size : this._freeTextureUnits.pop() };
- }
- _freeTextureUnit(t17) {
- this._freeTextureUnits.push(t17.unit);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/SSAOBlurTechnique.js
- var l5 = class extends e23 {
- initializeProgram(r18) {
- return new o21(r18.rctx, l5.shader.get().build(), E3);
- }
- initializePipeline() {
- return W({ colorWrite: _2 });
- }
- };
- l5.shader = new t11(u4, () => import("./SSAOBlur.glsl-RGDK4Z25.js"));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/SSAOTechnique.js
- var l6 = class extends e23 {
- initializeProgram(e28) {
- return new o21(e28.rctx, l6.shader.get().build(), E3);
- }
- initializePipeline() {
- return W({ colorWrite: _2 });
- }
- };
- l6.shader = new t11(x, () => import("./SSAO.glsl-W2N6BVJ3.js"));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/SSAOHelper.js
- var w4 = 2;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js
- function n13(n18, a15) {
- const i12 = n18.fragment;
- 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`
- float evaluateAmbientOcclusionInverse() {
- vec2 ssaoTextureSizeInverse = ${r6(a15, "ssaoTex", true)};
- return texture2D(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).a;
- }
- float evaluateAmbientOcclusion() {
- return 1.0 - evaluateAmbientOcclusionInverse();
- }
- `)) : i12.code.add(n4`float evaluateAmbientOcclusionInverse() { return 1.0; }
- float evaluateAmbientOcclusion() { return 0.0; }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js
- function o24(n18) {
- n18.uniforms.add(new e12("mainLightDirection", (i12, n19) => n19.lighting.mainLight.direction));
- }
- function a13(n18) {
- n18.uniforms.add(new e12("mainLightIntensity", (i12, n19) => n19.lighting.mainLight.intensity));
- }
- function e24(i12, t17) {
- t17.useLegacyTerrainShading ? i12.uniforms.add(new o4("lightingFixedFactor", (i13, n18) => n18.lighting.noonFactor * (1 - n18.lighting.globalFactor))) : i12.constants.add("lightingFixedFactor", "float", 0);
- }
- function r14(i12, n18) {
- const r18 = i12.fragment;
- o24(r18), a13(r18), e24(r18, n18), r18.code.add(n4`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
- float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
- dotVal = mix(dotVal, 1.0, lightingFixedFactor);
- return mainLightIntensity * ((1.0 - shadowing) * dotVal);
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js
- function t14(t17) {
- const a15 = t17.fragment.code;
- a15.add(n4`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
- {
- return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
- }`), a15.add(n4`float integratedRadiance(float cosTheta2, float roughness)
- {
- return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
- }`), a15.add(n4`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
- {
- float cosTheta2 = 1.0 - RdotNG * RdotNG;
- float intRadTheta = integratedRadiance(cosTheta2, roughness);
- float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
- float sky = 2.0 - ground;
- return (ground * ambientGround + sky * ambientSky) * 0.5;
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js
- function t15(t17) {
- t17.vertex.code.add(n4`const float PI = 3.141592653589793;`), t17.fragment.code.add(n4`const float PI = 3.141592653589793;
- const float LIGHT_NORMALIZATION = 1.0 / PI;
- const float INV_PI = 0.3183098861837907;
- const float HALF_PI = 1.570796326794897;`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js
- function n14(n18, r18) {
- const l8 = n18.fragment.code;
- n18.include(t15), r18.pbrMode === d3.Water || r18.pbrMode === d3.WaterOnIntegratedMesh ? (l8.add(n4`
- struct PBRShadingWater
- {
- float NdotL; // cos angle between normal and light direction
- float NdotV; // cos angle between normal and view direction
- float NdotH; // cos angle between normal and half vector
- float VdotH; // cos angle between view direction and half vector
- float LdotH; // cos angle between light direction and half vector
- float VdotN; // cos angle between view direction and normal vector
- };
- float dtrExponent = ${r18.useCustomDTRExponentForWater ? "2.2" : "2.0"};
- `), l8.add(n4`vec3 fresnelReflection(float angle, vec3 f0, float f90) {
- return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);
- }`), l8.add(n4`float normalDistributionWater(float NdotH, float roughness)
- {
- float r2 = roughness * roughness;
- float NdotH2 = NdotH * NdotH;
- float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;
- return r2 / denom;
- }`), l8.add(n4`float geometricOcclusionKelemen(float LoH)
- {
- return 0.25 / (LoH * LoH);
- }`), l8.add(n4`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)
- {
- vec3 F = fresnelReflection(props.VdotH, F0, F0Max);
- float dSun = normalDistributionWater(props.NdotH, roughness);
- float V = geometricOcclusionKelemen(props.LdotH);
- float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);
- float strengthSunHaze = 1.2;
- float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;
- return ((dSun + dSunHaze) * V) * F;
- }
- vec3 tonemapACES(const vec3 x) {
- return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
- }`)) : r18.pbrMode !== d3.Normal && r18.pbrMode !== d3.Schematic || (n18.include(t14), l8.add(n4`struct PBRShadingInfo
- {
- float NdotL;
- float NdotV;
- float NdotH;
- float VdotH;
- float LdotH;
- float NdotNG;
- float RdotNG;
- float NdotAmbDir;
- float NdotH_Horizon;
- vec3 skyRadianceToSurface;
- vec3 groundRadianceToSurface;
- vec3 skyIrradianceToSurface;
- vec3 groundIrradianceToSurface;
- float averageAmbientRadiance;
- float ssao;
- vec3 albedoLinear;
- vec3 f0;
- vec3 f90;
- vec3 diffuseColor;
- float metalness;
- float roughness;
- };`), l8.add(n4`float normalDistribution(float NdotH, float roughness)
- {
- float a = NdotH * roughness;
- float b = roughness / (1.0 - NdotH * NdotH + a * a);
- return b * b * INV_PI;
- }`), l8.add(n4`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
- const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
- const vec2 c2 = vec2(-1.04, 1.04);
- vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
- vec4 r = roughness * c0 + c1;
- float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
- return c2 * a004 + r.zw;
- }`), l8.add(n4`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
- vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
- vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
- vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
- vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
- vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
- vec3 specularComponent = specularColor * indirectSpecular;
- return (diffuseComponent + specularComponent);
- }`), l8.add(n4`float gamutMapChanel(float x, vec2 p){
- return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
- }`), l8.add(n4`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
- vec3 outColor;
- vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
- outColor.x = gamutMapChanel(inColor.x, p) ;
- outColor.y = gamutMapChanel(inColor.y, p) ;
- outColor.z = gamutMapChanel(inColor.z, p) ;
- return outColor;
- }`));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js
- function m4(n18, g6) {
- const m5 = n18.fragment, o26 = void 0 !== g6.lightingSphericalHarmonicsOrder ? g6.lightingSphericalHarmonicsOrder : 2;
- 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) {
- vec3 ambientLight = 0.282095 * lightingAmbientSH0;
- return ambientLight * (1.0 - ambientOcclusion);
- }`)) : 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) {
- vec4 sh0 = vec4(
- 0.282095,
- 0.488603 * normal.x,
- 0.488603 * normal.z,
- 0.488603 * normal.y
- );
- vec3 ambientLight = vec3(
- dot(lightingAmbientSH_R, sh0),
- dot(lightingAmbientSH_G, sh0),
- dot(lightingAmbientSH_B, sh0)
- );
- return ambientLight * (1.0 - ambientOcclusion);
- }`)) : 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) {
- vec3 ambientLight = 0.282095 * lightingAmbientSH0;
- vec4 sh1 = vec4(
- 0.488603 * normal.x,
- 0.488603 * normal.z,
- 0.488603 * normal.y,
- 1.092548 * normal.x * normal.y
- );
- vec4 sh2 = vec4(
- 1.092548 * normal.y * normal.z,
- 0.315392 * (3.0 * normal.z * normal.z - 1.0),
- 1.092548 * normal.x * normal.z,
- 0.546274 * (normal.x * normal.x - normal.y * normal.y)
- );
- ambientLight += vec3(
- dot(lightingAmbientSH_R1, sh1),
- dot(lightingAmbientSH_G1, sh1),
- dot(lightingAmbientSH_B1, sh1)
- );
- ambientLight += vec3(
- dot(lightingAmbientSH_R2, sh2),
- dot(lightingAmbientSH_G2, sh2),
- dot(lightingAmbientSH_B2, sh2)
- );
- return ambientLight * (1.0 - ambientOcclusion);
- }`), g6.pbrMode !== d3.Normal && g6.pbrMode !== d3.Schematic || m5.code.add(n4`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
- vec3 calculateAmbientRadiance(float ambientOcclusion)
- {
- vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
- return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
- }`));
- }
- var a14 = n();
- var r15 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js
- var s4 = class extends i {
- constructor(o26, s5) {
- super(o26, "bool", a6.Pass, (r18, e28, t17) => r18.setUniform1b(o26, s5(e28, t17)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SphericalHarmonics.js
- var P3 = n();
- // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SceneLighting.js
- var _3 = 0.4;
- var p2 = n();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js
- function h8(i12) {
- i12.constants.add("ambientBoostFactor", "float", _3);
- }
- function u9(i12) {
- i12.uniforms.add(new o4("lightingGlobalFactor", (i13, n18) => n18.lighting.globalFactor));
- }
- function p3(g6, p4) {
- const v6 = g6.fragment;
- switch (g6.include(n13, p4), p4.pbrMode !== d3.Disabled && g6.include(n14, p4), g6.include(m4, p4), g6.include(t15), v6.code.add(n4`
- const float GAMMA_SRGB = 2.1;
- const float INV_GAMMA_SRGB = 0.4761904;
- ${p4.pbrMode === d3.Disabled ? "" : "const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
- `), h8(v6), u9(v6), o24(v6), v6.code.add(n4`
- float additionalDirectedAmbientLight(vec3 vPosWorld) {
- float vndl = dot(${p4.spherical ? n4`normalize(vPosWorld)` : n4`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
- return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
- }
- `), a13(v6), v6.code.add(n4`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
- float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
- return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
- }`), p4.pbrMode) {
- case d3.Disabled:
- case d3.WaterOnIntegratedMesh:
- case d3.Water:
- g6.include(r14, p4), v6.code.add(n4`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
- {
- vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
- vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
- vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
- vec3 totalLight = mainLighting + ambientLighting + additionalLight;
- totalLight = min(totalLight, vec3(PI));
- vec3 outColor = vec3((albedoLinear / PI) * totalLight);
- return pow(outColor, vec3(INV_GAMMA_SRGB));
- }`);
- break;
- case d3.Normal:
- case d3.Schematic:
- v6.code.add(n4`const float fillLightIntensity = 0.25;
- const float horizonLightDiffusion = 0.4;
- const float additionalAmbientIrradianceFactor = 0.02;
- vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
- {
- vec3 viewDirection = -viewDir;
- vec3 mainLightDirection = mainLightDirection;
- vec3 h = normalize(viewDirection + mainLightDirection);
- PBRShadingInfo inputs;
- inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
- inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
- inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
- inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
- inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
- vec3 reflectedView = normalize(reflect(viewDirection, normal));
- inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
- inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
- inputs.ssao = ssao;
- inputs.metalness = mrr[0];
- 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;
- inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
- 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]);
- ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
- inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
- vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
- vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
- vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
- inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
- 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;
- vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
- inputs.NdotH_Horizon = dot(normal, horizonRingH);
- vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
- vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
- vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
- inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
- inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
- inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`), v6.code.add(n4`
- vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
- vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
- vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
- vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
- ${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));`}
- return outColor;
- }
- `);
- break;
- default:
- n3(p4.pbrMode);
- case d3.COUNT:
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js
- function n17(n18, o26) {
- 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`
- void terrainDepthTest(vec4 fragCoord, float fragmentDepth){
- float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar);
- if(fragmentDepth ${o26.cullAboveGround ? ">" : "<="} terrainDepth){
- discard;
- }
- }
- `));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js
- var o25 = class extends i {
- constructor(r18, o26, s5) {
- super(r18, "mat4", a6.Draw, (e28, s6, t17) => e28.setUniformMatrix4fv(r18, o26(s6, t17)), s5);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js
- var e26 = class extends i {
- constructor(r18, e28, o26) {
- super(r18, "mat4", a6.Pass, (s5, o27, t17) => s5.setUniformMatrix4fv(r18, e28(o27, t17)), o26);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js
- function h9(e28, a15) {
- a15.receiveShadows && (e28.fragment.uniforms.add(new e26("shadowMapMatrix", (e29, a16) => a16.shadowMap.getShadowMapMatrices(e29.origin), 4)), f6(e28, a15));
- }
- function v5(e28, a15) {
- a15.receiveShadows && (e28.fragment.uniforms.add(new o25("shadowMapMatrix", (e29, a16) => a16.shadowMap.getShadowMapMatrices(e29.origin), 4)), f6(e28, a15));
- }
- function f6(e28, i12) {
- const d9 = e28.fragment;
- 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`
- int chooseCascade(float depth, out mat4 mat) {
- vec4 distance = cascadeDistances;
- // choose correct cascade
- int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
- mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
- return i;
- }
- vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
- vec4 lv = mat * vec4(_vpos, 1.0);
- lv.xy /= lv.w;
- return 0.5 * lv.xyz + vec3(0.5);
- }
- vec2 cascadeCoordinates(int i, vec3 lvpos) {
- return vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;
- }
- float readShadowMapDepth(vec2 uv, sampler2D _depthTex) {
- return rgba2float(texture2D(_depthTex, uv));
- }
- float posIsInShadow(vec2 uv, vec3 lvpos, sampler2D _depthTex) {
- return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
- }
- float filterShadow(vec2 uv, vec3 lvpos, float textureSize, sampler2D _depthTex) {
- float halfPixelSize = 0.5 / textureSize;
- // filter, offset by half pixels
- vec2 st = fract((vec2(halfPixelSize) + uv) * textureSize);
- float s00 = posIsInShadow(uv + vec2(-halfPixelSize, -halfPixelSize), lvpos, _depthTex);
- float s10 = posIsInShadow(uv + vec2(halfPixelSize, -halfPixelSize), lvpos, _depthTex);
- float s11 = posIsInShadow(uv + vec2(halfPixelSize, halfPixelSize), lvpos, _depthTex);
- float s01 = posIsInShadow(uv + vec2(-halfPixelSize, halfPixelSize), lvpos, _depthTex);
- return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
- }
- float readShadowMap(const in vec3 _vpos, float _linearDepth) {
- mat4 mat;
- int i = chooseCascade(_linearDepth, mat);
- if (i >= numCascades) { return 0.0; }
- vec3 lvpos = lightSpacePosition(_vpos, mat);
- // vertex completely outside? -> no shadow
- if (lvpos.z >= 1.0) { return 0.0; }
- if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
- // calc coord in cascade texture
- vec2 uv = cascadeCoordinates(i, lvpos);
- vec2 textureSize = ${r6(i12, "shadowMapTex")};
- return filterShadow(uv, lvpos, textureSize.x, shadowMapTex);
- }
- `);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js
- function e27(e28) {
- e28.code.add(n4`vec4 premultiplyAlpha(vec4 v) {
- return vec4(v.rgb * v.a, v.a);
- }
- vec3 rgb2hsv(vec3 c) {
- vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
- vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
- vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
- float d = q.x - min(q.w, q.y);
- float e = 1.0e-10;
- return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
- }
- vec3 hsv2rgb(vec3 c) {
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
- return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
- }
- float rgb2v(vec3 c) {
- return max(c.x, max(c.y, c.z));
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js
- function i11(i12) {
- i12.include(e27), i12.code.add(n4`
- vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
- // workaround for artifacts in OSX using Intel Iris Pro
- // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
- vec3 internalMixed = internalColor * textureColor;
- vec3 allMixed = internalMixed * externalColor;
- if (mode == ${n4.int(r5.Multiply)}) {
- return allMixed;
- }
- if (mode == ${n4.int(r5.Ignore)}) {
- return internalMixed;
- }
- if (mode == ${n4.int(r5.Replace)}) {
- return externalColor;
- }
- // tint (or something invalid)
- float vIn = rgb2v(internalMixed);
- vec3 hsvTint = rgb2hsv(externalColor);
- vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
- return hsv2rgb(hsvOut);
- }
- float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
- // workaround for artifacts in OSX using Intel Iris Pro
- // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
- float internalMixed = internalOpacity * textureOpacity;
- float allMixed = internalMixed * externalOpacity;
- if (mode == ${n4.int(r5.Ignore)}) {
- return internalMixed;
- }
- if (mode == ${n4.int(r5.Replace)}) {
- return externalOpacity;
- }
- // multiply or tint (or something invalid)
- return allMixed;
- }
- `);
- }
- export {
- r9 as r,
- e21 as e,
- E3 as E,
- u8 as u,
- h2 as h,
- o6 as o,
- i3 as i,
- d2 as d,
- o7 as o2,
- a10 as a,
- e12 as e2,
- h3 as h2,
- d3 as d2,
- x2 as x,
- x4 as x2,
- L2 as L,
- d6 as d3,
- o18 as o3,
- o10 as o4,
- i4 as i2,
- e14 as e3,
- e13 as e4,
- n6 as n,
- f3 as f,
- o12 as o5,
- t6 as t,
- t11 as t2,
- e23 as e5,
- o21 as o6,
- d4,
- e15 as e6,
- u5 as u2,
- r8 as r2,
- c5 as c,
- v2 as v,
- t8 as t3,
- e16 as e7,
- p,
- i6 as i3,
- e19 as e8,
- a11 as a2,
- s2 as s,
- s3 as s2,
- b5 as b,
- n13 as n2,
- o24 as o7,
- a13 as a3,
- n14 as n3,
- h8 as h3,
- u9 as u3,
- p3 as p2,
- n17 as n4,
- h9 as h4,
- v5 as v2,
- i11 as i4
- };
- //# sourceMappingURL=chunk-5242SYQJ.js.map
|