123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992 |
- import {
- C,
- c as c3,
- i,
- o as o3,
- r as r6
- } from "./chunk-EPIK5VPD.js";
- import {
- e as e7
- } from "./chunk-YOPKLVID.js";
- import {
- r as r5
- } from "./chunk-T4GXZJ3D.js";
- import {
- O
- } from "./chunk-XXBIV3TZ.js";
- import {
- e as e5
- } from "./chunk-E3HOL2XO.js";
- import {
- e as e4
- } from "./chunk-SCXOTZ6Q.js";
- import {
- f as f2,
- n as n4
- } from "./chunk-G5AI6ZNE.js";
- import {
- r as r4
- } from "./chunk-6P6NA7JB.js";
- import {
- a as a2,
- q,
- w
- } from "./chunk-WNCU6BFU.js";
- import {
- n as n2,
- r as r3
- } from "./chunk-NTUXR253.js";
- import {
- n as n3
- } from "./chunk-H2KDMZTR.js";
- import {
- e as e6
- } from "./chunk-PJ7ZQ4VD.js";
- import {
- c as c2
- } from "./chunk-TERAW6FT.js";
- import {
- L,
- M,
- _,
- e as e3,
- o,
- o2,
- r2,
- s3,
- u,
- z
- } from "./chunk-XNLG7T2T.js";
- import {
- f,
- n
- } from "./chunk-IR4PV7VK.js";
- import {
- e4 as e2
- } from "./chunk-Y3WMVFTW.js";
- import {
- k
- } from "./chunk-ULGDPLM2.js";
- import {
- s,
- s3 as s2
- } from "./chunk-EMJ4ZSM2.js";
- import {
- a,
- c2 as c,
- e,
- p,
- r,
- t
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputOptions.js
- var o4;
- !function(o24) {
- o24[o24.Color = 0] = "Color", o24[o24.Depth = 1] = "Depth", o24[o24.Normal = 2] = "Normal", o24[o24.Shadow = 3] = "Shadow", o24[o24.Highlight = 4] = "Highlight", o24[o24.Draped = 5] = "Draped", o24[o24.Occlusion = 6] = "Occlusion", o24[o24.Alpha = 7] = "Alpha", o24[o24.COUNT = 8] = "COUNT";
- }(o4 || (o4 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/interfaces.js
- var t2 = class {
- };
- function n5(t10, ...n15) {
- let o24 = "";
- for (let r15 = 0; r15 < n15.length; r15++)
- o24 += t10[r15] + n15[r15];
- return o24 += t10[t10.length - 1], o24;
- }
- !function(t10) {
- function n15(t11) {
- return Math.round(t11).toString();
- }
- function o24(t11) {
- return t11.toPrecision(8);
- }
- t10.int = n15, t10.float = o24;
- }(n5 || (n5 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js
- function o5(o24) {
- const d8 = n5`vec3 decodeNormal(vec2 f) {
- float z = 1.0 - abs(f.x) - abs(f.y);
- return vec3(f + sign(f) * min(z, 0.0), z);
- }`;
- o24.fragment.code.add(d8), o24.vertex.code.add(d8);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js
- function o6(o24, d8) {
- d8.normalType === i2.Attribute && (o24.attributes.add(O.NORMAL, "vec3"), o24.vertex.code.add(n5`vec3 normalModel() {
- return normal;
- }`)), d8.normalType === i2.CompressedAttribute && (o24.include(o5), o24.attributes.add(O.NORMALCOMPRESSED, "vec2"), o24.vertex.code.add(n5`vec3 normalModel() {
- return decodeNormal(normalCompressed);
- }`)), d8.normalType === i2.ScreenDerivative && (o24.extensions.add("GL_OES_standard_derivatives"), o24.fragment.code.add(n5`vec3 screenDerivativeNormal(vec3 positionView) {
- return normalize(cross(dFdx(positionView), dFdy(positionView)));
- }`));
- }
- var i2;
- !function(e24) {
- e24[e24.Attribute = 0] = "Attribute", e24[e24.CompressedAttribute = 1] = "CompressedAttribute", e24[e24.Ground = 2] = "Ground", e24[e24.ScreenDerivative = 3] = "ScreenDerivative", e24[e24.COUNT = 4] = "COUNT";
- }(i2 || (i2 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js
- var o7;
- function d(d8, a14) {
- switch (a14.textureCoordinateType) {
- case o7.Default:
- return d8.attributes.add(O.UV0, "vec2"), d8.varyings.add("vuv0", "vec2"), void d8.vertex.code.add(n5`void forwardTextureCoordinates() {
- vuv0 = uv0;
- }`);
- case o7.Atlas:
- return d8.attributes.add(O.UV0, "vec2"), d8.varyings.add("vuv0", "vec2"), d8.attributes.add(O.UVREGION, "vec4"), d8.varyings.add("vuvRegion", "vec4"), void d8.vertex.code.add(n5`void forwardTextureCoordinates() {
- vuv0 = uv0;
- vuvRegion = uvRegion;
- }`);
- case o7.None:
- return void d8.vertex.code.add(n5`void forwardTextureCoordinates() {}`);
- default:
- n3(a14.textureCoordinateType);
- case o7.COUNT:
- return;
- }
- }
- !function(e24) {
- e24[e24.None = 0] = "None", e24[e24.Default = 1] = "Default", e24[e24.Atlas = 2] = "Atlas", e24[e24.COUNT = 3] = "COUNT";
- }(o7 || (o7 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/BindType.js
- var a3;
- !function(a14) {
- a14[a14.Pass = 0] = "Pass", a14[a14.Draw = 1] = "Draw";
- }(a3 || (a3 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Uniform.js
- var i3 = class {
- constructor(i12, s9, t10, a14, n15 = null) {
- this.name = i12, this.type = s9, this.arraySize = n15, this.bind = { [a3.Pass]: null, [a3.Draw]: null }, r(t10) && r(a14) && (this.bind[t10] = a14);
- }
- equals(e24) {
- return this.type === e24.type && this.name === e24.name && this.arraySize === e24.arraySize;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js
- var e8 = class extends i3 {
- constructor(r15, e24) {
- super(r15, "vec3", a3.Pass, (s9, o24, t10) => s9.setUniform3fv(r15, e24(o24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js
- var e9 = class extends i3 {
- constructor(r15, e24) {
- super(r15, "vec2", a3.Pass, (s9, o24, t10) => s9.setUniform2fv(r15, e24(o24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js
- var c4 = class extends i3 {
- constructor(r15, s9) {
- super(r15, "sampler2D", a3.Pass, (o24, e24, t10) => o24.bindTexture(r15, s9(e24, t10)));
- }
- };
- function m(e24, n15, i12) {
- const m8 = [new c4(e24, n15)];
- if (i12) {
- const i13 = e24 + "Size";
- m8.push(new e9(i13, (e25, t10) => {
- const i14 = n15(e25, t10);
- return r(i14) ? r4(p2, i14.descriptor.width, i14.descriptor.height) : f2;
- }));
- }
- return m8;
- }
- var p2 = n4();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl.js
- function t3(t10) {
- t10.extensions.add("GL_EXT_shader_texture_lod"), t10.extensions.add("GL_OES_standard_derivatives"), t10.fragment.code.add(n5`#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 a4(a14, s9) {
- switch (a14.include(d, s9), a14.fragment.code.add(n5`
- struct TextureLookupParameter {
- vec2 uv;
- ${s9.supportsTextureAtlas ? "vec2 size;" : ""}
- } vtc;
- `), s9.textureCoordinateType) {
- case o7.Default:
- return void a14.fragment.code.add(n5`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
- return texture2D(texture, params.uv);
- }`);
- case o7.Atlas:
- return a14.include(t3), void a14.fragment.code.add(n5`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
- return textureAtlasLookup(texture, params.size, params.uv, vuvRegion);
- }`);
- default:
- n3(s9.textureCoordinateType);
- case o7.None:
- case o7.COUNT:
- return;
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js
- var o8 = class extends i3 {
- constructor(r15, o24) {
- super(r15, "vec3", a3.Draw, (e24, s9, t10) => e24.setUniform3fv(r15, o24(s9, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js
- var o9 = class extends i3 {
- constructor(r15, o24) {
- super(r15, "vec2", a3.Draw, (e24, s9, t10) => e24.setUniform2fv(r15, o24(s9, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js
- var c5 = class extends i3 {
- constructor(r15, o24) {
- super(r15, "sampler2D", a3.Draw, (s9, e24, t10) => s9.bindTexture(r15, o24(e24, t10)));
- }
- };
- function m2(e24, n15, i12) {
- const m8 = [new c5(e24, n15)];
- if (i12) {
- const i13 = e24 + "Size";
- m8.push(new o9(i13, (e25, t10) => {
- const i14 = n15(e25, t10);
- return r(i14) ? r4(p3, i14.descriptor.width, i14.descriptor.height) : f2;
- }));
- }
- return m8;
- }
- var p3 = n4();
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLMaterial.js
- var t4 = class {
- constructor(e24) {
- this._material = e24.material, this._techniqueRepository = e24.techniqueRep, this._output = e24.output;
- }
- dispose() {
- this._techniqueRepository.release(this._technique);
- }
- get technique() {
- return this._technique;
- }
- ensureTechnique(e24, t10, i12 = this._output) {
- return this._technique = this._techniqueRepository.releaseAndAcquire(e24, this._material.getConfiguration(i12, t10), this._technique), this._technique;
- }
- ensureResources(t10) {
- return i.LOADED;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLTextureMaterial.js
- var h = class extends t4 {
- constructor(t10) {
- super(t10), this._numLoading = 0, this._disposed = false, this._textureRepository = t10.textureRep, this._textureId = t10.textureId, this._acquire(t10.textureId, (t11) => this._texture = t11), this._acquire(t10.normalTextureId, (t11) => this._textureNormal = t11), this._acquire(t10.emissiveTextureId, (t11) => this._textureEmissive = t11), this._acquire(t10.occlusionTextureId, (t11) => this._textureOcclusion = t11), this._acquire(t10.metallicRoughnessTextureId, (t11) => this._textureMetallicRoughness = t11);
- }
- dispose() {
- this._texture = p(this._texture), this._textureNormal = p(this._textureNormal), this._textureEmissive = p(this._textureEmissive), this._textureOcclusion = p(this._textureOcclusion), this._textureMetallicRoughness = p(this._textureMetallicRoughness), this._disposed = true;
- }
- ensureResources(t10) {
- return this._numLoading === 0 ? i.LOADED : i.LOADING;
- }
- get textureBindParameters() {
- return new o10(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(e24) {
- (t(this._texture) || e24 !== this._texture.id) && (this._texture = p(this._texture), this._textureId = e24, this._acquire(this._textureId, (t10) => this._texture = t10));
- }
- _acquire(e24, r15) {
- if (t(e24))
- return void r15(null);
- const u8 = this._textureRepository.acquire(e24);
- if (k(u8))
- return ++this._numLoading, void u8.then((e25) => {
- if (this._disposed)
- return p(e25), void r15(null);
- r15(e25);
- }).finally(() => --this._numLoading);
- r15(u8);
- }
- };
- var o10 = class extends t2 {
- constructor(t10 = null, e24 = null, s9 = null, i12 = null, r15 = null) {
- super(), this.texture = t10, this.textureNormal = e24, this.textureEmissive = s9, this.textureOcclusion = i12, this.textureMetallicRoughness = r15;
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
- var u2 = r5(0, 0.6, 0.2);
- var l;
- !function(e24) {
- e24[e24.Disabled = 0] = "Disabled", e24[e24.Normal = 1] = "Normal", e24[e24.Schematic = 2] = "Schematic", e24[e24.Water = 3] = "Water", e24[e24.WaterOnIntegratedMesh = 4] = "WaterOnIntegratedMesh", e24[e24.COUNT = 5] = "COUNT";
- }(l || (l = {}));
- function d2(e24, n15) {
- const u8 = e24.fragment, m8 = n15.hasMetalnessAndRoughnessTexture || n15.hasEmissionTexture || n15.hasOcclusionTexture;
- if (n15.pbrMode === l.Normal && m8 && e24.include(a4, n15), n15.pbrMode !== l.Schematic)
- if (n15.pbrMode !== l.Disabled) {
- if (n15.pbrMode === l.Normal) {
- u8.code.add(n5`vec3 mrr;
- vec3 emission;
- float occlusion;`);
- const e25 = n15.supportsTextureAtlas, s9 = n15.pbrTextureBindType;
- n15.hasMetalnessAndRoughnessTexture && (u8.uniforms.add(s9 === a3.Pass ? m("texMetallicRoughness", (e26) => e26.textureMetallicRoughness, e25) : m2("texMetallicRoughness", (e26) => e26.textureMetallicRoughness, e25)), u8.code.add(n5`void applyMetallnessAndRoughness(TextureLookupParameter params) {
- vec3 metallicRoughness = textureLookup(texMetallicRoughness, params).rgb;
- mrr[0] *= metallicRoughness.b;
- mrr[1] *= metallicRoughness.g;
- }`)), n15.hasEmissionTexture && (u8.uniforms.add(s9 === a3.Pass ? m("texEmission", (e26) => e26.textureEmissive, e25) : m2("texEmission", (e26) => e26.textureEmissive, e25)), u8.code.add(n5`void applyEmission(TextureLookupParameter params) {
- emission *= textureLookup(texEmission, params).rgb;
- }`)), n15.hasOcclusionTexture ? (u8.uniforms.add(s9 === a3.Pass ? m("texOcclusion", (e26) => e26.textureOcclusion, e25) : m2("texOcclusion", (e26) => e26.textureOcclusion, e25)), u8.code.add(n5`void applyOcclusion(TextureLookupParameter params) {
- occlusion *= textureLookup(texOcclusion, params).r;
- }
- float getBakedOcclusion() {
- return occlusion;
- }`)) : u8.code.add(n5`float getBakedOcclusion() { return 1.0; }`), u8.uniforms.add(s9 === a3.Pass ? [new e8("emissionFactor", (e26) => e26.emissiveFactor), new e8("mrrFactors", (e26) => e26.mrrFactors)] : [new o8("emissionFactor", (e26) => e26.emissiveFactor), new o8("mrrFactors", (e26) => e26.mrrFactors)]), u8.code.add(n5`
- void applyPBRFactors() {
- mrr = mrrFactors;
- emission = emissionFactor;
- occlusion = 1.0;
- ${m8 ? "vtc.uv = vuv0;" : ""}
- ${n15.hasMetalnessAndRoughnessTexture ? n15.supportsTextureAtlas ? "vtc.size = texMetallicRoughnessSize; applyMetallnessAndRoughness(vtc);" : "applyMetallnessAndRoughness(vtc);" : ""}
- ${n15.hasEmissionTexture ? n15.supportsTextureAtlas ? "vtc.size = texEmissionSize; applyEmission(vtc);" : "applyEmission(vtc);" : ""}
- ${n15.hasOcclusionTexture ? n15.supportsTextureAtlas ? "vtc.size = texOcclusionSize; applyOcclusion(vtc);" : "applyOcclusion(vtc);" : ""}
- }
- `);
- }
- } else
- u8.code.add(n5`float getBakedOcclusion() { return 1.0; }`);
- else
- u8.code.add(n5`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 o11(o24) {
- o24.attributes.add(O.POSITION, "vec3"), o24.vertex.code.add(n5`vec3 positionModel() { return position; }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js
- var e10 = class extends i3 {
- constructor(r15, e24) {
- super(r15, "mat4", a3.Pass, (s9, o24, t10) => s9.setUniformMatrix4fv(r15, e24(o24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl.js
- function i4({ code: e24 }, i12) {
- i12.doublePrecisionRequiresObfuscation ? e24.add(n5`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;
- }`) : e24.add(n5`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 r7(c14) {
- return !!a("force-double-precision-obfuscation") || c14.driverTest.doublePrecisionRequiresObfuscation;
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js
- var o12 = class extends i3 {
- constructor(r15, o24) {
- super(r15, "mat3", a3.Draw, (e24, s9, t10) => e24.setUniformMatrix3fv(r15, o24(s9, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js
- var e11 = class extends i3 {
- constructor(r15, e24) {
- super(r15, "mat3", a3.Pass, (s9, o24, t10) => s9.setUniformMatrix3fv(r15, e24(o24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js
- function F(r15, o24) {
- r15.include(o11);
- const e24 = r15.vertex;
- e24.include(i4, o24), r15.varyings.add("vPositionWorldCameraRelative", "vec3"), r15.varyings.add("vPosition_view", "vec3"), e24.uniforms.add([new e8("transformWorldFromViewTH", (r16) => r16.transformWorldFromViewTH), new e8("transformWorldFromViewTL", (r16) => r16.transformWorldFromViewTL), new e11("transformViewFromCameraRelativeRS", (r16) => r16.transformViewFromCameraRelativeRS), new e10("transformProjFromView", (r16) => r16.transformProjFromView), new o12("transformWorldFromModelRS", (r16) => r16.transformWorldFromModelRS), new o8("transformWorldFromModelTH", (r16) => r16.transformWorldFromModelTH), new o8("transformWorldFromModelTL", (r16) => r16.transformWorldFromModelTL)]), e24.code.add(n5`vec3 positionWorldCameraRelative() {
- vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
- vec3 transform_CameraRelativeFromModel = dpAdd(
- transformWorldFromModelTL,
- transformWorldFromModelTH,
- -transformWorldFromViewTL,
- -transformWorldFromViewTH
- );
- return transform_CameraRelativeFromModel + rotatedModelPosition;
- }`), e24.code.add(n5`
- void forwardPosition(float fOffset) {
- vPositionWorldCameraRelative = positionWorldCameraRelative();
- if (fOffset != 0.0) {
- vPositionWorldCameraRelative += fOffset * ${o24.spherical ? n5`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)` : n5`vec3(0.0, 0.0, 1.0)`};
- }
- vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
- gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
- }
- `), r15.fragment.uniforms.add(new e8("transformWorldFromViewTL", (r16) => r16.transformWorldFromViewTL)), e24.code.add(n5`vec3 positionWorld() {
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
- }`), r15.fragment.code.add(n5`vec3 positionWorld() {
- return transformWorldFromViewTL + vPositionWorldCameraRelative;
- }`);
- }
- var c6 = class extends t2 {
- constructor() {
- super(...arguments), this.transformWorldFromViewTH = n(), this.transformWorldFromViewTL = n(), this.transformViewFromCameraRelativeRS = e4(), this.transformProjFromView = e5();
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js
- function n7(r15, o24) {
- if (o24.normalType === i2.Attribute || o24.normalType === i2.CompressedAttribute) {
- r15.include(o6, o24), r15.varyings.add("vNormalWorld", "vec3"), r15.varyings.add("vNormalView", "vec3");
- r15.vertex.uniforms.add([new o12("transformNormalGlobalFromModel", (r16) => r16.transformNormalGlobalFromModel), new e11("transformNormalViewFromGlobal", (r16) => r16.transformNormalViewFromGlobal)]), r15.vertex.code.add(n5`void forwardNormal() {
- vNormalWorld = transformNormalGlobalFromModel * normalModel();
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;
- }`);
- } else
- o24.normalType === i2.Ground ? (r15.include(F, o24), r15.varyings.add("vNormalWorld", "vec3"), r15.vertex.code.add(n5`
- void forwardNormal() {
- vNormalWorld = ${o24.spherical ? n5`normalize(vPositionWorldCameraRelative);` : n5`vec3(0.0, 0.0, 1.0);`}
- }
- `)) : r15.vertex.code.add(n5`void forwardNormal() {}`);
- }
- var f3 = class extends c6 {
- constructor() {
- super(...arguments), this.transformNormalViewFromGlobal = e4();
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js
- var o13 = 0.1;
- var t5 = 1e-3;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js
- function t6(t10, i12) {
- i12.output === o4.Color && i12.receiveShadows ? (t10.varyings.add("linearDepth", "float"), t10.vertex.code.add(n5`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)) : i12.output === o4.Depth || i12.output === o4.Shadow ? (t10.include(F, i12), t10.varyings.add("linearDepth", "float"), t10.vertex.uniforms.add(new e9("nearFar", (e24, r15) => r15.camera.nearFar)), t10.vertex.code.add(n5`void forwardLinearDepth() {
- linearDepth = (-vPosition_view.z - nearFar[0]) / (nearFar[1] - nearFar[0]);
- }`)) : t10.vertex.code.add(n5`void forwardLinearDepth() {}`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js
- function e12(e24) {
- e24.vertex.code.add(n5`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 u3(s9, i12) {
- H(s9, i12, [new o8("slicePlaneOrigin", (e24, s10) => v(i12, e24, s10)), new o8("slicePlaneBasis1", (s10, a14) => B(i12, s10, a14, e(a14.slicePlane)?.basis1)), new o8("slicePlaneBasis2", (s10, a14) => B(i12, s10, a14, e(a14.slicePlane)?.basis2))]);
- }
- function H(e24, s9, i12) {
- if (!s9.hasSlicePlane) {
- const i13 = n5`#define rejectBySlice(_pos_) false
- #define discardBySlice(_pos_) {}
- #define highlightSlice(_color_, _pos_) (_color_)`;
- return s9.hasSliceInVertexProgram && e24.vertex.code.add(i13), void e24.fragment.code.add(i13);
- }
- e24.extensions.add("GL_OES_standard_derivatives"), s9.hasSliceInVertexProgram && e24.vertex.uniforms.add(i12), e24.fragment.uniforms.add(i12);
- const a14 = n5`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; }`, o24 = n5`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);
- }`, c14 = s9.hasSliceHighlight ? n5`
- ${o24}
- #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
- ` : n5`#define highlightSlice(_color_, _pos_) (_color_)`;
- s9.hasSliceInVertexProgram && e24.vertex.code.add(a14), e24.fragment.code.add(a14), e24.fragment.code.add(c14);
- }
- function g(e24, s9, i12) {
- return e24.instancedDoublePrecision ? o(S, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]) : s9.slicePlaneLocalOrigin;
- }
- function I(e24, s9) {
- return r(e24) ? e3(L2, s9.origin, e24) : s9.origin;
- }
- function b(e24, s9, o24) {
- return e24.hasSliceTranslatedView ? r(s9) ? c2(T, o24.camera.viewMatrix, s9) : o24.camera.viewMatrix : null;
- }
- function v(e24, a14, o24) {
- if (t(o24.slicePlane))
- return f;
- const c14 = g(e24, a14, o24), r15 = I(c14, o24.slicePlane), t10 = b(e24, c14, o24);
- return r(t10) ? L(L2, r15, t10) : r15;
- }
- function B(e24, a14, o24, c14) {
- if (t(c14) || t(o24.slicePlane))
- return f;
- const f7 = g(e24, a14, o24), d8 = I(f7, o24.slicePlane), _3 = b(e24, f7, o24);
- return r(_3) ? (u(G, c14, d8), L(L2, d8, _3), L(G, G, _3), e3(G, G, L2)) : c14;
- }
- var S = n();
- var L2 = n();
- var G = n();
- var T = e5();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js
- function r8(r15, o24 = { hasModelTransformation: false, linearDepth: false }) {
- if (o24.hasModelTransformation)
- return o24.linearDepth ? void r15.vertex.code.add(n5`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
- vec4 eye = view * (model * vec4(pos, 1.0));
- depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;
- return proj * eye;
- }`) : void r15.vertex.code.add(n5`vec4 transformPosition(mat4 proj, mat4 view, mat4 model, vec3 pos) {
- return proj * (view * (model * vec4(pos, 1.0)));
- }`);
- o24.linearDepth ? r15.vertex.code.add(n5`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
- vec4 eye = view * vec4(pos, 1.0);
- depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;
- return proj * eye;
- }`) : r15.vertex.code.add(n5`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
- return proj * (view * vec4(pos, 1.0));
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js
- function m3(r15, m8) {
- m8.instanced && m8.instancedDoublePrecision && (r15.attributes.add(O.MODELORIGINHI, "vec3"), r15.attributes.add(O.MODELORIGINLO, "vec3"), r15.attributes.add(O.MODEL, "mat3"), r15.attributes.add(O.MODELNORMAL, "mat3"));
- const u8 = r15.vertex;
- m8.instancedDoublePrecision && (u8.include(i4, m8), u8.uniforms.add(new o8("viewOriginHi", (r16, i12) => o3(o(l2, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]), l2))), u8.uniforms.add(new o8("viewOriginLo", (r16, i12) => r6(o(l2, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]), l2)))), u8.code.add(n5`
- vec3 calculateVPos() {
- ${m8.instancedDoublePrecision ? "return model * localPosition().xyz;" : "return localPosition().xyz;"}
- }
- `), u8.code.add(n5`
- vec3 subtractOrigin(vec3 _pos) {
- ${m8.instancedDoublePrecision ? n5`
- vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);
- return _pos - originDelta;` : "return vpos;"}
- }
- `), u8.code.add(n5`
- vec3 dpNormal(vec4 _normal) {
- ${m8.instancedDoublePrecision ? "return normalize(modelNormal * _normal.xyz);" : "return normalize(_normal.xyz);"}
- }
- `), m8.output === o4.Normal && (u8.uniforms.add(new e10("viewNormal", (e24, r16) => r16.camera.viewInverseTransposeMatrix)), u8.code.add(n5`
- vec3 dpNormalView(vec4 _normal) {
- ${m8.instancedDoublePrecision ? "return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);" : "return normalize((viewNormal * _normal).xyz);"}
- }
- `)), m8.hasVertexTangents && u8.code.add(n5`
- vec4 dpTransformVertexTangent(vec4 _tangent) {
- ${m8.instancedDoublePrecision ? "return vec4(modelNormal * _tangent.xyz, _tangent.w);" : "return _tangent;"}
- }
- `);
- }
- var l2 = n();
- // node_modules/@arcgis/core/views/3d/layers/support/symbolColorUtils.js
- var r9;
- !function(t10) {
- t10[t10.Multiply = 1] = "Multiply", t10[t10.Ignore = 2] = "Ignore", t10[t10.Replace = 3] = "Replace", t10[t10.Tint = 4] = "Tint";
- }(r9 || (r9 = {}));
- var a5 = 85;
- var u4 = 2 * a5;
- // node_modules/@arcgis/core/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl.js
- function e13(e24) {
- e24.vertex.code.add(n5`
- 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 = ${n5.int(r9.Multiply)};
- symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
- } else if (symbolColor.a > maxTint) {
- colorMixMode = ${n5.int(r9.Replace)};
- symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
- } else if (symbolColor.a > 0.0) {
- colorMixMode = ${n5.int(r9.Tint)};
- symbolAlpha = scaleAlpha * symbolColor.a;
- } else {
- colorMixMode = ${n5.int(r9.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 e14 = class extends i3 {
- constructor(r15, e24) {
- super(r15, "int", a3.Pass, (s9, o24, i12) => s9.setUniform1i(r15, e24(o24, i12)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js
- function l4(e24) {
- return Math.abs(e24 * e24 * e24);
- }
- function s4(e24, t10, a14) {
- const i12 = a14.parameters, r15 = a14.paddingPixelsOverride;
- return x.scale = Math.min(i12.divisor / (t10 - i12.offset), 1), x.factor = l4(e24), x.minPixelSize = i12.minPixelSize, x.paddingPixels = r15, x;
- }
- function c7(e24, t10) {
- return e24 === 0 ? t10.minPixelSize : t10.minPixelSize * (1 + 2 * t10.paddingPixels / e24);
- }
- function o14(t10, a14) {
- return Math.max(s3(t10 * a14.scale, t10, a14.factor), c7(t10, a14));
- }
- function m4(e24, t10, a14, i12) {
- return o14(e24, s4(t10, a14, i12));
- }
- var h2 = { 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 x = { scale: 0, factor: 0, minPixelSize: 0, paddingPixels: 0 };
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/renderers/utils.js
- function u6(t10) {
- return !!r(t10) && !t10.visible;
- }
- var g2 = new Float64Array(3);
- var b2 = new Float32Array(6);
- var j = e5();
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/MaterialUtil.js
- var g3 = a2();
- function x2(t10, n15, e24, o24, i12, r15, s9) {
- if (!u6(n15))
- if (t10.boundingInfo) {
- e7(t10.primitiveType === c3.Triangle);
- const n16 = e24.tolerance;
- M2(t10.boundingInfo, o24, i12, n16, r15, s9);
- } else {
- const n16 = t10.indices.get(O.POSITION), e25 = t10.vertexAttributes.get(O.POSITION);
- v2(o24, i12, 0, n16.length / 3, n16, e25, void 0, r15, s9);
- }
- }
- var b3 = n();
- function M2(t10, n15, i12, r15, s9, c14) {
- if (t(t10))
- return;
- const f7 = N(n15, i12, b3);
- if (q(g3, t10.getBBMin()), w(g3, t10.getBBMax()), r(s9) && s9.applyToAabb(g3), O2(g3, n15, f7, r15)) {
- const { primitiveIndices: e24, indices: o24, position: f8 } = t10, a14 = e24 ? e24.length : o24.length / 3;
- if (a14 > W2) {
- const e25 = t10.getChildren();
- if (e25 !== void 0) {
- for (let t11 = 0; t11 < 8; ++t11)
- e25[t11] !== void 0 && M2(e25[t11], n15, i12, r15, s9, c14);
- return;
- }
- }
- v2(n15, i12, 0, a14, o24, f8, e24, s9, c14);
- }
- }
- var y = n();
- function v2(t10, n15, e24, i12, r15, s9, c14, f7, a14) {
- if (c14)
- return I2(t10, n15, e24, i12, r15, s9, c14, f7, a14);
- const l8 = s9.data, u8 = s9.stride || s9.size, m8 = t10[0], p4 = t10[1], h8 = t10[2], d8 = n15[0] - m8, g5 = n15[1] - p4, x3 = n15[2] - h8;
- for (let b4 = e24, M4 = 3 * e24; b4 < i12; ++b4) {
- let t11 = u8 * r15[M4++], n16 = l8[t11++], e25 = l8[t11++], i13 = l8[t11];
- t11 = u8 * r15[M4++];
- let s10 = l8[t11++], c15 = l8[t11++], v5 = l8[t11];
- t11 = u8 * r15[M4++];
- let I3 = l8[t11++], T3 = l8[t11++], j4 = l8[t11];
- r(f7) && ([n16, e25, i13] = f7.applyToVertex(n16, e25, i13, b4), [s10, c15, v5] = f7.applyToVertex(s10, c15, v5, b4), [I3, T3, j4] = f7.applyToVertex(I3, T3, j4, b4));
- const N2 = s10 - n16, O3 = c15 - e25, V2 = v5 - i13, L4 = I3 - n16, S3 = T3 - e25, B3 = j4 - i13, E2 = g5 * B3 - S3 * x3, P3 = x3 * L4 - B3 * d8, U2 = d8 * S3 - L4 * g5, W3 = N2 * E2 + O3 * P3 + V2 * U2;
- if (Math.abs(W3) <= Number.EPSILON)
- continue;
- const z2 = m8 - n16, k2 = p4 - e25, R = h8 - i13, C2 = z2 * E2 + k2 * P3 + R * U2;
- if (W3 > 0) {
- if (C2 < 0 || C2 > W3)
- continue;
- } else if (C2 > 0 || C2 < W3)
- continue;
- const H2 = k2 * V2 - O3 * R, X = R * N2 - V2 * z2, Y = z2 * O3 - N2 * k2, Z = d8 * H2 + g5 * X + x3 * Y;
- if (W3 > 0) {
- if (Z < 0 || C2 + Z > W3)
- continue;
- } else if (Z > 0 || C2 + Z < W3)
- continue;
- const _3 = (L4 * H2 + S3 * X + B3 * Y) / W3;
- if (_3 >= 0) {
- a14(_3, A(N2, O3, V2, L4, S3, B3, y), b4, false);
- }
- }
- }
- function I2(t10, n15, e24, i12, r15, s9, c14, f7, a14) {
- const l8 = s9.data, u8 = s9.stride || s9.size, m8 = t10[0], p4 = t10[1], h8 = t10[2], d8 = n15[0] - m8, g5 = n15[1] - p4, x3 = n15[2] - h8;
- for (let b4 = e24; b4 < i12; ++b4) {
- const t11 = c14[b4];
- let n16 = 3 * t11, e25 = u8 * r15[n16++], i13 = l8[e25++], s10 = l8[e25++], M4 = l8[e25];
- e25 = u8 * r15[n16++];
- let v5 = l8[e25++], I3 = l8[e25++], T3 = l8[e25];
- e25 = u8 * r15[n16];
- let j4 = l8[e25++], N2 = l8[e25++], O3 = l8[e25];
- r(f7) && ([i13, s10, M4] = f7.applyToVertex(i13, s10, M4, b4), [v5, I3, T3] = f7.applyToVertex(v5, I3, T3, b4), [j4, N2, O3] = f7.applyToVertex(j4, N2, O3, b4));
- const V2 = v5 - i13, L4 = I3 - s10, S3 = T3 - M4, B3 = j4 - i13, E2 = N2 - s10, P3 = O3 - M4, U2 = g5 * P3 - E2 * x3, W3 = x3 * B3 - P3 * d8, z2 = d8 * E2 - B3 * g5, k2 = V2 * U2 + L4 * W3 + S3 * z2;
- if (Math.abs(k2) <= Number.EPSILON)
- continue;
- const R = m8 - i13, C2 = p4 - s10, H2 = h8 - M4, X = R * U2 + C2 * W3 + H2 * z2;
- if (k2 > 0) {
- if (X < 0 || X > k2)
- continue;
- } else if (X > 0 || X < k2)
- continue;
- const Y = C2 * S3 - L4 * H2, Z = H2 * V2 - S3 * R, _3 = R * L4 - V2 * C2, q3 = d8 * Y + g5 * Z + x3 * _3;
- if (k2 > 0) {
- if (q3 < 0 || X + q3 > k2)
- continue;
- } else if (q3 > 0 || X + q3 < k2)
- continue;
- const w2 = (B3 * Y + E2 * Z + P3 * _3) / k2;
- if (w2 >= 0) {
- a14(w2, A(V2, L4, S3, B3, E2, P3, y), t11, false);
- }
- }
- }
- var T2 = n();
- var j2 = n();
- function A(t10, n15, e24, o24, c14, f7, a14) {
- return o(T2, t10, n15, e24), o(j2, o24, c14, f7), _(a14, T2, j2), z(a14, a14), a14;
- }
- function N(t10, n15, e24) {
- return o(e24, 1 / (n15[0] - t10[0]), 1 / (n15[1] - t10[1]), 1 / (n15[2] - t10[2]));
- }
- function O2(t10, n15, e24, o24) {
- return V(t10, n15, e24, o24, 1 / 0);
- }
- function V(t10, n15, e24, o24, i12) {
- const r15 = (t10[0] - o24 - n15[0]) * e24[0], s9 = (t10[3] + o24 - n15[0]) * e24[0];
- let c14 = Math.min(r15, s9), f7 = Math.max(r15, s9);
- const a14 = (t10[1] - o24 - n15[1]) * e24[1], l8 = (t10[4] + o24 - n15[1]) * e24[1];
- if (f7 = Math.min(f7, Math.max(a14, l8)), f7 < 0)
- return false;
- if (c14 = Math.max(c14, Math.min(a14, l8)), c14 > f7)
- return false;
- const u8 = (t10[2] - o24 - n15[2]) * e24[2], m8 = (t10[5] + o24 - n15[2]) * e24[2];
- return f7 = Math.min(f7, Math.max(u8, m8)), !(f7 < 0) && (c14 = Math.max(c14, Math.min(u8, m8)), !(c14 > f7) && c14 < i12);
- }
- function L3(t10, e24, i12, r15, s9) {
- let c14 = (i12.screenLength || 0) * t10.pixelRatio;
- r(s9) && (c14 = m4(c14, r15, e24, s9));
- const f7 = c14 * Math.tan(0.5 * t10.fovY) / (0.5 * t10.fullHeight);
- return o2(f7 * e24, i12.minWorldLength || 0, i12.maxWorldLength != null ? i12.maxWorldLength : 1 / 0);
- }
- function S2(t10, n15) {
- const e24 = n15 ? S2(n15) : {};
- for (const o24 in t10) {
- let n16 = t10[o24];
- n16 && n16.forEach && (n16 = P(n16)), n16 == null && o24 in e24 || (e24[o24] = n16);
- }
- return e24;
- }
- function B2(n15, e24) {
- let o24 = false;
- for (const i12 in e24) {
- const r15 = e24[i12];
- r15 !== void 0 && (Array.isArray(r15) ? n15[i12] === null ? (n15[i12] = r15.slice(), o24 = true) : c(n15[i12], r15) && (o24 = true) : n15[i12] !== r15 && (o24 = true, n15[i12] = r15));
- }
- return o24;
- }
- function P(t10) {
- const n15 = [];
- return t10.forEach((t11) => n15.push(t11)), n15;
- }
- var U = { multiply: 1, ignore: 2, replace: 3, tint: 4 };
- var W2 = 1e3;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js
- function i5(i12, t10) {
- t10.hasSymbolColors ? (i12.include(e13), i12.attributes.add(O.SYMBOLCOLOR, "vec4"), i12.varyings.add("colorMixMode", "mediump float"), i12.vertex.code.add(n5`int symbolColorMixMode;
- vec4 getSymbolColor() {
- return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
- }
- void forwardColorMixMode() {
- colorMixMode = float(symbolColorMixMode) + 0.5;
- }`)) : (i12.fragment.uniforms.add(new e14("colorMixMode", (o24) => U[o24.colorMixMode])), i12.vertex.code.add(n5`vec4 getSymbolColor() { return vec4(1.0); }
- void forwardColorMixMode() {}`));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js
- function e15(e24, d8) {
- d8.hasVertexColors ? (e24.attributes.add(O.COLOR, "vec4"), e24.varyings.add("vColor", "vec4"), e24.vertex.code.add(n5`void forwardVertexColor() { vColor = color; }`), e24.vertex.code.add(n5`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)) : e24.vertex.code.add(n5`void forwardVertexColor() {}
- void forwardNormalizedVertexColor() {}`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js
- var e16 = class extends i3 {
- constructor(r15, e24) {
- super(r15, "vec4", a3.Pass, (s9, o24, t10) => s9.setUniform4fv(r15, e24(o24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js
- var o16 = class extends i3 {
- constructor(r15, o24) {
- super(r15, "mat4", a3.Draw, (e24, s9, t10) => e24.setUniformMatrix4fv(r15, o24(s9, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js
- function c8(r15, e24) {
- e24.instancedDoublePrecision ? r15.constants.add("cameraPosition", "vec3", f) : r15.uniforms.add(new o8("cameraPosition", (r16, e25) => o(f4, e25.camera.viewInverseTransposeMatrix[3] - r16.origin[0], e25.camera.viewInverseTransposeMatrix[7] - r16.origin[1], e25.camera.viewInverseTransposeMatrix[11] - r16.origin[2])));
- }
- function d3(e24, i12) {
- if (e24.vertex.uniforms.add(new e10("proj", (r15, e25) => e25.camera.projectionMatrix)), i12.instancedDoublePrecision) {
- const i13 = (r15, e25) => o(f4, e25.camera.viewInverseTransposeMatrix[3], e25.camera.viewInverseTransposeMatrix[7], e25.camera.viewInverseTransposeMatrix[11]);
- e24.vertex.uniforms.add(new e10("view", (e25, a14) => c2(v3, a14.camera.viewMatrix, i13(e25, a14))));
- const s10 = new e8("localOrigin", i13);
- return e24.vertex.uniforms.add(s10), s10;
- }
- e24.vertex.uniforms.add(new o16("view", (e25, a14) => c2(v3, a14.camera.viewMatrix, e25.origin)));
- const s9 = new o8("localOrigin", (r15) => r15.origin);
- return e24.vertex.uniforms.add(s9), s9;
- }
- var v3 = e6();
- var f4 = n();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js
- function c9(e24) {
- e24.vertex.code.add(n5`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)
- )
- )
- );
- }`), e24.vertex.code.add(n5`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
- return absCosAngle * absCosAngle * absCosAngle;
- }`), e24.vertex.code.add(n5`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {
- return vec4(
- min(params.x / (distanceToCamera - params.y), 1.0),
- screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
- params.z,
- params.w
- );
- }`), e24.vertex.code.add(n5`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {
- return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));
- }`), e24.vertex.code.add(n5`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {
- return applyScreenSizePerspectiveScaleFactorFloat(
- size,
- screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
- );
- }`), e24.vertex.code.add(n5`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);
- }`), e24.vertex.code.add(n5`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {
- return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
- }`);
- }
- function i6(e24) {
- e24.uniforms.add(new e16("screenSizePerspectiveAlignment", (e25) => o17(e25.screenSizePerspectiveAlignment || e25.screenSizePerspective)));
- }
- function o17(a14) {
- return r2(n9, a14.parameters.divisor, a14.parameters.offset, a14.parameters.minPixelSize, a14.paddingPixelsOverride);
- }
- var n9 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js
- function a6(e24, r15) {
- const c14 = e24.vertex;
- r15.hasVerticalOffset ? (f5(c14), r15.hasScreenSizePerspective && (e24.include(c9), i6(c14), c8(e24.vertex, r15)), c14.code.add(n5`
- vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
- float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
- ${r15.spherical ? n5`vec3 worldNormal = normalize(worldPos + localOrigin);` : n5`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
- ${r15.hasScreenSizePerspective ? n5`
- float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
- float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);` : n5`
- 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);
- }
- `)) : c14.code.add(n5`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`);
- }
- var i7 = n2();
- function f5(r15) {
- r15.uniforms.add(new e16("verticalOffset", (r16, t10) => {
- const { minWorldLength: l8, maxWorldLength: o24, screenLength: c14 } = r16.verticalOffset, s9 = Math.tan(0.5 * t10.camera.fovY) / (0.5 * t10.camera.fullViewport[3]), a14 = t10.camera.pixelRatio || 1;
- return r2(i7, c14 * a14, s9, l8, o24);
- }));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js
- var e17 = class extends i3 {
- constructor(r15, e24, o24) {
- super(r15, "vec4", a3.Pass, (s9, o25, t10) => s9.setUniform4fv(r15, e24(o25, t10)), o24);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js
- var o18 = class extends i3 {
- constructor(r15, o24, e24) {
- super(r15, "float", a3.Pass, (s9, e25, t10) => s9.setUniform1fv(r15, o24(e25, t10)), e24);
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObject.js
- var r10 = class {
- constructor() {
- this.id = e2();
- }
- unload() {
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObjectType.js
- var e18;
- !function(e24) {
- e24[e24.Layer = 0] = "Layer", e24[e24.Object = 1] = "Object", e24[e24.Geometry = 2] = "Geometry", e24[e24.Material = 3] = "Material", e24[e24.Texture = 4] = "Texture", e24[e24.COUNT = 5] = "COUNT";
- }(e18 || (e18 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js
- var E = new Map([[O.POSITION, 0], [O.NORMAL, 1], [O.UV0, 2], [O.COLOR, 3], [O.SIZE, 4], [O.TANGENT, 4], [O.AUXPOS1, 5], [O.SYMBOLCOLOR, 5], [O.AUXPOS2, 6], [O.FEATUREATTRIBUTE, 6], [O.INSTANCEFEATUREATTRIBUTE, 6], [O.INSTANCECOLOR, 7], [O.MODEL, 8], [O.MODELNORMAL, 12], [O.MODELORIGINHI, 11], [O.MODELORIGINLO, 15]]);
- // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Material.js
- var d4 = class extends r10 {
- constructor(e24, r15) {
- super(), this.type = e18.Material, this.supportsEdges = false, this._visible = true, this._renderPriority = 0, this._insertOrder = 0, this._vertexAttributeLocations = E, this._parameters = S2(e24, r15), this.validateParameters(this._parameters);
- }
- dispose() {
- }
- get parameters() {
- return this._parameters;
- }
- update(e24) {
- return false;
- }
- setParameters(e24, r15 = true) {
- B2(this._parameters, e24) && (this.validateParameters(this._parameters), r15 && this.parametersChanged());
- }
- validateParameters(e24) {
- }
- get visible() {
- return this._visible;
- }
- set visible(e24) {
- e24 !== this._visible && (this._visible = e24, this.parametersChanged());
- }
- shouldRender(e24) {
- return this.isVisible() && this.isVisibleInPass(e24.pass) && (this.renderOccluded & e24.renderOccludedMask) != 0;
- }
- isVisibleInPass(e24) {
- return true;
- }
- get renderOccluded() {
- return this.parameters.renderOccluded;
- }
- get renderPriority() {
- return this._renderPriority;
- }
- set renderPriority(e24) {
- e24 !== this._renderPriority && (this._renderPriority = e24, this.parametersChanged());
- }
- get insertOrder() {
- return this._insertOrder;
- }
- set insertOrder(e24) {
- e24 !== this._insertOrder && (this._insertOrder = e24, this.parametersChanged());
- }
- get vertexAttributeLocations() {
- return this._vertexAttributeLocations;
- }
- isVisible() {
- return this._visible;
- }
- parametersChanged() {
- r(this.repository) && this.repository.materialChanged(this);
- }
- };
- var h5;
- !function(e24) {
- e24[e24.Occlude = 1] = "Occlude", e24[e24.Transparent = 2] = "Transparent", e24[e24.OccludeAndTransparent = 4] = "OccludeAndTransparent", e24[e24.OccludeAndTransparentStencil = 8] = "OccludeAndTransparentStencil", e24[e24.Opaque = 16] = "Opaque";
- }(h5 || (h5 = {}));
- // node_modules/@arcgis/core/views/3d/webgl-engine/materials/VisualVariablePassParameters.js
- var o20 = 8;
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js
- function s5(s9, n15) {
- n15.hasVvInstancing && (n15.vvSize || n15.vvColor) && s9.attributes.add(O.INSTANCEFEATUREATTRIBUTE, "vec4");
- const l8 = s9.vertex;
- n15.vvSize ? (l8.uniforms.add(new e8("vvSizeMinSize", (e24) => e24.vvSizeMinSize)), l8.uniforms.add(new e8("vvSizeMaxSize", (e24) => e24.vvSizeMaxSize)), l8.uniforms.add(new e8("vvSizeOffset", (e24) => e24.vvSizeOffset)), l8.uniforms.add(new e8("vvSizeFactor", (e24) => e24.vvSizeFactor)), l8.uniforms.add(new e11("vvSymbolRotationMatrix", (e24) => e24.vvSymbolRotationMatrix)), l8.uniforms.add(new e8("vvSymbolAnchor", (e24) => e24.vvSymbolAnchor)), l8.code.add(n5`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(n5`
- 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);
- }
- ${n15.hasVvInstancing ? n5`
- vec4 vvLocalNormal(vec3 _normal) {
- return vvTransformNormal(_normal, instanceFeatureAttribute);
- }
- vec4 localPosition() {
- return vvTransformPosition(position, instanceFeatureAttribute);
- }` : ""}
- `)) : l8.code.add(n5`vec4 localPosition() { return vec4(position, 1.0); }
- vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`), n15.vvColor ? (l8.constants.add("vvColorNumber", "int", o20), n15.hasVvInstancing && l8.uniforms.add([new o18("vvColorValues", (e24) => e24.vvColorValues, o20), new e17("vvColorColors", (e24) => e24.vvColorColors, o20)]), l8.code.add(n5`
- 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];
- }
- ${n15.hasVvInstancing ? n5`
- vec4 vvColor() {
- return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);
- }` : ""}
- `)) : l8.code.add(n5`vec4 vvColor() { return vec4(1.0); }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js
- var o21 = class extends i3 {
- constructor(r15, o24) {
- super(r15, "float", a3.Pass, (s9, e24, t10) => s9.setUniform1f(r15, o24(e24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js
- function d5(d8) {
- d8.fragment.code.add(n5`
- #define discardOrAdjustAlpha(color) { if (color.a < ${n5.float(t5)}) { discard; } }
- `);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js
- function s6(a14, e24) {
- l5(a14, e24, new o21("textureAlphaCutoff", (a15) => a15.textureAlphaCutoff));
- }
- function l5(e24, r15, s9) {
- const t10 = e24.fragment;
- switch (r15.alphaDiscardMode !== C.Mask && r15.alphaDiscardMode !== C.MaskBlend || t10.uniforms.add(s9), r15.alphaDiscardMode) {
- case C.Blend:
- return e24.include(d5);
- case C.Opaque:
- t10.code.add(n5`void discardOrAdjustAlpha(inout vec4 color) {
- color.a = 1.0;
- }`);
- break;
- case C.Mask:
- t10.code.add(n5`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);
- break;
- case C.MaskBlend:
- e24.fragment.code.add(n5`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`);
- }
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js
- function a7(a14) {
- a14.code.add(n5`const float MAX_RGBA_FLOAT =
- 255.0 / 256.0 +
- 255.0 / 256.0 / 256.0 +
- 255.0 / 256.0 / 256.0 / 256.0 +
- 255.0 / 256.0 / 256.0 / 256.0 / 256.0;
- const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
- vec4 float2rgba(const float value) {
- float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
- vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
- const float toU8AsFloat = 1.0 / 255.0;
- return fixedPointU8 * toU8AsFloat;
- }
- const vec4 RGBA_2_FLOAT_FACTORS = vec4(
- 255.0 / (256.0),
- 255.0 / (256.0 * 256.0),
- 255.0 / (256.0 * 256.0 * 256.0),
- 255.0 / (256.0 * 256.0 * 256.0 * 256.0)
- );
- float rgba2float(vec4 rgba) {
- return dot(rgba, RGBA_2_FLOAT_FACTORS);
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js
- function e20(e24, l8) {
- e24.fragment.include(a7), l8.output === o4.Shadow ? (e24.extensions.add("GL_OES_standard_derivatives"), e24.fragment.code.add(n5`float _calculateFragDepth(const in float depth) {
- const float SLOPE_SCALE = 2.0;
- const float BIAS = 2.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));
- }`)) : l8.output === o4.Depth && e24.fragment.code.add(n5`void outputDepth(float _linearDepth) {
- gl_FragColor = float2rgba(_linearDepth);
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js
- var d6 = r3(1, 1, 0, 1);
- var g4 = r3(1, 0, 1, 1);
- function a8(e24) {
- e24.fragment.uniforms.add(new c4("depthTex", (e25, o24) => o24.highlightDepthTexture)), e24.fragment.uniforms.add(new e9("highlightViewportPixelSz", (e25, o24) => o24.inverseViewport)), e24.fragment.constants.add("occludedHighlightFlag", "vec4", d6).add("unoccludedHighlightFlag", "vec4", g4), e24.fragment.code.add(n5`void outputHighlight() {
- vec4 fragCoord = gl_FragCoord;
- float sceneDepth = texture2D(depthTex, fragCoord.xy * highlightViewportPixelSz.xy).r;
- 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 f6(f7, h8) {
- const g5 = f7.vertex.code, x3 = f7.fragment.code, j4 = h8.hasModelTransformation;
- h8.output !== o4.Depth && h8.output !== o4.Shadow || (d3(f7, h8), f7.include(r8, { linearDepth: true, hasModelTransformation: j4 }), f7.include(d, h8), f7.include(s5, h8), f7.include(e20, h8), f7.include(u3, h8), f7.vertex.uniforms.add(new e9("nearFar", (o24, r15) => r15.camera.nearFar)), f7.varyings.add("depth", "float"), h8.hasColorTexture && f7.fragment.uniforms.add(new c4("tex", (o24) => o24.texture)), g5.add(n5`
- void main(void) {
- vpos = calculateVPos();
- vpos = subtractOrigin(vpos);
- vpos = addVerticalOffset(vpos, localOrigin);
- gl_Position = transformPositionWithDepth(proj, view, ${j4 ? "model," : ""} vpos, nearFar, depth);
- forwardTextureCoordinates();
- }
- `), f7.include(s6, h8), x3.add(n5`
- void main(void) {
- discardBySlice(vpos);
- ${h8.hasColorTexture ? n5`
- vec4 texColor = texture2D(tex, vuv0);
- discardOrAdjustAlpha(texColor);` : ""}
- outputDepth(depth);
- }
- `)), h8.output === o4.Normal && (d3(f7, h8), f7.include(r8, { linearDepth: false, hasModelTransformation: j4 }), f7.include(o6, h8), f7.include(n7, h8), f7.include(d, h8), f7.include(s5, h8), h8.hasColorTexture && f7.fragment.uniforms.add(new c4("tex", (o24) => o24.texture)), f7.varyings.add("vPositionView", "vec3"), g5.add(n5`
- void main(void) {
- vpos = calculateVPos();
- vpos = subtractOrigin(vpos);
- ${h8.normalType === i2.Attribute ? n5`
- vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));` : ""}
- vpos = addVerticalOffset(vpos, localOrigin);
- gl_Position = transformPosition(proj, view, ${j4 ? "model," : ""} vpos);
- forwardTextureCoordinates();
- }
- `), f7.include(u3, h8), f7.include(s6, h8), x3.add(n5`
- void main() {
- discardBySlice(vpos);
- ${h8.hasColorTexture ? n5`
- vec4 texColor = texture2D(tex, vuv0);
- discardOrAdjustAlpha(texColor);` : ""}
- ${h8.normalType === i2.ScreenDerivative ? n5`
- vec3 normal = screenDerivativeNormal(vPositionView);` : n5`
- vec3 normal = normalize(vNormalWorld);
- if (gl_FrontFacing == false) normal = -normal;`}
- gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
- }
- `)), h8.output === o4.Highlight && (d3(f7, h8), f7.include(r8, { linearDepth: false, hasModelTransformation: j4 }), f7.include(d, h8), f7.include(s5, h8), h8.hasColorTexture && f7.fragment.uniforms.add(new c4("tex", (o24) => o24.texture)), g5.add(n5`
- void main(void) {
- vpos = calculateVPos();
- vpos = subtractOrigin(vpos);
- vpos = addVerticalOffset(vpos, localOrigin);
- gl_Position = transformPosition(proj, view, ${j4 ? "model," : ""} vpos);
- forwardTextureCoordinates();
- }
- `), f7.include(u3, h8), f7.include(s6, h8), f7.include(a8), x3.add(n5`
- void main() {
- discardBySlice(vpos);
- ${h8.hasColorTexture ? n5`
- vec4 texColor = texture2D(tex, vuv0);
- discardOrAdjustAlpha(texColor);` : ""}
- outputHighlight();
- }
- `));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js
- function a9(o24, a14) {
- const l8 = o24.fragment;
- a14.receiveAmbientOcclusion ? (l8.uniforms.add([new c4("ssaoTex", (e24, o25) => o25.ssaoHelper.colorTexture), new e16("viewportPixelSz", (o25, r15) => r2(i8, r15.camera.fullViewport[0], r15.camera.fullViewport[1], 1 / r15.ssaoHelper.width, 1 / r15.ssaoHelper.height))]), l8.code.add(n5`float evaluateAmbientOcclusion() {
- return 1.0 - texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
- }
- float evaluateAmbientOcclusionInverse() {
- return texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
- }`)) : l8.code.add(n5`float evaluateAmbientOcclusion() { return 0.0; }
- float evaluateAmbientOcclusionInverse() { return 1.0; }`);
- }
- var i8 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js
- function t8(t10) {
- const a14 = t10.fragment.code;
- a14.add(n5`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
- {
- return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
- }`), a14.add(n5`float integratedRadiance(float cosTheta2, float roughness)
- {
- return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
- }`), a14.add(n5`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 t9(t10) {
- t10.vertex.code.add(n5`const float PI = 3.141592653589793;`), t10.fragment.code.add(n5`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 n10(n15, r15) {
- const l8 = n15.fragment.code;
- n15.include(t9), r15.pbrMode === l.Water || r15.pbrMode === l.WaterOnIntegratedMesh ? (l8.add(n5`
- 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 = ${r15.useCustomDTRExponentForWater ? "2.2" : "2.0"};
- `), l8.add(n5`vec3 fresnelReflection(float angle, vec3 f0, float f90) {
- return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);
- }`), l8.add(n5`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(n5`float geometricOcclusionKelemen(float LoH)
- {
- return 0.25 / (LoH * LoH);
- }`), l8.add(n5`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);
- }`)) : r15.pbrMode !== l.Normal && r15.pbrMode !== l.Schematic || (n15.include(t8), l8.add(n5`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(n5`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(n5`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(n5`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(n5`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(n5`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/lighting/SphericalHarmonics.js
- var P2 = n();
- // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SceneLighting.js
- var c11 = 0.4;
- var a10 = n();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js
- function m5(n15, g5) {
- const m8 = n15.fragment, o24 = g5.lightingSphericalHarmonicsOrder !== void 0 ? g5.lightingSphericalHarmonicsOrder : 2;
- o24 === 0 ? (m8.uniforms.add(new e8("lightingAmbientSH0", (n16, t10) => o(a11, t10.lighting.sh.r[0], t10.lighting.sh.g[0], t10.lighting.sh.b[0]))), m8.code.add(n5`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
- vec3 ambientLight = 0.282095 * lightingAmbientSH0;
- return ambientLight * (1.0 - ambientOcclusion);
- }`)) : o24 === 1 ? (m8.uniforms.add([new e16("lightingAmbientSH_R", (i12, n16) => r2(r14, n16.lighting.sh.r[0], n16.lighting.sh.r[1], n16.lighting.sh.r[2], n16.lighting.sh.r[3])), new e16("lightingAmbientSH_G", (i12, n16) => r2(r14, n16.lighting.sh.g[0], n16.lighting.sh.g[1], n16.lighting.sh.g[2], n16.lighting.sh.g[3])), new e16("lightingAmbientSH_B", (i12, n16) => r2(r14, n16.lighting.sh.b[0], n16.lighting.sh.b[1], n16.lighting.sh.b[2], n16.lighting.sh.b[3]))]), m8.code.add(n5`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);
- }`)) : o24 === 2 && (m8.uniforms.add([new e8("lightingAmbientSH0", (n16, t10) => o(a11, t10.lighting.sh.r[0], t10.lighting.sh.g[0], t10.lighting.sh.b[0])), new e16("lightingAmbientSH_R1", (i12, n16) => r2(r14, n16.lighting.sh.r[1], n16.lighting.sh.r[2], n16.lighting.sh.r[3], n16.lighting.sh.r[4])), new e16("lightingAmbientSH_G1", (i12, n16) => r2(r14, n16.lighting.sh.g[1], n16.lighting.sh.g[2], n16.lighting.sh.g[3], n16.lighting.sh.g[4])), new e16("lightingAmbientSH_B1", (i12, n16) => r2(r14, n16.lighting.sh.b[1], n16.lighting.sh.b[2], n16.lighting.sh.b[3], n16.lighting.sh.b[4])), new e16("lightingAmbientSH_R2", (i12, n16) => r2(r14, n16.lighting.sh.r[5], n16.lighting.sh.r[6], n16.lighting.sh.r[7], n16.lighting.sh.r[8])), new e16("lightingAmbientSH_G2", (i12, n16) => r2(r14, n16.lighting.sh.g[5], n16.lighting.sh.g[6], n16.lighting.sh.g[7], n16.lighting.sh.g[8])), new e16("lightingAmbientSH_B2", (i12, n16) => r2(r14, n16.lighting.sh.b[5], n16.lighting.sh.b[6], n16.lighting.sh.b[7], n16.lighting.sh.b[8]))]), m8.code.add(n5`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);
- }`), g5.pbrMode !== l.Normal && g5.pbrMode !== l.Schematic || m8.code.add(n5`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 a11 = n();
- var r14 = n2();
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js
- function o22(o24, a14) {
- const g5 = o24.fragment;
- a14.isGround ? g5.uniforms.add(new o21("lightingFixedFactor", (i12, n15) => (1 - n15.lighting.groundLightingFactor) * (1 - n15.lighting.globalFactor))) : g5.constants.add("lightingFixedFactor", "float", 0), g5.uniforms.add([new e8("lightingMainDirection", (i12, n15) => n15.lighting.lightingMainDirection), new e8("lightingMainIntensity", (i12, n15) => n15.lighting.mainLight.intensity)]), g5.code.add(n5`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
- float dotVal = clamp(dot(normal_global, lightingMainDirection), 0.0, 1.0);
- dotVal = mix(dotVal, 1.0, lightingFixedFactor);
- return lightingMainIntensity * ((1.0 - shadowing) * dotVal);
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js
- var s7 = class extends i3 {
- constructor(o24, s9) {
- super(o24, "bool", a3.Pass, (r15, e24, t10) => r15.setUniform1b(o24, s9(e24, t10)));
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js
- function m6(m8, g5) {
- const h8 = m8.fragment;
- m8.include(a9, g5), g5.pbrMode !== l.Disabled && m8.include(n10, g5), m8.include(m5, g5), h8.constants.add("ambientBoostFactor", "float", c11), m8.include(t9), h8.code.add(n5`
- const float GAMMA_SRGB = 2.1;
- const float INV_GAMMA_SRGB = 0.4761904;
- ${g5.pbrMode === l.Disabled ? "" : "const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
- `), h8.uniforms.add(new e8("lightingMainDirection", (i12, n15) => n15.lighting.lightingMainDirection)), h8.code.add(n5`
- float additionalDirectedAmbientLight(vec3 vPosWorld) {
- float vndl = dot(${g5.spherical ? n5`normalize(vPosWorld)` : n5`vec3(0.0, 0.0, 1.0)`}, lightingMainDirection);
- return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
- }
- `), h8.uniforms.add([new o21("lightingGlobalFactor", (i12, n15) => n15.lighting.globalFactor), new e8("lightingMainIntensity", (i12, n15) => n15.lighting.mainLight.intensity)]), h8.code.add(n5`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
- float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
- return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * lightingMainIntensity;
- }`), g5.pbrMode === l.Disabled || g5.pbrMode === l.WaterOnIntegratedMesh ? (m8.include(o22, g5), h8.code.add(n5`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));
- }`)) : g5.pbrMode !== l.Normal && g5.pbrMode !== l.Schematic || (h8.code.add(n5`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 = lightingMainDirection;
- 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);`), h8.code.add(n5`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);`), g5.useFillLights ? h8.uniforms.add(new s7("hasFillLights", (i12, n15) => n15.enableFillLights)) : h8.constants.add("hasFillLights", "bool", false), h8.code.add(n5`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) * lightingMainIntensity;
- vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * lightingMainIntensity * fillLightIntensity;
- vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
- inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
- inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`), h8.uniforms.add([new o21("lightingSpecularStrength", (i12, n15) => n15.lighting.mainLight.specularStrength), new o21("lightingEnvironmentStrength", (i12, n15) => n15.lighting.mainLight.environmentStrength)]), h8.code.add(n5`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) * lightingMainIntensity * (1.0 - shadow);
- vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * lightingMainIntensity * 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]);`), h8.code.add(n5`
- vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
- vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
- vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
- vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
- ${g5.pbrMode === l.Schematic ? n5`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));` : n5`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
- return outColor;
- }
- `));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js
- function a12(a14) {
- a14.include(a7), a14.code.add(n5`float linearDepthFromFloat(float depth, vec2 nearFar) {
- return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
- }
- float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {
- return linearDepthFromFloat(rgba2float(texture2D(depthTex, uv)), nearFar);
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js
- function n13(n15, o24) {
- o24.hasMultipassTerrain && (n15.fragment.include(a12), n15.fragment.uniforms.add(new c4("terrainDepthTexture", (e24, r15) => r15.multipassTerrain.linearDepthTexture)), n15.fragment.uniforms.add(new e9("nearFar", (e24, r15) => r15.camera.nearFar)), n15.fragment.uniforms.add(new e9("inverseViewport", (e24, r15) => r15.inverseViewport)), n15.fragment.code.add(n5`
- void terrainDepthTest(vec4 fragCoord, float fragmentDepth){
- float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar);
- if(fragmentDepth ${o24.cullAboveGround ? ">" : "<="} terrainDepth){
- discard;
- }
- }
- `));
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sUniform.js
- var e22 = class extends i3 {
- constructor(r15, e24, t10, i12) {
- switch (e24) {
- case a3.Pass:
- return void super(r15, "mat4", e24, (s9, e25, i13) => s9.setUniformMatrix4fv(r15, t10(e25, i13)), i12);
- case a3.Draw:
- return void super(r15, "mat4", e24, (s9, e25, i13) => s9.setUniformMatrix4fv(r15, t10(e25, i13)), i12);
- }
- }
- };
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js
- function h6(e24, a14) {
- a14.receiveShadows && (e24.fragment.uniforms.add(new e22("shadowMapMatrix", a3.Pass, (e25, a15) => a15.shadowMap.getShadowMapMatrices(e25.origin), 4)), v4(e24));
- }
- function c12(e24, a14) {
- a14.receiveShadows && (e24.fragment.uniforms.add(new e22("shadowMapMatrix", a3.Draw, (e25, a15) => a15.shadowMap.getShadowMapMatrices(e25.origin), 4)), v4(e24));
- }
- function v4(e24) {
- const i12 = e24.fragment;
- i12.include(a7), i12.uniforms.add([new c4("shadowMapTex", (e25, a14) => a14.shadowMap.depthTexture), new e14("numCascades", (e25, a14) => a14.shadowMap.numCascades), new e16("cascadeDistances", (e25, a14) => a14.shadowMap.cascadeDistances), new o21("depthHalfPixelSz", (e25, a14) => 0.5 / a14.shadowMap.textureSize)]), i12.code.add(n5`int chooseCascade(float depth, out mat4 mat) {
- vec4 distance = cascadeDistances;
- 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 halfPixelSize, sampler2D _depthTex) {
- float texSize = 0.5 / halfPixelSize;
- vec2 st = fract((vec2(halfPixelSize) + uv) * texSize);
- 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);
- 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; }
- vec2 uv = cascadeCoordinates(i, lvpos);
- return filterShadow(uv, lvpos, depthHalfPixelSz, shadowMapTex);
- }`);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js
- function e23(e24) {
- e24.code.add(n5`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 i10(i12) {
- i12.include(e23), i12.code.add(n5`
- 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 == ${n5.int(r9.Multiply)}) {
- return allMixed;
- }
- if (mode == ${n5.int(r9.Ignore)}) {
- return internalMixed;
- }
- if (mode == ${n5.int(r9.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 == ${n5.int(r9.Ignore)}) {
- return internalMixed;
- }
- if (mode == ${n5.int(r9.Replace)}) {
- return externalOpacity;
- }
- // multiply or tint (or something invalid)
- return allMixed;
- }
- `);
- }
- // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js
- var n14 = s.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");
- var s8 = class {
- constructor() {
- this.includedModules = new Map();
- }
- include(e24, r15) {
- if (this.includedModules.has(e24)) {
- const t10 = this.includedModules.get(e24);
- if (t10 !== r15) {
- n14.error("Trying to include shader module multiple times with different sets of options.");
- const r16 = new Set();
- for (const n15 of Object.keys(t10))
- t10[n15] !== e24[n15] && r16.add(n15);
- for (const n15 of Object.keys(e24))
- t10[n15] !== e24[n15] && r16.add(n15);
- r16.forEach((r17) => console.error(` ${r17}: current ${t10[r17]} new ${e24[r17]}`));
- }
- } else
- this.includedModules.set(e24, r15), e24(this.builder, r15);
- }
- };
- var i11 = class extends s8 {
- constructor() {
- super(...arguments), this.vertex = new c13(), this.fragment = new c13(), this.attributes = new u7(), this.varyings = new m7(), this.extensions = new h7(), this.constants = new d7();
- }
- get fragmentUniforms() {
- return this.fragment.uniforms.entries;
- }
- get builder() {
- return this;
- }
- generate(e24) {
- const r15 = this.extensions.generateSource(e24), t10 = this.attributes.generateSource(e24), n15 = this.varyings.generateSource(), s9 = e24 === "vertex" ? this.vertex : this.fragment, i12 = s9.uniforms.generateSource(), o24 = s9.code.generateSource(), a14 = e24 === "vertex" ? _2 : l7, c14 = this.constants.generateSource().concat(s9.constants.generateSource());
- return `
- ${r15.join("\n")}
- ${a14}
- ${c14.join("\n")}
- ${i12.join("\n")}
- ${t10.join("\n")}
- ${n15.join("\n")}
- ${o24.join("\n")}`;
- }
- generateBind(e24, r15) {
- const n15 = new Map();
- this.vertex.uniforms.entries.forEach((r16) => {
- const s10 = r16.bind[e24];
- r(s10) && n15.set(r16.name, s10);
- }), this.fragment.uniforms.entries.forEach((r16) => {
- const s10 = r16.bind[e24];
- r(s10) && n15.set(r16.name, s10);
- });
- const s9 = Array.from(n15.values()), i12 = s9.length;
- return (e25, t10) => {
- for (let n16 = 0; n16 < i12; ++n16)
- s9[n16](r15, e25, t10);
- };
- }
- };
- var o23 = class {
- constructor() {
- this._entries = new Map();
- }
- add(e24) {
- if (!Array.isArray(e24))
- return this._add(e24);
- for (const r15 of e24)
- this._add(r15);
- }
- _add(r15) {
- if (this._entries.has(r15.name) && !this._entries.get(r15.name).equals(r15))
- throw new s2(`Duplicate uniform name ${r15.name} for different uniform type`);
- this._entries.set(r15.name, r15);
- }
- generateSource() {
- return Array.from(this._entries.values()).map((e24) => r(e24.arraySize) ? `uniform ${e24.type} ${e24.name}[${e24.arraySize}];` : `uniform ${e24.type} ${e24.name};`);
- }
- get entries() {
- return Array.from(this._entries.values());
- }
- };
- var a13 = class {
- constructor() {
- this._entries = new Array();
- }
- add(e24) {
- this._entries.push(e24);
- }
- generateSource() {
- return this._entries;
- }
- };
- var c13 = class extends s8 {
- constructor() {
- super(...arguments), this.uniforms = new o23(), this.code = new a13(), this.constants = new d7();
- }
- get builder() {
- return this;
- }
- };
- var u7 = class {
- constructor() {
- this._entries = new Array();
- }
- add(e24, r15) {
- this._entries.push([e24, r15]);
- }
- generateSource(e24) {
- return e24 === "fragment" ? [] : this._entries.map((e25) => `attribute ${e25[1]} ${e25[0]};`);
- }
- };
- var m7 = class {
- constructor() {
- this._entries = new Array();
- }
- add(e24, r15) {
- this._entries.push([e24, r15]);
- }
- generateSource() {
- return this._entries.map((e24) => `varying ${e24[1]} ${e24[0]};`);
- }
- };
- var h7 = class {
- constructor() {
- this._entries = new Set();
- }
- add(e24) {
- this._entries.add(e24);
- }
- generateSource(e24) {
- const r15 = e24 === "vertex" ? h7.ALLOWLIST_VERTEX : h7.ALLOWLIST_FRAGMENT;
- return Array.from(this._entries).filter((e25) => r15.includes(e25)).map((e25) => `#extension ${e25} : enable`);
- }
- };
- h7.ALLOWLIST_FRAGMENT = ["GL_EXT_shader_texture_lod", "GL_OES_standard_derivatives"], h7.ALLOWLIST_VERTEX = [];
- var d7 = class {
- constructor() {
- this._entries = new Set();
- }
- add(e24, r15, t10) {
- let n15 = "ERROR_CONSTRUCTOR_STRING";
- switch (r15) {
- case "float":
- n15 = d7._numberToFloatStr(t10);
- break;
- case "int":
- n15 = d7._numberToIntStr(t10);
- break;
- case "bool":
- n15 = t10.toString();
- break;
- case "vec2":
- n15 = `vec2(${d7._numberToFloatStr(t10[0])}, ${d7._numberToFloatStr(t10[1])})`;
- break;
- case "vec3":
- n15 = `vec3(${d7._numberToFloatStr(t10[0])}, ${d7._numberToFloatStr(t10[1])}, ${d7._numberToFloatStr(t10[2])})`;
- break;
- case "vec4":
- n15 = `vec4(${d7._numberToFloatStr(t10[0])}, ${d7._numberToFloatStr(t10[1])}, ${d7._numberToFloatStr(t10[2])}, ${d7._numberToFloatStr(t10[3])})`;
- break;
- case "ivec2":
- n15 = `ivec2(${d7._numberToIntStr(t10[0])}, ${d7._numberToIntStr(t10[1])})`;
- break;
- case "ivec3":
- n15 = `ivec3(${d7._numberToIntStr(t10[0])}, ${d7._numberToIntStr(t10[1])}, ${d7._numberToIntStr(t10[2])})`;
- break;
- case "ivec4":
- n15 = `ivec4(${d7._numberToIntStr(t10[0])}, ${d7._numberToIntStr(t10[1])}, ${d7._numberToIntStr(t10[2])}, ${d7._numberToIntStr(t10[3])})`;
- break;
- case "mat2":
- case "mat3":
- case "mat4":
- n15 = `${r15}(${Array.prototype.map.call(t10, (e25) => d7._numberToFloatStr(e25)).join(", ")})`;
- }
- return this._entries.add(`const ${r15} ${e24} = ${n15};`), this;
- }
- static _numberToIntStr(e24) {
- return e24.toFixed(0);
- }
- static _numberToFloatStr(e24) {
- return Number.isInteger(e24) ? e24.toFixed(1) : e24.toString();
- }
- generateSource() {
- return Array.from(this._entries);
- }
- };
- var l7 = "#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif";
- var _2 = "precision highp float;\nprecision highp sampler2D;";
- export {
- r10 as r,
- e18 as e,
- E,
- o4 as o,
- n5 as n,
- o6 as o2,
- i2 as i,
- o7 as o3,
- d,
- a4 as a,
- a3 as a2,
- i3 as i2,
- e8 as e2,
- m2 as m,
- c4 as c,
- m as m2,
- h,
- l,
- d2,
- x2 as x,
- L3 as L,
- d4 as d3,
- h5 as h2,
- o11 as o4,
- r7 as r2,
- e10 as e3,
- n7 as n2,
- f3 as f,
- o13 as o5,
- t5 as t,
- t6 as t2,
- e12 as e4,
- u3 as u,
- r8 as r3,
- m3,
- i5 as i3,
- e15 as e5,
- e16 as e6,
- c8 as c2,
- d3 as d4,
- a6 as a3,
- s5 as s,
- o21 as o6,
- s6 as s2,
- f6 as f2,
- a9 as a4,
- n10 as n3,
- c11 as c3,
- m6 as m4,
- n13 as n4,
- h6 as h3,
- c12 as c4,
- i10 as i4,
- i11 as i5
- };
- //# sourceMappingURL=chunk-OBMTYN3I.js.map
|