@arcgis/core 4.30.0-next.20240213 → 4.30.0-next.20240215
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TimeExtent.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/08ba549f9c4afc42a21c.js +1 -0
- package/assets/esri/core/workers/chunks/114afcee6a66415cd123.js +1 -0
- package/assets/esri/core/workers/chunks/1320562881294ce93806.js +1 -0
- package/assets/esri/core/workers/chunks/13451fa3e4b02ca2beb0.js +1 -0
- package/assets/esri/core/workers/chunks/{a384f29cb3256401962a.js → 1629a8c2085dce59cd1b.js} +1 -1
- package/assets/esri/core/workers/chunks/18512caeeb03b9759ab1.js +1 -0
- package/assets/esri/core/workers/chunks/{cc1c958aad790a44048b.js → 1ca28af7c516d8283bb0.js} +1 -1
- package/assets/esri/core/workers/chunks/1f8a0fb32b96e50f5909.js +1 -0
- package/assets/esri/core/workers/chunks/{abab3abb8ea7610d9fb8.js → 21e7a88478f5d15e0e71.js} +1 -1
- package/assets/esri/core/workers/chunks/24452a26b0c5322c7d2b.js +1 -0
- package/assets/esri/core/workers/chunks/25b88787ead0cc44cda4.js +1 -0
- package/assets/esri/core/workers/chunks/2649166d1a462c7f8338.js +1 -0
- package/assets/esri/core/workers/chunks/2c96771a365f8f70e996.js +1 -0
- package/assets/esri/core/workers/chunks/352e7f8d694f3f217a2d.js +1 -0
- package/assets/esri/core/workers/chunks/392214a3a1d712eda155.js +1 -0
- package/assets/esri/core/workers/chunks/397f15b5bce6838db084.js +1 -0
- package/assets/esri/core/workers/chunks/3bf281e979408b9363ed.js +1 -0
- package/assets/esri/core/workers/chunks/4edc667148d023b5b5af.js +1 -0
- package/assets/esri/core/workers/chunks/51e4f771bfe352967c97.js +1 -0
- package/assets/esri/core/workers/chunks/55cd747e06bb59d1a328.js +1 -0
- package/assets/esri/core/workers/chunks/5638d95e600ff271c5b1.js +1 -0
- package/assets/esri/core/workers/chunks/563d172caa15ea1b510d.js +1108 -0
- package/assets/esri/core/workers/chunks/58f088b08e12c5435dbc.js +1 -0
- package/assets/esri/core/workers/chunks/5aef1e898618f8dda2c9.js +1 -0
- package/assets/esri/core/workers/chunks/608be8ebf772aefc36a5.js +1 -0
- package/assets/esri/core/workers/chunks/64df2521b2814d2fb918.js +1 -0
- package/assets/esri/core/workers/chunks/65070fb591f6ef8313c3.js +1 -0
- package/assets/esri/core/workers/chunks/656ec8a14df0e4b68433.js +1 -0
- package/assets/esri/core/workers/chunks/6601fe99d587b9dff3c7.js +1 -0
- package/assets/esri/core/workers/chunks/{274e623323e24250ca46.js → 6ac424af4f2825fabceb.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb2d6f1ee63b40ae0736.js → 774b655498289b1b36bb.js} +1 -1
- package/assets/esri/core/workers/chunks/781bb63af571568358e3.js +1 -0
- package/assets/esri/core/workers/chunks/9e54d2cbe42f5552aaca.js +1 -0
- package/assets/esri/core/workers/chunks/{f03d62ab7806b68d0b62.js → 9fbf61675e2a5374f754.js} +1 -1
- package/assets/esri/core/workers/chunks/a5253543eae1708d11b9.js +1 -0
- package/assets/esri/core/workers/chunks/aa9b46bcb75c96731de3.js +1 -0
- package/assets/esri/core/workers/chunks/cfb8b6b5e9c21d582cf4.js +1 -0
- package/assets/esri/core/workers/chunks/d1b2372084c1e8c60f79.js +1 -0
- package/assets/esri/core/workers/chunks/{1c6914ded7db720f7bf7.js → daf6eab5dd198ca9a67b.js} +1 -1
- package/assets/esri/core/workers/chunks/e03edeaf3af46495449e.js +1 -0
- package/assets/esri/core/workers/chunks/e685214698fbc84276dd.js +1 -0
- package/assets/esri/core/workers/chunks/ebb294c82207f3ff9f04.js +1 -0
- package/assets/esri/core/workers/chunks/ec20e23aec9370df8a55.js +1 -0
- package/assets/esri/core/workers/chunks/{e4da908079417cc2f495.js → ee0c77889059815a31b2.js} +1 -1
- package/assets/esri/core/workers/chunks/f68b7bb88c444a7cbbd2.js +1 -0
- package/assets/esri/core/workers/chunks/f90bbebd2dc07a77ce09.js +1 -0
- package/assets/esri/core/workers/chunks/fa388680ff976a6b30f6.js +1 -0
- package/chunks/vec32.js +1 -1
- package/interfaces.d.ts +135 -68
- package/layers/WFSLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/fromPortalItem.js +1 -1
- package/networks/Network.js +1 -1
- package/package.json +1 -1
- package/portal/Portal.js +1 -1
- package/portal/PortalGroup.js +1 -1
- package/portal/PortalUser.js +1 -1
- package/portal/support/geometryServiceUtils.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/renderers/visualVariables/SizeVariable.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/rest/places.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/ImageSampleParameters.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
- package/views/2d/engine/webgl/definitions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
- package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/schema/processor/VisualVariablesSchema.js +1 -1
- package/views/2d/layers/features/sources/strategies/SnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl/RenderNode.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +9 -7
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceConstants.js +5 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectAndLayerIdRenderHelper.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/drawSurfaces.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/SnappingOptions.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/webdoc/support/webdocLoadUtils.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/support/EditorItem.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/00b9e92f8df245a83921.js +0 -1
- package/assets/esri/core/workers/chunks/02a6c43ec17e7223fac5.js +0 -1
- package/assets/esri/core/workers/chunks/02ee044597c89c86b934.js +0 -1
- package/assets/esri/core/workers/chunks/05ebb9cec0e1826b283f.js +0 -1
- package/assets/esri/core/workers/chunks/143ccb14c9e915dd1412.js +0 -1
- package/assets/esri/core/workers/chunks/24649b410b757599a549.js +0 -1
- package/assets/esri/core/workers/chunks/24d19abc680b341d13bb.js +0 -1
- package/assets/esri/core/workers/chunks/2519b207894132d5ea91.js +0 -1
- package/assets/esri/core/workers/chunks/30f9b2a3417cbcfeecca.js +0 -1
- package/assets/esri/core/workers/chunks/42ab9c282bb267c3db03.js +0 -1
- package/assets/esri/core/workers/chunks/478815fc19b452d8317d.js +0 -1
- package/assets/esri/core/workers/chunks/49afeac45250b15b5f36.js +0 -1
- package/assets/esri/core/workers/chunks/50bb67f2eeace5d50673.js +0 -1
- package/assets/esri/core/workers/chunks/50cdc59426ba859027e2.js +0 -1
- package/assets/esri/core/workers/chunks/5401ec9c9fd62dcac6ec.js +0 -1
- package/assets/esri/core/workers/chunks/554d86df71821d671d2c.js +0 -1
- package/assets/esri/core/workers/chunks/58c5861d060c808813a1.js +0 -1
- package/assets/esri/core/workers/chunks/5dbb3ef6fdd25ac632ad.js +0 -1
- package/assets/esri/core/workers/chunks/61c4bb58ef9f2d99c75e.js +0 -1
- package/assets/esri/core/workers/chunks/6e50220f8e2d392e2855.js +0 -1
- package/assets/esri/core/workers/chunks/6fd8047741a0df006ddd.js +0 -1
- package/assets/esri/core/workers/chunks/7709248f59520aee6f51.js +0 -1
- package/assets/esri/core/workers/chunks/8852a64918caf80fc414.js +0 -1
- package/assets/esri/core/workers/chunks/8d119dc0a92ad3612daa.js +0 -1
- package/assets/esri/core/workers/chunks/94dfb80ab23dda92918b.js +0 -1
- package/assets/esri/core/workers/chunks/9ebbc75ba5c623a322aa.js +0 -1
- package/assets/esri/core/workers/chunks/a5babc10f47c24651d15.js +0 -1
- package/assets/esri/core/workers/chunks/a74c59cf5d1c4e63a4e1.js +0 -1
- package/assets/esri/core/workers/chunks/ada5d6fd70bd3e403442.js +0 -1
- package/assets/esri/core/workers/chunks/b95d69d84d60ac9828b9.js +0 -1
- package/assets/esri/core/workers/chunks/be562536212360943388.js +0 -1
- package/assets/esri/core/workers/chunks/ce823fc2d0e0095f398c.js +0 -1
- package/assets/esri/core/workers/chunks/d06d36815c2121484a13.js +0 -1
- package/assets/esri/core/workers/chunks/d5f06a7b0ea7951c8dd0.js +0 -1
- package/assets/esri/core/workers/chunks/ddc71fe66c7a49082920.js +0 -1
- package/assets/esri/core/workers/chunks/de6d54df7ae32694fd70.js +0 -1
- package/assets/esri/core/workers/chunks/f13c4b9692dad5802a32.js +0 -1106
- package/assets/esri/core/workers/chunks/f1e8f7d1a98b9e207b1b.js +0 -1
- package/assets/esri/core/workers/chunks/f9e9675f1c2287231653.js +0 -1
|
@@ -1,1106 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6472],{83840:(e,t,r)=>{r.d(t,{D:()=>z,b:()=>V});var i=r(90124),o=r(97760),a=r(80324),n=r(68828),s=r(70984),l=r(11925),c=r(88196),u=r(32704),d=r(49168),h=r(55164),m=r(41804),f=r(60072),p=r(11544),g=r(2288),v=r(87836),_=r(8844),x=r(57704),T=r(53672),b=r(50143),S=r(58472),E=r(36908),A=r(81832),y=r(64352),C=r(95128),M=r(36244),w=r(74072),I=r(93904),R=r(29484),O=r(95224),N=r(56124),P=r(56192),L=r(95464),D=r(60288),F=r(14920),U=r(49916),B=r(56336),G=r(4636);function V(e){const t=new F.i0,{vertex:r,fragment:V,varyings:z}=t;if((0,O.IE)(r,e),t.include(u.s),z.add("vpos","vec3"),t.include(M.a,e),t.include(l.As,e),t.include(p.k,e),t.include(C.wZ,e),e.output===a.mC.Color||e.output===a.mC.Alpha){t.include(C.Wq,e),t.include(C.Qr,e),t.include(C.U_,e),t.include(C.UJ,e),(0,O.E7)(r,e),t.include(c.k,e),t.include(s.w,e);const a=e.normalType===c.g.Attribute||e.normalType===c.g.Compressed;a&&e.offsetBackfaces&&t.include(o.m),t.include(v.W,e),t.include(f.u8,e),e.instancedColor&&t.attributes.add(G.K.INSTANCECOLOR,"vec4"),z.add("vPositionLocal","vec3"),t.include(h.I,e),t.include(i.Er,e),t.include(d.i,e),t.include(m.O,e),r.uniforms.add(new P.U("externalColor",(e=>e.externalColor))),z.add("vcolorExt","vec4"),e.multipassEnabled&&z.add("depth","float"),r.code.add(D.Y`
|
|
2
|
-
void main(void) {
|
|
3
|
-
forwardNormalizedVertexColor();
|
|
4
|
-
vcolorExt = externalColor;
|
|
5
|
-
${e.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""}
|
|
6
|
-
vcolorExt *= vvColor();
|
|
7
|
-
vcolorExt *= getSymbolColor();
|
|
8
|
-
forwardColorMixMode();
|
|
9
|
-
|
|
10
|
-
if (vcolorExt.a < ${D.Y.float(w.A)}) {
|
|
11
|
-
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
12
|
-
} else {
|
|
13
|
-
vpos = getVertexInLocalOriginSpace();
|
|
14
|
-
vPositionLocal = vpos - view[3].xyz;
|
|
15
|
-
vpos = subtractOrigin(vpos);
|
|
16
|
-
${a?D.Y`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""}
|
|
17
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
18
|
-
${e.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""}
|
|
19
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
20
|
-
${a&&e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
${e.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""}
|
|
24
|
-
forwardLinearDepth();
|
|
25
|
-
forwardTextureCoordinates();
|
|
26
|
-
forwardColorUV();
|
|
27
|
-
forwardNormalUV();
|
|
28
|
-
forwardEmissiveUV();
|
|
29
|
-
forwardOcclusionUV();
|
|
30
|
-
forwardMetallicRoughnessUV();
|
|
31
|
-
}
|
|
32
|
-
`)}switch(e.output){case a.mC.Alpha:t.include(n.A3,e),t.include(I.Q,e),t.include(b._,e),V.uniforms.add(new L.d("opacity",(e=>e.opacity)),new L.d("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&V.uniforms.add(new U.W("tex",(e=>e.texture))),V.include(R.u),V.code.add(D.Y`
|
|
33
|
-
void main() {
|
|
34
|
-
discardBySlice(vpos);
|
|
35
|
-
${e.multipassEnabled?"terrainDepthTest(depth);":""}
|
|
36
|
-
${e.hasColorTexture?D.Y`
|
|
37
|
-
vec4 texColor = texture(tex, ${e.hasColorTextureTransform?D.Y`colorUV`:D.Y`vuv0`});
|
|
38
|
-
${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
|
|
39
|
-
discardOrAdjustAlpha(texColor);`:D.Y`vec4 texColor = vec4(1.0);`}
|
|
40
|
-
${e.hasVertexColors?D.Y`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:D.Y`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
41
|
-
fragColor = vec4(opacity_);
|
|
42
|
-
}
|
|
43
|
-
`);break;case a.mC.Color:t.include(n.A3,e),t.include(x.kf,e),t.include(_.i,e),t.include(I.Q,e),t.include(e.instancedDoublePrecision?y.i8:y.WK,e),t.include(b._,e),(0,O.E7)(V,e),V.uniforms.add(r.uniforms.get("localOrigin"),new N.C("ambient",(e=>e.ambient)),new N.C("diffuse",(e=>e.diffuse)),new L.d("opacity",(e=>e.opacity)),new L.d("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&V.uniforms.add(new U.W("tex",(e=>e.texture))),t.include(A.G4,e),t.include(E.I,e),V.include(R.u),t.include(S.u,e),(0,x.I4)(V),(0,x.oZ)(V),(0,T.o1)(V),V.code.add(D.Y`
|
|
44
|
-
void main() {
|
|
45
|
-
discardBySlice(vpos);
|
|
46
|
-
${e.multipassEnabled?"terrainDepthTest(depth);":""}
|
|
47
|
-
${e.hasColorTexture?D.Y`
|
|
48
|
-
vec4 texColor = texture(tex, ${e.hasColorTextureTransform?D.Y`colorUV`:D.Y`vuv0`});
|
|
49
|
-
${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
|
|
50
|
-
discardOrAdjustAlpha(texColor);`:D.Y`vec4 texColor = vec4(1.0);`}
|
|
51
|
-
shadingParams.viewDirection = normalize(vpos - cameraPosition);
|
|
52
|
-
${e.normalType===c.g.ScreenDerivative?D.Y`
|
|
53
|
-
vec3 normal = screenDerivativeNormal(vPositionLocal);`:D.Y`
|
|
54
|
-
shadingParams.normalView = vNormalWorld;
|
|
55
|
-
vec3 normal = shadingNormal(shadingParams);`}
|
|
56
|
-
${e.pbrMode===A.Ax.Normal?"applyPBRFactors();":""}
|
|
57
|
-
float ssao = evaluateAmbientOcclusionInverse() * getBakedOcclusion();
|
|
58
|
-
|
|
59
|
-
vec3 posWorld = vpos + localOrigin;
|
|
60
|
-
|
|
61
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(posWorld);
|
|
62
|
-
float shadow = ${e.receiveShadows?"readShadowMap(vpos, linearDepth)":e.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"};
|
|
63
|
-
|
|
64
|
-
vec3 matColor = max(ambient, diffuse);
|
|
65
|
-
${e.hasVertexColors?D.Y`
|
|
66
|
-
vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
67
|
-
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:D.Y`
|
|
68
|
-
vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
69
|
-
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
70
|
-
${e.hasNormalTexture?D.Y`
|
|
71
|
-
mat3 tangentSpace = ${e.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"}
|
|
72
|
-
vec3 shadingNormal = computeTextureNormal(tangentSpace, ${e.hasNormalTextureTransform?D.Y`normalUV`:"vuv0"});`:D.Y`vec3 shadingNormal = normal;`}
|
|
73
|
-
vec3 normalGround = ${e.spherical?D.Y`normalize(posWorld);`:D.Y`vec3(0.0, 0.0, 1.0);`}
|
|
74
|
-
|
|
75
|
-
${e.snowCover?D.Y`
|
|
76
|
-
float snow = smoothstep(0.5, 0.55, dot(normal, normalGround));
|
|
77
|
-
albedo = mix(albedo, vec3(1), snow);
|
|
78
|
-
shadingNormal = mix(shadingNormal, normal, snow);
|
|
79
|
-
ssao = mix(ssao, 1.0, snow);`:""}
|
|
80
|
-
|
|
81
|
-
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
82
|
-
|
|
83
|
-
${e.pbrMode===A.Ax.Normal||e.pbrMode===A.Ax.Schematic?D.Y`
|
|
84
|
-
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
85
|
-
${e.snowCover?D.Y`
|
|
86
|
-
mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
87
|
-
emission = mix(emission, vec3(0.0), snow);`:""}
|
|
88
|
-
|
|
89
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.Y`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
90
|
-
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
91
|
-
${e.transparencyPassType===B.H.Color?D.Y`fragColor = premultiplyAlpha(fragColor);`:""}
|
|
92
|
-
}
|
|
93
|
-
`)}return t.include(g.y,e),t}const z=Object.freeze(Object.defineProperty({__proto__:null,build:V},Symbol.toStringTag,{value:"Module"}))},59888:(e,t,r)=>{r.d(t,{R:()=>U,b:()=>F});var i=r(90124),o=r(97760),a=r(80324),n=r(68828),s=r(70984),l=r(11925),c=r(88196),u=r(32704),d=r(49168),h=r(55164),m=r(41804),f=r(11544),p=r(2288),g=r(8844),v=r(57704),_=r(53672),x=r(50143),T=r(36908),b=r(81832),S=r(64352),E=r(36244),A=r(74072),y=r(93904),C=r(29484),M=r(95224),w=r(56124),I=r(56192),R=r(95464),O=r(60288),N=r(14920),P=r(49916),L=r(56336),D=r(4636);function F(e){const t=new N.i0,{vertex:r,fragment:F,varyings:U}=t;return(0,M.IE)(r,e),t.include(u.s),U.add("vpos","vec3"),t.include(E.a,e),t.include(l.As,e),t.include(f.k,e),e.output!==a.mC.Color&&e.output!==a.mC.Alpha||((0,M.E7)(t.vertex,e),t.include(c.k,e),t.include(s.w,e),e.offsetBackfaces&&t.include(o.m),e.instancedColor&&t.attributes.add(D.K.INSTANCECOLOR,"vec4"),U.add("vNormalWorld","vec3"),U.add("localvpos","vec3"),e.multipassEnabled&&U.add("depth","float"),t.include(h.I,e),t.include(i.Er,e),t.include(d.i,e),t.include(m.O,e),r.uniforms.add(new I.U("externalColor",(e=>e.externalColor))),U.add("vcolorExt","vec4"),r.code.add(O.Y`
|
|
94
|
-
void main(void) {
|
|
95
|
-
forwardNormalizedVertexColor();
|
|
96
|
-
vcolorExt = externalColor;
|
|
97
|
-
${e.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""}
|
|
98
|
-
vcolorExt *= vvColor();
|
|
99
|
-
vcolorExt *= getSymbolColor();
|
|
100
|
-
forwardColorMixMode();
|
|
101
|
-
|
|
102
|
-
if (vcolorExt.a < ${O.Y.float(A.A)}) {
|
|
103
|
-
gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
|
|
104
|
-
} else {
|
|
105
|
-
vpos = getVertexInLocalOriginSpace();
|
|
106
|
-
localvpos = vpos - view[3].xyz;
|
|
107
|
-
vpos = subtractOrigin(vpos);
|
|
108
|
-
vNormalWorld = dpNormal(vvLocalNormal(normalModel()));
|
|
109
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
110
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
111
|
-
${e.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""}
|
|
112
|
-
}
|
|
113
|
-
${e.multipassEnabled?O.Y`depth = (view * vec4(vpos, 1.0)).z;`:""}
|
|
114
|
-
forwardLinearDepth();
|
|
115
|
-
forwardTextureCoordinates();
|
|
116
|
-
}
|
|
117
|
-
`)),e.output===a.mC.Alpha&&(t.include(n.A3,e),t.include(y.Q,e),t.include(x._,e),F.uniforms.add(new R.d("opacity",(e=>e.opacity)),new R.d("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&F.uniforms.add(new P.W("tex",(e=>e.texture))),F.include(C.u),F.code.add(O.Y`
|
|
118
|
-
void main() {
|
|
119
|
-
discardBySlice(vpos);
|
|
120
|
-
${e.multipassEnabled?O.Y`terrainDepthTest(depth);`:""}
|
|
121
|
-
${e.hasColorTexture?O.Y`
|
|
122
|
-
vec4 texColor = texture(tex, ${e.hasColorTextureTransform?O.Y`colorUV`:O.Y`vuv0`});
|
|
123
|
-
${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
|
|
124
|
-
discardOrAdjustAlpha(texColor);`:O.Y`vec4 texColor = vec4(1.0);`}
|
|
125
|
-
${e.hasVertexColors?O.Y`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:O.Y`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
126
|
-
|
|
127
|
-
fragColor = vec4(opacity_);
|
|
128
|
-
}
|
|
129
|
-
`)),e.output===a.mC.Color&&(t.include(n.A3,e),t.include(v.kf,e),t.include(g.i,e),t.include(y.Q,e),t.include(e.instancedDoublePrecision?S.i8:S.WK,e),t.include(x._,e),(0,M.E7)(t.fragment,e),(0,_.OB)(F),(0,v.I4)(F),(0,v.oZ)(F),F.uniforms.add(r.uniforms.get("localOrigin"),r.uniforms.get("view"),new w.C("ambient",(e=>e.ambient)),new w.C("diffuse",(e=>e.diffuse)),new R.d("opacity",(e=>e.opacity)),new R.d("layerOpacity",(e=>e.layerOpacity))),e.hasColorTexture&&F.uniforms.add(new P.W("tex",(e=>e.texture))),t.include(b.G4,e),t.include(T.I,e),F.include(C.u),(0,_.o1)(F),F.code.add(O.Y`
|
|
130
|
-
void main() {
|
|
131
|
-
discardBySlice(vpos);
|
|
132
|
-
${e.multipassEnabled?O.Y`terrainDepthTest(depth);`:""}
|
|
133
|
-
${e.hasColorTexture?O.Y`
|
|
134
|
-
vec4 texColor = texture(tex, ${e.hasColorTextureTransform?O.Y`colorUV`:O.Y`vuv0`});
|
|
135
|
-
${e.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""}
|
|
136
|
-
discardOrAdjustAlpha(texColor);`:O.Y`vec4 texColor = vec4(1.0);`}
|
|
137
|
-
vec3 viewDirection = normalize(vpos - cameraPosition);
|
|
138
|
-
${e.pbrMode===b.Ax.Normal?"applyPBRFactors();":""}
|
|
139
|
-
float ssao = evaluateAmbientOcclusionInverse();
|
|
140
|
-
ssao *= getBakedOcclusion();
|
|
141
|
-
|
|
142
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin);
|
|
143
|
-
vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor;
|
|
144
|
-
${e.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":e.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"}
|
|
145
|
-
vec3 matColor = max(ambient, diffuse);
|
|
146
|
-
${e.hasVertexColors?O.Y`
|
|
147
|
-
vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
148
|
-
float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:O.Y`
|
|
149
|
-
vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode));
|
|
150
|
-
float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`}
|
|
151
|
-
${e.snowCover?O.Y`albedo = mix(albedo, vec3(1), 0.9);`:O.Y``}
|
|
152
|
-
${O.Y`
|
|
153
|
-
vec3 shadingNormal = normalize(vNormalWorld);
|
|
154
|
-
albedo *= 1.2;
|
|
155
|
-
vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]);
|
|
156
|
-
float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0);
|
|
157
|
-
float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0);
|
|
158
|
-
float treeRadialFalloff = vColor.r;
|
|
159
|
-
float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow);
|
|
160
|
-
additionalLight += backLightFactor * mainLightIntensity;`}
|
|
161
|
-
${e.pbrMode===b.Ax.Normal||e.pbrMode===b.Ax.Schematic?e.spherical?O.Y`vec3 normalGround = normalize(vpos + localOrigin);`:O.Y`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:O.Y``}
|
|
162
|
-
${e.pbrMode===b.Ax.Normal||e.pbrMode===b.Ax.Schematic?O.Y`
|
|
163
|
-
float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
|
|
164
|
-
${e.snowCover?O.Y`
|
|
165
|
-
mrr = vec3(0.0, 1.0, 0.04);
|
|
166
|
-
emission = vec3(0.0);`:""}
|
|
167
|
-
|
|
168
|
-
vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:O.Y`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
|
|
169
|
-
fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
170
|
-
${e.transparencyPassType===L.H.Color?O.Y`fragColor = premultiplyAlpha(fragColor);`:O.Y``}
|
|
171
|
-
}
|
|
172
|
-
`)),t.include(p.y,e),t}const U=Object.freeze(Object.defineProperty({__proto__:null,build:F},Symbol.toStringTag,{value:"Module"}))},81844:(e,t,r)=>{r.d(t,{S:()=>v,b:()=>f,g:()=>p});var i=r(37648),o=r(85256),a=r(99556),n=r(22340),s=r(252),l=r(48688),c=r(95464),u=r(60288),d=r(14920),h=r(49916);const m=16;function f(){const e=new d.i0,t=e.fragment;return e.include(a.Y),e.include(s.ig),t.include(n.W),t.uniforms.add(new c.d("radius",((e,t)=>p(t.camera)))),t.code.add(u.Y`vec3 sphere[16] = vec3[16](
|
|
173
|
-
vec3(0.186937, 0.0, 0.0),
|
|
174
|
-
vec3(0.700542, 0.0, 0.0),
|
|
175
|
-
vec3(-0.864858, -0.481795, -0.111713),
|
|
176
|
-
vec3(-0.624773, 0.102853, -0.730153),
|
|
177
|
-
vec3(-0.387172, 0.260319, 0.007229),
|
|
178
|
-
vec3(-0.222367, -0.642631, -0.707697),
|
|
179
|
-
vec3(-0.01336, -0.014956, 0.169662),
|
|
180
|
-
vec3(0.122575, 0.1544, -0.456944),
|
|
181
|
-
vec3(-0.177141, 0.85997, -0.42346),
|
|
182
|
-
vec3(-0.131631, 0.814545, 0.524355),
|
|
183
|
-
vec3(-0.779469, 0.007991, 0.624833),
|
|
184
|
-
vec3(0.308092, 0.209288,0.35969),
|
|
185
|
-
vec3(0.359331, -0.184533, -0.377458),
|
|
186
|
-
vec3(0.192633, -0.482999, -0.065284),
|
|
187
|
-
vec3(0.233538, 0.293706, -0.055139),
|
|
188
|
-
vec3(0.417709, -0.386701, 0.442449)
|
|
189
|
-
);
|
|
190
|
-
float fallOffFunction(float vv, float vn, float bias) {
|
|
191
|
-
float f = max(radius * radius - vv, 0.0);
|
|
192
|
-
return f * f * f * max(vn - bias, 0.0);
|
|
193
|
-
}`),t.code.add(u.Y`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) {
|
|
194
|
-
vec3 v = Q - C;
|
|
195
|
-
float vv = dot(v, v);
|
|
196
|
-
float vn = dot(normalize(v), n_C);
|
|
197
|
-
return fallOffFunction(vv, vn, 0.1);
|
|
198
|
-
}`),t.uniforms.add(new l.$("nearFar",((e,t)=>t.camera.nearFar)),new h.W("normalMap",(e=>e.normalTexture)),new h.W("depthMap",(e=>e.depthTexture)),new c.d("projScale",(e=>e.projScale)),new h.W("rnm",(e=>e.noiseTexture)),new l.$("rnmScale",((e,t)=>(0,i.WO)(g,t.camera.fullWidth/e.noiseTexture.descriptor.width,t.camera.fullHeight/e.noiseTexture.descriptor.height))),new c.d("intensity",(e=>e.intensity)),new l.$("screenSize",((e,t)=>(0,i.WO)(g,t.camera.fullWidth,t.camera.fullHeight)))),e.outputs.add("fragOcclusion","float"),t.code.add(u.Y`
|
|
199
|
-
void main(void) {
|
|
200
|
-
float currentPixelDepth = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
201
|
-
|
|
202
|
-
if (-currentPixelDepth > nearFar.y || -currentPixelDepth < nearFar.x) {
|
|
203
|
-
fragOcclusion = 1.0;
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// get the normal of current fragment
|
|
208
|
-
vec4 norm4 = texture(normalMap, uv);
|
|
209
|
-
if(norm4.a != 1.0) {
|
|
210
|
-
fragOcclusion = 1.0;
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz;
|
|
214
|
-
|
|
215
|
-
vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth);
|
|
216
|
-
|
|
217
|
-
float sum = 0.0;
|
|
218
|
-
vec3 tapPixelPos;
|
|
219
|
-
|
|
220
|
-
vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0);
|
|
221
|
-
|
|
222
|
-
// note: the factor 2.0 should not be necessary, but makes ssao much nicer.
|
|
223
|
-
// bug or deviation from CE somewhere else?
|
|
224
|
-
float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y);
|
|
225
|
-
|
|
226
|
-
for(int i = 0; i < ${u.Y.int(m)}; ++i) {
|
|
227
|
-
vec2 unitOffset = reflect(sphere[i], fres).xy;
|
|
228
|
-
vec2 offset = vec2(-unitOffset * radius * ps);
|
|
229
|
-
|
|
230
|
-
// don't use current or very nearby samples
|
|
231
|
-
if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){
|
|
232
|
-
continue;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
vec2 tc = vec2(gl_FragCoord.xy + offset);
|
|
236
|
-
if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue;
|
|
237
|
-
vec2 tcTap = tc / screenSize;
|
|
238
|
-
float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap, nearFar);
|
|
239
|
-
|
|
240
|
-
tapPixelPos = reconstructPosition(tc, occluderFragmentDepth);
|
|
241
|
-
|
|
242
|
-
sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// output the result
|
|
246
|
-
float A = max(1.0 - sum * intensity / float(${u.Y.int(m)}), 0.0);
|
|
247
|
-
|
|
248
|
-
// Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2
|
|
249
|
-
A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
|
|
250
|
-
|
|
251
|
-
fragOcclusion = A;
|
|
252
|
-
}
|
|
253
|
-
`),e}function p(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const g=(0,o.Su)(),v=Object.freeze(Object.defineProperty({__proto__:null,build:f,getRadius:p},Symbol.toStringTag,{value:"Module"}))},52404:(e,t,r)=>{r.d(t,{S:()=>p,b:()=>f});var i=r(98472),o=r(99556),a=r(22340),n=r(79216),s=r(48688),l=r(95464),c=r(60288),u=r(14920),d=r(83028),h=r(49916);const m=4;function f(){const e=new u.i0,t=e.fragment;e.include(o.Y);const r=(m+1)/2,f=1/(2*r*r);return t.include(a.W),t.uniforms.add(new h.W("depthMap",(e=>e.depthTexture)),new d.y("tex",(e=>e.colorTexture)),new n.O("blurSize",(e=>e.blurSize)),new l.d("projScale",((e,t)=>{const r=(0,i.p)(t.camera.eye,t.camera.center);return r>5e4?Math.max(0,e.projScale-(r-5e4)):e.projScale})),new s.$("nearFar",((e,t)=>t.camera.nearFar))),t.code.add(c.Y`
|
|
254
|
-
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
255
|
-
float c = texture(tex, uv).r;
|
|
256
|
-
float d = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
257
|
-
|
|
258
|
-
float ddiff = d - center_d;
|
|
259
|
-
|
|
260
|
-
float w = exp(-r * r * ${c.Y.float(f)} - ddiff * ddiff * sharpness);
|
|
261
|
-
wTotal += w;
|
|
262
|
-
bTotal += w * c;
|
|
263
|
-
}
|
|
264
|
-
`),e.outputs.add("fragBlur","float"),t.code.add(c.Y`
|
|
265
|
-
void main(void) {
|
|
266
|
-
float b = 0.0;
|
|
267
|
-
float w_total = 0.0;
|
|
268
|
-
|
|
269
|
-
float center_d = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
270
|
-
|
|
271
|
-
float sharpness = -0.05 * projScale / center_d;
|
|
272
|
-
for (int r = -${c.Y.int(m)}; r <= ${c.Y.int(m)}; ++r) {
|
|
273
|
-
float rf = float(r);
|
|
274
|
-
vec2 uvOffset = uv + rf * blurSize;
|
|
275
|
-
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
fragBlur = b / w_total;
|
|
279
|
-
}
|
|
280
|
-
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},84752:(e,t,r)=>{r.d(t,{a:()=>T,c:()=>x,d:()=>g,f:()=>S,g:()=>b,i:()=>M,n:()=>L}),r(9456);var i=r(66360),o=r(53648),a=r(15008),n=r(98472),s=r(62484),l=r(74784),c=r(37008),u=r(47364),d=r(82315),h=r(90484),m=r(48880),f=r(20136);const p=g();function g(){return(0,c.Su)()}const v=l.e,_=l.e;function x(e,t){return(0,l.c)(t,e)}function T(e){return e[3]}function b(e){return e}function S(e,t,r,i){return(0,c.WK)(e,t,r,i)}function E(e,t,r){if(null==t)return!1;if(!y(e,t,A))return!1;let{t0:i,t1:o}=A;if((i<0||o<i&&o>0)&&(i=o),i<0)return!1;if(r){const{origin:e,direction:o}=t;r[0]=e[0]+o[0]*i,r[1]=e[1]+o[1]*i,r[2]=e[2]+o[2]*i}return!0}const A={t0:0,t1:0};function y(e,t,r){const{origin:i,direction:o}=t,a=C;a[0]=i[0]-e[0],a[1]=i[1]-e[1],a[2]=i[2]-e[2];const n=o[0]*o[0]+o[1]*o[1]+o[2]*o[2];if(0===n)return!1;const s=2*(o[0]*a[0]+o[1]*a[1]+o[2]*a[2]),l=s*s-4*n*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-e[3]*e[3]);if(l<0)return!1;const c=Math.sqrt(l);return r.t0=(-s-c)/(2*n),r.t1=(-s+c)/(2*n),!0}const C=(0,s.Su)();function M(e,t){return E(e,t,null)}function w(e,t,r){const i=f.Wq.get(),o=f.SW.get();(0,n.b)(i,t.origin,t.direction);const s=T(e);(0,n.b)(r,i,t.origin),(0,n.i)(r,r,1/(0,n.l)(r)*s);const l=R(e,t.origin),c=(0,m.i4)(t.origin,r);return(0,a.IT)(o,c+l,i),(0,n.e)(r,r,o),r}function I(e,t,r){const i=(0,n.f)(f.Wq.get(),t,e),o=(0,n.i)(f.Wq.get(),i,e[3]/(0,n.l)(i));return(0,n.g)(r,o,e)}function R(e,t){const r=(0,n.f)(f.Wq.get(),t,e),i=(0,n.l)(r),a=T(e),s=a+Math.abs(a-i);return(0,o.Uj)(a/s)}const O=(0,s.Su)();function N(e,t,r,i){const a=(0,n.f)(O,t,e);switch(r){case d.k.X:{const e=(0,o.Iv)(a,O)[2];return(0,n.s)(i,-Math.sin(e),Math.cos(e),0)}case d.k.Y:{const e=(0,o.Iv)(a,O),t=e[1],r=e[2],s=Math.sin(t);return(0,n.s)(i,-s*Math.cos(r),-s*Math.sin(r),Math.cos(t))}case d.k.Z:return(0,n.n)(i,a);default:return}}function P(e,t){const r=(0,n.f)(D,t,e);return(0,n.l)(r)-e[3]}function L(e,t){const r=(0,n.a)(e,t),i=T(e);return r<=i*i}const D=(0,s.Su)(),F=g();Object.freeze(Object.defineProperty({__proto__:null,NullSphere:p,altitudeAt:P,angleToSilhouette:R,axisAt:N,clear:function(e){e[0]=e[1]=e[2]=e[3]=0},closestPoint:function(e,t,r){return E(e,t,r)?r:((0,h.CE)(t,e,r),I(e,r,r))},closestPointOnSilhouette:w,containsPoint:L,copy:x,create:g,distanceToSilhouette:function(e,t){const r=(0,n.f)(f.Wq.get(),t,e),i=(0,n.o)(r),o=e[3]*e[3];return Math.sqrt(Math.abs(i-o))},elevate:function(e,t,r){return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=e[3]+t,r},equals:_,exactEquals:v,fromCenterAndRadius:function(e,t){return(0,c.WK)(e[0],e[1],e[2],t)},fromRadius:function(e,t){return e[0]=e[1]=e[2]=0,e[3]=t,e},fromValues:S,getCenter:b,getRadius:T,intersectLine:function(e,t,r){const i=(0,h.i_)(t,r);if(!y(e,i,A))return[];const{origin:o,direction:a}=i,{t0:l,t1:c}=A,d=t=>{const r=(0,s.Su)();return(0,n.q)(r,o,a,t),I(e,r,r)};return Math.abs(l-c)<(0,u.Au)()?[d(l)]:[d(l),d(c)]},intersectRay:E,intersectRayClosestSilhouette:function(e,t,r){if(E(e,t,r))return r;const i=w(e,t,f.Wq.get());return(0,n.g)(r,t.origin,(0,n.i)(f.Wq.get(),t.direction,(0,n.p)(t.origin,i)/(0,n.l)(t.direction))),r},intersectsRay:M,projectPoint:I,setAltitudeAt:function(e,t,r,i){const o=P(e,t),a=N(e,t,d.k.Z,D),s=(0,n.i)(D,a,r-o);return(0,n.g)(i,t,s)},setExtent:function(e,t,r){return i.c.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),e!==r&&x(e,r),r},tmpSphere:F,union:function(e,t,r=(0,c.Su)()){const i=(0,n.p)(e,t),o=e[3],a=t[3];return i+a<o?((0,l.c)(r,e),r):i+o<a?((0,l.c)(r,t),r):((0,n.k)(r,e,t,(i+a-o)/(2*i)),r[3]=(i+o+a)/2,r)},wrap:function(e){return e}},Symbol.toStringTag,{value:"Module"}))},48952:(e,t,r)=>{r.d(t,{a:()=>a,b:()=>s,c:()=>n,d:()=>o,e:()=>d,f:()=>l,n:()=>h,s:()=>c,t:()=>u}),r(9456);var i=r(23704);function o(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,i=3,o=i){if(e.length/i!==Math.ceil(t.length/o))return e;const a=e.length/i,n=r[0],s=r[1],l=r[2],c=r[4],u=r[5],d=r[6],h=r[8],m=r[9],f=r[10],p=r[12],g=r[13],v=r[14];let _=0,x=0;for(let r=0;r<a;r++){const r=t[_],a=t[_+1],T=t[_+2];e[x]=n*r+c*a+h*T+p,e[x+1]=s*r+u*a+m*T+g,e[x+2]=l*r+d*a+f*T+v,_+=o,x+=i}return e}function n(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,a=o){if(e.length/o!==Math.ceil(t.length/a))return void(0,i.A)().error("source and destination buffers need to have the same number of elements");const n=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<n;r++){const r=t[g],i=t[g+1],n=t[g+2];e[v]=s*r+u*i+m*n,e[v+1]=l*r+d*i+f*n,e[v+2]=c*r+h*i+p*n,g+=a,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),a=t.typedBuffer,n=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*a[s],e[l+1]=r*a[s+1],e[l+2]=r*a[s+2],s+=n,l+=i}function u(e,t,r,i=3,o=i){const a=e.length/i;if(a!==Math.ceil(t.length/o))return e;let n=0,s=0;for(let l=0;l<a;l++)e[s]=t[n]+r[0],e[s+1]=t[n+1]+r[1],e[s+2]=t[n+2]+r[2],n+=o,s+=i;return e}function d(e,t){h(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function h(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let a=0,n=0;for(let s=0;s<o;s++){const o=t[a],s=t[a+1],l=t[a+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[n]=t*o,e[n+1]=t*s,e[n+2]=t*l}a+=i,n+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:h,normalizeView:d,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,a=e.typedBufferStride,n=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=n[l]>>r,o[c+1]=n[l+1]>>r,o[c+2]=n[l+2]>>r,l+=s,c+=a},transformMat3:s,transformMat3View:n,transformMat4:a,transformMat4View:o,translate:u},Symbol.toStringTag,{value:"Module"}))},52180:(e,t,r)=>{r.d(t,{o:()=>o});var i=r(52324);class o{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.o)((()=>this._reset())),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*a);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,a));e++)this._items.push(this._allocator())}}const a=1024},95728:(e,t,r)=>{r.d(t,{a:()=>o});var i=r(20744);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.c(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,a]=t.split("."),n=/^\s*\d+\s*$/;if(!o?.match||!n.test(o))throw new i.c((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new i.c((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(a,10);return new e(s,l,r)}}},8472:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{OM:()=>i,Ur:()=>o});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},92896:(e,t,r)=>{r.d(t,{mc:()=>o});var i=r(72008);function o(e,t=!1){return e<=i._?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},23704:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(66360);const o=()=>i.c.getLogger("esri.views.3d.support.buffer.math")},24363:(e,t,r)=>{r.d(t,{C_:()=>u,Su:()=>l,i_:()=>c});var i=r(53648),o=r(52180),a=r(98472),n=r(62484),s=r(20136);function l(e){return e?{origin:(0,n.ct)(e.origin),vector:(0,n.ct)(e.vector)}:{origin:(0,n.Su)(),vector:(0,n.Su)()}}function c(e,t,r=l()){return(0,a.c)(r.origin,e),(0,a.f)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,n){const{vector:l,origin:c}=e,u=(0,a.f)(s.Wq.get(),t,c),d=(0,a.j)(l,u)/(0,a.o)(l);return(0,a.i)(n,l,(0,i.qk)(d,0,1)),(0,a.g)(n,n,e.origin)}(e,t,0,0,r)}(0,n.Su)(),(0,n.Su)(),new o.o((()=>l()))},90484:(e,t,r)=>{r.d(t,{CE:()=>u,Su:()=>n,em:()=>l,i_:()=>c}),r(92400);var i=r(52180),o=r(98472),a=r(62484);function n(e){return e?s((0,a.ct)(e.origin),(0,a.ct)(e.direction)):s((0,a.Su)(),(0,a.Su)())}function s(e,t){return{origin:e,direction:t}}function l(e,t){const r=d.get();return r.origin=e,r.direction=t,r}function c(e,t,r=n()){return(0,o.c)(r.origin,e),(0,o.f)(r.direction,t,e),r}function u(e,t,r){const i=(0,o.j)(e.direction,(0,o.f)(r,t,e.origin));return(0,o.g)(r,e.origin,(0,o.i)(r,e.direction,i)),r}r(20136);const d=new i.o((()=>n()))},96472:(e,t,r)=>{r.d(t,{fetch:()=>Wt});var i=r(8472),o=r(77556),a=r(68612),n=r(15008),s=r(87104),l=r(98472),c=r(62484),u=r(77048),d=r(92896),h=r(71004),m=r(48952),f=r(92160),p=r(12240),g=r(88340),v=r(74960),_=r(57792),x=r(68268),T=r(2888),b=r(5472),S=r(38600);function E(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.cX,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.Qw,n=(0,a.WK)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.WK)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.WK)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.Su)();return(0,o.iW)(c,s,l),(0,o.iW)(c,n,c),c}class A{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class y{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new A,this.numberOfVertices=0}}var C=r(2600),M=r(40196),w=r(33184),I=r(20744),R=r(66360);class O{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var N=r(10860),P=r(95728),L=r(97143);async function D(e,t){const{data:r}=await(0,C.c)(e,{responseType:"image",...t});return r}var F=r(89560),U=r(12260),B=r(71520),G=r(9456),V=r(77860),z=r(70680),Y=r(72008),H=r(28176),W=r(49628),j=r(24832);let q;var k,K;(K=k||(k={}))[K.ETC1_RGB=0]="ETC1_RGB",K[K.ETC2_RGBA=1]="ETC2_RGBA",K[K.BC1_RGB=2]="BC1_RGB",K[K.BC3_RGBA=3]="BC3_RGBA",K[K.BC4_R=4]="BC4_R",K[K.BC5_RG=5]="BC5_RG",K[K.BC7_M6_RGB=6]="BC7_M6_RGB",K[K.BC7_M5_RGBA=7]="BC7_M5_RGBA",K[K.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",K[K.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",K[K.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",K[K.ATC_RGB=11]="ATC_RGB",K[K.ATC_RGBA=12]="ATC_RGBA",K[K.FXT1_RGB=17]="FXT1_RGB",K[K.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",K[K.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",K[K.ETC2_EAC_R11=20]="ETC2_EAC_R11",K[K.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",K[K.RGBA32=13]="RGBA32",K[K.RGB565=14]="RGB565",K[K.BGR565=15]="BGR565",K[K.RGBA4444=16]="RGBA4444";var $=r(77800),X=r(22184),J=r(97684);let Z=null,Q=null;async function ee(){return null==Q&&(Q=function(){if(null==q){const e=e=>(0,j.O)(`esri/libs/basisu/${e}`);q=r.e(4824).then(r.bind(r,84824)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),Z=await Q),Q}function te(e,t,r,i,o){const a=(0,J.O4)(t?$.sr.COMPRESSED_RGBA8_ETC2_EAC:$.sr.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function re(e){return e.getNumImages()>=1&&!e.isUASTC()}function ie(e){return e.getFaces()>=1&&e.isETC1S()}function oe(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[k.ETC2_RGBA,$.sr.COMPRESSED_RGBA8_ETC2_EAC]:[k.ETC1_RGB,$.sr.COMPRESSED_RGB8_ETC2]:c?i?[k.BC3_RGBA,$.sr.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[k.BC1_RGB,$.sr.COMPRESSED_RGB_S3TC_DXT1_EXT]:[k.RGBA32,$.Id.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?$.Ud.LINEAR_MIPMAP_LINEAR:$.Ud.LINEAR,t.width=o,t.height=a,new X.w(e,t,{type:"compressed",levels:m})}var ae=r(58608),ne=r(74376);const se=()=>R.c.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function le(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ce=le("DXT1"),ue=le("DXT3"),de=le("DXT5");function he(e,t,r){if(e instanceof ImageData)return he(me(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function me(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.c("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var fe,pe,ge=r(90736),ve=r(51576);class _e extends ae.u{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=ne.C.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new V.c,this._parameters={...Te,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,H.ue)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,H.o9)(e.src)||(0,H.ue)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new ve.O;return t.wrapMode=this._parameters.wrap??$.Qz.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?$.Ud.LINEAR_MIPMAP_LINEAR:$.Ud.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,Y.uk)(e)||(0,Y.K2)(e))return t.encoding===U.yk.KTX2_ENCODING?function(e,t){if(null==Z)return e.byteLength;const r=new Z.KTX2File(new Uint8Array(e)),i=ie(r)?te(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===U.yk.BASIS_ENCODING?function(e,t){if(null==Z)return e.byteLength;const r=new Z.BasisFile(new Uint8Array(e)),i=re(r)?te(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?xe(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new X.w(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,Y.uk)(t)||(0,Y.K2)(t))&&this._parameters.encoding===U.yk.DDS_ENCODING?this._loadFromDDSData(e,t):((0,Y.uk)(t)||(0,Y.K2)(t))&&this._parameters.encoding===U.yk.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,Y.uk)(t)||(0,Y.K2)(t))&&this._parameters.encoding===U.yk.BASIS_ENCODING?this._loadFromBasis(e,t):(0,Y.K2)(t)?this._loadFromPixelData(e,t):(0,Y.uk)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return se().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return se().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case ce:o=8,a=$.sr.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:o=16,a=$.sr.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case de:o=16,a=$.sr.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return se().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(se().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,d=new Uint8Array(e,m,h),f.push(d),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:a,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?$.Ud.LINEAR_MIPMAP_LINEAR:$.Ud.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new X.w(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Z&&(Z=await ee());const i=new Z.KTX2File(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=oe(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Z&&(Z=await ee());const i=new Z.BasisFile(new Uint8Array(r));if(!re(i))return null;i.startTranscoding();const o=oe(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.Uc)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?$.Id.LUMINANCE:3===this._parameters.components?$.Id.RGB:$.Id.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new X.w(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,N.wp)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,W.wx)(t,t.src,!1,r);return(0,N.wp)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,z.oR)(l)},n=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new I.c("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,N.wD)(r,(()=>s((0,N.Uh)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?me(e):e;let i=e.width,o=e.height;do{i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o}while(r>1048576||null!=t&&(i>t||o>t));return he(e,i,o)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return he(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=xe(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?$.Id.RGB:$.Id.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new X.w(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,z.yI)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function xe(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(pe=fe||(fe={}))[pe.HAVE_NOTHING=0]="HAVE_NOTHING",pe[pe.HAVE_METADATA=1]="HAVE_METADATA",pe[pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",pe[pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",pe[pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Te={wrap:{s:$.Qz.REPEAT,t:$.Qz.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var be=r(4636),Se=r(21288),Ee=r(72364),Ae=r(80324),ye=r(88196),Ce=r(58472),Me=r(81832),we=r(10375),Ie=r(81048),Re=r(56336),Oe=r(81472);const Ne=(0,Oe.ac)($.w$.SRC_ALPHA,$.w$.ONE,$.w$.ONE_MINUS_SRC_ALPHA,$.w$.ONE_MINUS_SRC_ALPHA),Pe=(0,Oe.KO)($.w$.ONE,$.w$.ONE),Le=(0,Oe.KO)($.w$.ZERO,$.w$.ONE_MINUS_SRC_ALPHA);function De(e){return e===Re.H.FrontFace?null:e===Re.H.Alpha?Le:Pe}const Fe={factor:-1,units:-2};function Ue(e,t=$.et.LESS){return e===Re.H.NONE||e===Re.H.FrontFace?t:$.et.LEQUAL}var Be=r(40328),Ge=r(84752),Ve=r(29244);const ze=new class{constructor(e=0){this.offset=e,this.sphere=(0,Ge.d)(),this.tmpVertex=(0,c.Su)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,l.s)(Ye,e,t,r),a=(0,l.e)(o,o,i),n=this.offset/(0,l.l)(a);(0,l.q)(a,a,a,n);const s=this.objectTransform.inverse;return(0,l.e)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,l.l)(e);(0,l.q)(e,e,e,r);const i=this.offset/(0,l.l)(t);(0,l.q)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,l.l)((0,Ge.g)(e)),r=this.offset/t;return(0,l.q)((0,Ge.g)(this.sphere),(0,Ge.g)(e),(0,Ge.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,c.Su)(),this._tmpMbs=(0,Ge.d)(),this._tmpObb=new Ve.Eb,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,l.l)(e)}applyToVertex(e,t,r){const i=(0,l.s)(Ye,e,t,r),o=(0,l.s)(He,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,l.l)(o);return(0,l.q)(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),u=Math.abs(o),d=Math.abs(a),h=Math.abs(n),m=Math.abs(s),f=.5*(1+Math.sign(r*a))*Math.min(l,d),p=.5*(1+Math.sign(i*n))*Math.min(c,h),g=.5*(1+Math.sign(o*s))*Math.min(u,m),v=Math.max(l,d),_=Math.max(c,h),x=Math.max(u,m),T=Math.sqrt(f*f+p*p+g*g),b=Math.sign(l+r),S=Math.sign(c+i),E=Math.sign(u+o),A=Math.sign(d+a),y=Math.sign(h+n),C=Math.sign(m+s),M=this._totalOffset;if(T<M)return e[0]-=(1-b)*M,e[1]-=(1-S)*M,e[2]-=(1-E)*M,e[3]+=A*M,e[4]+=y*M,e[5]+=C*M,e;const w=M/Math.sqrt(v*v+_*_+x*x),I=M/T,R=I-w,O=-R;return e[0]+=r*(b*O+I),e[1]+=i*(S*O+I),e[2]+=o*(E*O+I),e[3]+=a*(A*R+w),e[4]+=n*(y*R+w),e[5]+=s*(C*R+w),e}applyToMbs(e){const t=(0,l.l)((0,Ge.g)(e)),r=this._totalOffset/t;return(0,l.q)((0,Ge.g)(this._tmpMbs),(0,Ge.g)(e),(0,Ge.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,Ve.er)(e,this._totalOffset,this._totalOffset,Se.UZ.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.Su)()}applyToVertex(e,t,r){const i=(0,l.s)(Ye,e,t,r),o=(0,l.g)(He,i,this.localOrigin),a=this.offset/(0,l.l)(o);return(0,l.q)(this.tmpVertex,i,o,a),this.tmpVertex}applyToAabb(e){const t=We,r=je,i=qe;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=0==(e&1<<o)?t[o]:r[o];a(i)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(0==(n&e)){for(let o=0;o<3;++o)i[o]=0!=(n&1<<o)?0:0!=(e&1<<o)?t[o]:r[o];a(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const Ye=(0,c.Su)(),He=(0,c.Su)(),We=(0,c.Su)(),je=(0,c.Su)(),qe=(0,c.Su)();function ke(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){const t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function Ke(e,t,r,i){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function $e(e,t,r,i=1){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}function Xe(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}function Je(e,t,r,i,o,a){switch(e){case be.K.POSITION:{(0,ge.Uc)(3===t.size);const i=o.getField(e,h.Yj);(0,ge.Uc)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void Ke(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,u=s.length,d=t[0],h=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],x=t[10],T=t[12],b=t[13],S=t[14];i*=c;let E=0,A=0,y=0;const C=(0,n.yp)(t)?e=>{E=a[e]+T,A=a[e+1]+b,y=a[e+2]+S}:e=>{const t=a[e],r=a[e+1],i=a[e+2];E=d*t+f*r+v*i+T,A=h*t+p*r+_*i+b,y=m*t+g*r+x*i+S};if(1===o)for(let e=0;e<u;++e)C(3*s[e]),l[i]=E,l[i+1]=A,l[i+2]=y,i+=c;else for(let e=0;e<u;++e){C(3*s[e]);for(let e=0;e<o;++e)l[i]=E,l[i+1]=A,l[i+2]=y,i+=c}}(t,r,i,a);break}case be.K.NORMAL:{(0,ge.Uc)(3===t.size);const r=o.getField(e,h.Yj);(0,ge.Uc)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void Ke(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],x=l[9],T=l[10],b=!(0,n.QT)(l),S=1e-6,E=1-S;i*=u;let A=0,y=0,C=0;const M=(0,n.yp)(l)?e=>{A=a[e],y=a[e+1],C=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];A=h*t+p*r+_*i,y=m*t+g*r+x*i,C=f*t+v*r+T*i};if(1===o)if(b)for(let e=0;e<d;++e){M(3*s[e]);const t=A*A+y*y+C*C;if(t<E&&t>S){const e=1/Math.sqrt(t);c[i]=A*e,c[i+1]=y*e,c[i+2]=C*e}else c[i]=A,c[i+1]=y,c[i+2]=C;i+=u}else for(let e=0;e<d;++e)M(3*s[e]),c[i]=A,c[i+1]=y,c[i+2]=C,i+=u;else for(let e=0;e<d;++e){if(M(3*s[e]),b){const e=A*A+y*y+C*C;if(e<E&&e>S){const t=1/Math.sqrt(e);A*=t,y*=t,C*=t}}for(let e=0;e<o;++e)c[i]=A,c[i+1]=y,c[i+2]=C,i+=u}}(t,i,r,a);break}case be.K.NORMALCOMPRESSED:{(0,ge.Uc)(2===t.size);const r=o.getField(e,h.iN);(0,ge.Uc)(!!r,`No buffer view for ${e}`),r&&ke(t,r,a);break}case be.K.UV0:{(0,ge.Uc)(2===t.size);const r=o.getField(e,h.U7);(0,ge.Uc)(!!r,`No buffer view for ${e}`),r&&ke(t,r,a);break}case be.K.COLOR:case be.K.SYMBOLCOLOR:{const r=o.getField(e,h.sb);(0,ge.Uc)(!!r,`No buffer view for ${e}`),(0,ge.Uc)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t!==a.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else{s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;const u=c*o;for(let r=1;r<u;++r)e[i]=n,i+=t}}(t,t.size,r,a);break}case be.K.COLORFEATUREATTRIBUTE:{const r=o.getField(e,h.AZ);(0,ge.Uc)(!!r,`No buffer view for ${e}`),(0,ge.Uc)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case be.K.TANGENT:{(0,ge.Uc)(4===t.size);const r=o.getField(e,h._5);(0,ge.Uc)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void $e(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,u=r.typedBufferStride,d=s.length,h=l[0],m=l[1],f=l[2],p=l[4],g=l[5],v=l[6],_=l[8],x=l[9],T=l[10],b=!(0,n.QT)(l),S=1e-6,E=1-S;if(i*=u,1===o)for(let e=0;e<d;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],l=a[t+3];let d=h*r+p*o+_*n,A=m*r+g*o+x*n,y=f*r+v*o+T*n;if(b){const e=d*d+A*A+y*y;if(e<E&&e>S){const t=1/Math.sqrt(e);d*=t,A*=t,y*=t}}c[i]=d,c[i+1]=A,c[i+2]=y,c[i+3]=l,i+=u}else for(let e=0;e<d;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],d=a[t+3];let A=h*r+p*n+_*l,y=m*r+g*n+x*l,C=f*r+v*n+T*l;if(b){const e=A*A+y*y+C*C;if(e<E&&e>S){const t=1/Math.sqrt(e);A*=t,y*=t,C*=t}}for(let e=0;e<o;++e)c[i]=A,c[i+1]=y,c[i+2]=C,c[i+3]=d,i+=u}}(t,i,r,a);break}case be.K.PROFILERIGHT:case be.K.PROFILEUP:case be.K.PROFILEVERTEXANDNORMAL:case be.K.FEATUREVALUE:{(0,ge.Uc)(4===t.size);const r=o.getField(e,h._5);(0,ge.Uc)(!!r,`No buffer view for ${e}`),r&&$e(t,r,a)}}}class Ze{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(be.K.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)Je(n,t,r,i,o,a);else if(n===be.K.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(be.K.POSITION)?.indices;if(t){const r=t.length,i=o.getField(n,h.sb);Xe(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var Qe=r(22592),et=r(37008),tt=r(55164),rt=r(60072),it=r(74072),ot=r(74780),at=r(93316),nt=r(63524),st=r(1492);$.et.LESS,$.et.ALWAYS;const lt={mask:255},ct={function:{func:$.et.ALWAYS,ref:U.Aj.OutlineVisualElementMask,mask:U.Aj.OutlineVisualElementMask},operation:{fail:$.QD.KEEP,zFail:$.QD.KEEP,zPass:$.QD.ZERO}},ut={function:{func:$.et.ALWAYS,ref:U.Aj.OutlineVisualElementMask,mask:U.Aj.OutlineVisualElementMask},operation:{fail:$.QD.KEEP,zFail:$.QD.KEEP,zPass:$.QD.REPLACE}};$.et.EQUAL,U.Aj.OutlineVisualElementMask,U.Aj.OutlineVisualElementMask,$.QD.KEEP,$.QD.KEEP,$.QD.KEEP,$.et.NOTEQUAL,U.Aj.OutlineVisualElementMask,U.Aj.OutlineVisualElementMask,$.QD.KEEP,$.QD.KEEP,$.QD.KEEP;const dt=[1,1,.5],ht=[0,.6,.2],mt=[0,1,.2];var ft=r(83840);class pt extends rt.Yj{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.eu)(dt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=U.CM.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.WK)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=ye.g.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.WK)(.2,.2,.2),this.diffuse=(0,c.WK)(.8,.8,.8),this.externalColor=(0,et.WK)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.Su)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=U.sr.Less,this.textureAlphaMode=U.OA.Blend,this.textureAlphaCutoff=it.k,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.C2.Occlude,this.isDecoration=!1}}rt.yO;class gt extends at.O{initializeConfiguration(e,t){t.spherical=e.viewingMode===Se.UZ.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?tt.i.Default:tt.i.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,gt.shader)}_initializeProgram(e,t){return new st.G(e.rctx,t.get().build(this.configuration),nt.q)}_convertDepthTestFunction(e){return e===U.sr.Lequal?$.et.LEQUAL:$.et.LESS}_makePipeline(e,t){const r=this.configuration,i=e===Re.H.NONE,o=e===Re.H.FrontFace;return(0,Oe._w)({blending:r.output!==Ae.mC.Color&&r.output!==Ae.mC.Alpha||!r.transparent?null:i?Ne:De(e),culling:vt(r)?(0,Oe.AD)(r.cullFace):null,depthTest:{func:Ue(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Oe.AT:null,colorWrite:Oe.kp,stencilWrite:r.hasOccludees?lt:null,stencilTest:r.hasOccludees?t?ut:ct:null,polygonOffset:i||o?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function vt(e){return e.cullFace!==U.CM.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}gt.shader=new ot.O(ft.D,(()=>r.e(5880).then(r.bind(r,75880))));var _t=r(41948),xt=r(74912),Tt=r(11925),bt=r(75040);class St extends Tt.i0{}(0,_t._)([(0,xt.y)({constValue:!0})],St.prototype,"hasSliceHighlight",void 0),(0,_t._)([(0,xt.y)({constValue:!1})],St.prototype,"hasSliceInVertexProgram",void 0),(0,_t._)([(0,xt.y)({constValue:bt.u.Pass})],St.prototype,"pbrTextureBindType",void 0);class Et extends St{constructor(){super(...arguments),this.output=Ae.mC.Color,this.alphaDiscardMode=U.OA.Opaque,this.doubleSidedMode=Ce.J.None,this.pbrMode=Me.Ax.Disabled,this.cullFace=U.CM.None,this.transparencyPassType=Re.H.NONE,this.normalType=ye.g.Attribute,this.textureCoordinateType=tt.i.None,this.customDepthTest=U.sr.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,_t._)([(0,xt.y)({count:Ae.mC.COUNT})],Et.prototype,"output",void 0),(0,_t._)([(0,xt.y)({count:U.OA.COUNT})],Et.prototype,"alphaDiscardMode",void 0),(0,_t._)([(0,xt.y)({count:Ce.J.COUNT})],Et.prototype,"doubleSidedMode",void 0),(0,_t._)([(0,xt.y)({count:Me.Ax.COUNT})],Et.prototype,"pbrMode",void 0),(0,_t._)([(0,xt.y)({count:U.CM.COUNT})],Et.prototype,"cullFace",void 0),(0,_t._)([(0,xt.y)({count:Re.H.COUNT})],Et.prototype,"transparencyPassType",void 0),(0,_t._)([(0,xt.y)({count:ye.g.COUNT})],Et.prototype,"normalType",void 0),(0,_t._)([(0,xt.y)({count:tt.i.COUNT})],Et.prototype,"textureCoordinateType",void 0),(0,_t._)([(0,xt.y)({count:U.sr.COUNT})],Et.prototype,"customDepthTest",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"spherical",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasVertexColors",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasSymbolColors",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasVerticalOffset",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasSlicePlane",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasSliceHighlight",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasColorTexture",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasMetallicRoughnessTexture",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasEmissionTexture",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasOcclusionTexture",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasNormalTexture",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasScreenSizePerspective",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasVertexTangents",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasOccludees",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"multipassEnabled",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasModelTransformation",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"offsetBackfaces",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"vvSize",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"vvColor",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"receiveShadows",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"receiveAmbientOcclusion",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"textureAlphaPremultiplied",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"instanced",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"instancedColor",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"objectAndLayerIdColorInstanced",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"instancedDoublePrecision",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"writeDepth",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"transparent",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"enableOffset",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"cullAboveGround",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"snowCover",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasColorTextureTransform",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasEmissionTextureTransform",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasNormalTextureTransform",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasOcclusionTextureTransform",void 0),(0,_t._)([(0,xt.y)()],Et.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,_t._)([(0,xt.y)({constValue:!1})],Et.prototype,"occlusionPass",void 0),(0,_t._)([(0,xt.y)({constValue:!0})],Et.prototype,"hasVvInstancing",void 0),(0,_t._)([(0,xt.y)({constValue:!1})],Et.prototype,"useCustomDTRExponentForWater",void 0),(0,_t._)([(0,xt.y)({constValue:!1})],Et.prototype,"supportsTextureAtlas",void 0),(0,_t._)([(0,xt.y)({constValue:!0})],Et.prototype,"useFillLights",void 0);var At=r(59888);class yt extends gt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=ye.g.Attribute,t.doubleSidedMode=Ce.J.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,yt.shader)}}yt.shader=new ot.O(At.R,(()=>r.e(1980).then(r.bind(r,81980))));class Ct extends Ie.iK{constructor(e){super(e,wt),this.supportsEdges=!0,this.produces=new Map([[Be.y.OPAQUE_MATERIAL,e=>((0,Ae.ue)(e)||(0,Ae.KQ)(e))&&!this.parameters.transparent],[Be.y.TRANSPARENT_MATERIAL,e=>((0,Ae.ue)(e)||(0,Ae.KQ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[Be.y.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,Ae.ue)(e)||(0,Ae.KQ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new Et,this._vertexBufferLayout=function(e){const t=(0,Ee.iC)().vec3f(be.K.POSITION);return e.normalType===ye.g.Compressed?t.vec2i16(be.K.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(be.K.NORMAL),e.hasVertexTangents&&t.vec4f(be.K.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(be.K.UV0),e.hasVertexColors&&t.vec4u8(be.K.COLOR),e.hasSymbolColors&&t.vec4u8(be.K.SYMBOLCOLOR),(0,G.c)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(be.K.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Ae.mC.Shadow&&e!==Ae.mC.ShadowExcludeHighlight&&e!==Ae.mC.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?U.CM.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Ae.mC.Color&&e!==Ae.mC.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ce.J.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ce.J.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ce.J.WindingOrder:Ce.J.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Me.Ax.Schematic:Me.Ax.Normal:Me.Ax.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Lt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case Se.UZ.Global:a=(0,l.n)(Nt,Lt);break;case Se.UZ.Local:a=(0,l.c)(Nt,Ot)}let n=0;const s=(0,l.f)(Dt,Lt,e.eye),c=(0,l.l)(s),u=(0,l.i)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.j)(a,u)),n+=(0,Qe.u6)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.i)(a,a,n),(0,l.t)(Pt,a,r.transform.inverseRotation),i=(0,l.f)(It,i,Pt),o=(0,l.f)(Rt,o,Pt)}var n;(0,Qe.Ep)(e,r,i,o,null!=(n=r.verticalOffset)?(ze.offset=n,ze):null,a)}createGLMaterial(e){return new Mt(e)}createBufferWriter(){return new Ze(this._vertexBufferLayout)}}class Mt extends we.Q{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Ae.mC.Color&&this._output!==Ae.mC.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?yt:gt,e)}}const wt=new class extends pt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},It=(0,c.Su)(),Rt=(0,c.Su)(),Ot=(0,c.WK)(0,0,1),Nt=(0,c.Su)(),Pt=(0,c.Su)(),Lt=(0,c.Su)(),Dt=(0,c.Su)(),Ft=()=>R.c.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Ut(e){throw new I.c("",`Request for object resource failed: ${e}`)}function Bt(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Ft().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Ft().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Ft().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Ft().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Ft().warn("Indexed geometries must specify faces"),i=!1;break}default:Ft().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Ft().warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Ft().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Gt(e){const t=(0,u.FZ)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.K8)(t,r.bbMin),(0,u.K8)(t,r.bbMax))})),t}function Vt(e){switch(e){case"mask":return U.OA.Mask;case"maskAndTransparency":return U.OA.MaskBlend;case"none":return U.OA.Opaque;default:return U.OA.Blend}}function zt(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Yt=new P.a(1,2,"wosr");var Ht=r(44875);async function Wt(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.Ur)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,M.aG)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,N.CE)(i.error),Ut(i.error.details.url)}(e,r,t);const i=await(0,M.aG)((0,C.c)(e,t));if(!0===i.ok)return i.value.data;(0,N.CE)(i.error),Ut(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Ft().warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:$.Qz.REPEAT,t:$.Qz.REPEAT},preMultiplyAlpha:Vt(l)!==U.OA.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):D(n,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,w.UN)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new O,n=e.resource,s=P.a.parse(n.version||"1.0","wosr");Yt.validate(s);const l=n.model.name,u=n.model.geometries,d=n.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const n=u[e];if(!Bt(n))continue;const s=zt(n),l=n.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=l[be.K.POSITION],_=v.values.length/v.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=g(e)??(0,L.yh)(_);p.push([e,new F.O(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!f.has(x)){const{image:e,parameters:t}=T,r=new _e(e,t);i.push(r),f.set(x,r)}const b=f.get(x),S=b?b.id:void 0,E=s.material;let A=a.get(E,x);if(null==A){const e=d[E.substring(E.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=T?Vt(T.alphaChannelUsage):void 0,n={ambient:(0,c.eu)(e.diffuse),diffuse:(0,c.eu)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:S,initTextureTransparent:!0,doubleSided:!0,cullFace:U.CM.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),A=new Ct(n),a.set(E,x,A)}o.push(A);const y=new B.K(A,p);m+=p.find((e=>e[0]===be.K.POSITION))?.[1]?.indices.length??0,r.push(y)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Gt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.G)(new _.k(t.streamDataRequester),r.url,t,t.usePBR)),S=a.model.meta?.ESRI_proxyEllipsoid,A=a.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===a.meta.ESRI_webstyle;A&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,u=a.count,d=(0,c.Su)(),m=(0,c.Su)(),f=(0,c.Su)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,n.S_)((0,s.Su)(),o.transform);let _=0,x=0;for(let n=0;n<u;n++){a.getVec(n,m),i.getVec(n,d),(0,l.e)(m,m,o.transform),(0,l.f)(f,m,t.center),(0,l.G)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.G)(f,f,t.radius),null!==v&&(0,l.e)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.k)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}o.attributes.normal=new h.Yj(g),o.attributes.color=new h.sb(p)}}}(a,S));const I=!!t.usePBR,R=a.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:A,mrrFactors:[...mt]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...dt]},G={...t.materialParameters,treeRendering:A},{engineResources:V,referenceBoundingBox:z}=function(e,t,r,i){const a=e.model,n=new Array,s=new Map,_=new Map,x=a.lods.length,S=(0,u.FZ)();return a.lods.forEach(((e,A)=>{const C=!0===i.skipHighLods&&(x>1&&0===A||x>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(C&&0!==A)return;const M=new y(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=C?new Ct({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return U.OA.Blend;case"MASK":return U.OA.Mask;case"OPAQUE":case null:case void 0:return U.OA.Opaque}}(u.alphaMode);if(!a.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new _e((0,b.e6)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,b.e6)(e)&&r,encoding:(0,b.e6)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==U.OA.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/Ht.g),f=u.color[1]**(1/Ht.g),p=u.color[2]**(1/Ht.g),g=u.emissiveFactor[0]**(1/Ht.g),v=u.emissiveFactor[1]**(1/Ht.g),_=u.emissiveFactor[2]**(1/Ht.g),x=null!=u.textureColor&&d?n.get(u.textureColor):null,T=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==o&&(null==a||(0,l.h)(a,c.cX))&&null==n&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});a.set(s,new Ct({...i,transparent:m===U.OA.Blend,customDepthTest:U.sr.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?U.CM.None:U.CM.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?ye.g.Attribute:ye.g.ScreenDerivative,castShadows:!0,receiveShadows:u.receiveShadows,receiveAmbientOcclusion:u.receiveAmbientOcclustion,textureId:null!=x?x.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?n.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=x&&!!x.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?n.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?n.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?n.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:T?[...ht]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:T,colorTextureTransformMatrix:E(u.colorTextureTransform),normalTextureTransformMatrix:E(u.normalTextureTransform),occlusionTextureTransformMatrix:E(u.occlusionTextureTransform),emissiveTextureTransformMatrix:E(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:E(u.metallicRoughnessTextureTransform),...o}))}const f=a.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(a,e,M,t,r,s,_),{geometry:n,vertexCount:x}=function(e,t){const r=e.attributes.position.count,i=(0,T.y)(e.indices||r,e.primitiveType),a=(0,d.mc)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,m.a)(a,n,e.transform,3,s);const l=[[be.K.POSITION,new F.O(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,d.mc)(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.yy)(jt,e.transform),(0,m.b)(t,a,jt,3,n),l.push([be.K.NORMAL,new F.O(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,d.mc)(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.yy)(jt,e.transform),(0,f.t)(t,a,jt,4,n),l.push([be.K.TANGENT,new F.O(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,d.mc)(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,p.n)(t,o,2,a),l.push([be.K.UV0,new F.O(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof h._5?(0,f.s)(t,e.attributes.color,255):e.attributes.color instanceof h.sb?(0,v.c)(t,e.attributes.color):e.attributes.color instanceof h.Ig&&(0,f.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof h.Yj?(0,m.s)(t,e.attributes.color,255,4):e.attributes.color instanceof h.IN?(0,g.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof h.k5&&(0,m.s)(t,e.attributes.color,1/256,4)),l.push([be.K.COLOR,new F.O(t,i,4,!0)])}return{geometry:new B.K(t,l),vertexCount:r}}(e,null!=i?i:new Ct({})),y=n.boundingInfo;null!=y&&0===A&&((0,u.K8)(S,y.bbMin),(0,u.K8)(S,y.bbMax)),null!=i&&(M.stageResources.geometries.push(n),M.numberOfVertices+=x)})),C||n.push(M)})),{engineResources:n,referenceBoundingBox:S}}(a,R,G,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:V,referenceBoundingBox:z,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const jt=(0,a.Su)()},78720:(e,t,r)=>{var i,o;r.d(t,{KQ:()=>i}),r(53648),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},72364:(e,t,r)=>{r.d(t,{U1:()=>c,iC:()=>l});var i=r(71004),o=r(98132),a=r(90736);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}vec2f(e,t){return this._appendField(e,i.U7,t),this}vec2f64(e,t){return this._appendField(e,i.wT,t),this}vec3f(e,t){return this._appendField(e,i.Yj,t),this}vec3f64(e,t){return this._appendField(e,i.Ax,t),this}vec4f(e,t){return this._appendField(e,i._5,t),this}vec4f64(e,t){return this._appendField(e,i.Ip,t),this}mat3f(e,t){return this._appendField(e,i.Ko,t),this}mat3f64(e,t){return this._appendField(e,i.m_,t),this}mat4f(e,t){return this._appendField(e,i.IL,t),this}mat4f64(e,t){return this._appendField(e,i.mF,t),this}vec4u8(e,t){return this._appendField(e,i.sb,t),this}f32(e,t){return this._appendField(e,i.AZ,t),this}f64(e,t){return this._appendField(e,i.oN,t),this}u8(e,t){return this._appendField(e,i.Kg,t),this}u16(e,t){return this._appendField(e,i.E_,t),this}i8(e,t){return this._appendField(e,i.kV,t),this}vec2i8(e,t){return this._appendField(e,i.oR,t),this}vec2i16(e,t){return this._appendField(e,i.iN,t),this}vec2u8(e,t){return this._appendField(e,i.eS,t),this}vec4u16(e,t){return this._appendField(e,i.Ig,t),this}u32(e,t){return this._appendField(e,i.Ym,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.Uc)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.Ad)(t.ElementType),n=this._stride;this._stride+=i,this._fields.set(e,{size:i,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,o.Ad)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:d(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const u=[i.AZ,i.U7,i.Yj,i._5,i.Ko,i.IL,i.oN,i.wT,i.Ax,i.Ip,i.m_,i.mF,i.Kg,i.eS,i.IN,i.sb,i.E_,i.kg,i.k5,i.Ig,i.Ym,i.qZ,i.ER,i.q$,i.kV,i.oR,i.Oq,i.mq,i.Mt,i.iN,i.g7,i.OS,i.Ep,i.mI,i.Yv,i.i9];function d(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;u.forEach((e=>m.set(d(e),e)))},29244:(e,t,r)=>{r.d(t,{Eb:()=>Te,er:()=>Re});var i=r(77556),o=r(68612),a=r(87104),n=r(41512),s=r(2620),l=r(98472),c=r(62484),u=r(74784),d=r(37008),h=r(22080),m=r(82448),f=r(51120),p=r(62880),g=r(38380),v=r(58632),_=r(60544),x=r(20136),T=r(21288),b=r(85256),S=r(89560);const E=1e-6,A=(0,c.Su)(),y=(0,c.Su)();function C(e,t,r,i,o,a,n,s,l,c){return function(e,t,r){let i=_e(e.maxVert[0],e.minVert[0]),o=0;for(let t=1;t<7;++t){const r=_e(e.maxVert[t],e.minVert[t]);r>i&&(i=r,o=t)}fe(t,e.minVert[o]),fe(r,e.maxVert[o])}(e,i,o),_e(i,o)<E?1:(he(n,i,o),ge(n,n),function(e,t,r,i){const{data:o,size:a}=e;let n=Number.NEGATIVE_INFINITY,s=0;for(let e=0;e<o.length;e+=a){F[0]=o[e]-t[0],F[1]=o[e+1]-t[1],F[2]=o[e+2]-t[2];const i=r[0]*F[0]+r[1]*F[1]+r[2]*F[2],a=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],l=F[0]*F[0]+F[1]*F[1]+F[2]*F[2]-i*i/a;l>n&&(n=l,s=e)}return fe(i,o,s),n}(t,i,n,a)<E?2:(he(s,o,a),ge(s,s),he(l,a,i),ge(l,l),pe(r,s,n),ge(r,r),W(t,r,n,s,l,c),0))}const M=(0,c.Su)(),w=(0,c.Su)(),I=(0,c.Su)(),R=(0,c.Su)(),O=(0,c.Su)(),N=(0,c.Su)(),P=(0,c.Su)(),L=(0,c.Su)();function D(e,t,r,i,o,a,n,s,l){(function(e,t,r,i,o){!function(e,t,r,i,o){const{data:a,size:n}=e;fe(i,a),fe(o,i),r[0]=xe(j,t),r[1]=r[0];for(let e=n;e<a.length;e+=n){const n=a[e]*t[0]+a[e+1]*t[1]+a[e+2]*t[2];n<r[0]&&(r[0]=n,fe(i,a,e)),n>r[1]&&(r[1]=n,fe(o,a,e))}}(e,t,U,o,i);const a=xe(r,t);U[1]-E<=a&&(i[0]=void 0),U[0]+E>=a&&(o[0]=void 0)})(e,t,r,M,w),void 0!==M[0]&&(he(I,M,r),ge(I,I),he(R,M,i),ge(R,R),he(O,M,o),ge(O,O),pe(N,R,a),ge(N,N),pe(P,O,n),ge(P,P),pe(L,I,s),ge(L,L),W(e,N,a,R,I,l),W(e,P,n,O,R,l),W(e,L,s,I,O,l)),void 0!==w[0]&&(he(I,w,r),ge(I,I),he(R,w,i),ge(R,R),he(O,w,o),ge(O,O),pe(N,R,a),ge(N,N),pe(P,O,n),ge(P,P),pe(L,I,s),ge(L,L),W(e,N,a,R,I,l),W(e,P,n,O,R,l),W(e,L,s,I,O,l))}const F=[0,0,0],U=(0,b.Su)(),B=(0,c.Su)(),G=(0,c.Su)(),V=(0,c.Su)(),z=(0,c.Su)(),Y=(0,c.Su)(),H=(0,c.Su)();function W(e,t,r,i,o,a){if(ve(t)<E)return;pe(B,r,t),pe(G,i,t),pe(V,o,t),q(e,t,U),Y[1]=U[0],z[1]=U[1],H[1]=z[1]-Y[1];const n=[r,i,o],s=[B,G,V];for(let r=0;r<3;++r){q(e,n[r],U),Y[0]=U[0],z[0]=U[1],q(e,s[r],U),Y[2]=U[0],z[2]=U[1],H[0]=z[0]-Y[0],H[2]=z[2]-Y[2];const i=ue(H);i<a.quality&&(fe(a.b0,n[r]),fe(a.b1,t),fe(a.b2,s[r]),a.quality=i)}}const j=(0,c.Su)();function q(e,t,r){const{data:i,size:o}=e;r[0]=Number.POSITIVE_INFINITY,r[1]=Number.NEGATIVE_INFINITY;for(let e=0;e<i.length;e+=o){const o=i[e]*t[0]+i[e+1]*t[1]+i[e+2]*t[2];r[0]=Math.min(r[0],o),r[1]=Math.max(r[1],o)}}function k(e,t,r){r.center=e,r.halfSize=(0,l.i)(t,t,.5),r.quaternion=s.IJ}const K=(0,c.Su)(),$=(0,c.Su)(),X=(0,c.Su)(),J=(0,c.Su)(),Z=(0,c.Su)(),Q=(0,c.Su)();function ee(e,t,r){fe(K,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?K[0]=0:Math.abs(t[1])>Math.abs(t[2])?K[1]=0:K[2]=0,ve(K)<E&&(K[0]=K[1]=K[2]=1),pe($,t,K),ge($,$),pe(X,t,$),ge(X,X),te(e,t,$,X,J,Z),he(Q,Z,J),se(t,$,X,J,Z,Q,r)}function te(e,t,r,i,o,a){q(e,t,U),o[0]=U[0],a[0]=U[1],q(e,r,U),o[1]=U[0],a[1]=U[1],q(e,i,U),o[2]=U[0],a[2]=U[1]}const re=(0,c.Su)(),ie=(0,c.Su)(),oe=(0,c.Su)(),ae=(0,o.WK)(1,0,0,0,1,0,0,0,1),ne=(0,s.Su)();function se(e,t,r,i,o,a,n){ae[0]=e[0],ae[1]=e[1],ae[2]=e[2],ae[3]=t[0],ae[4]=t[1],ae[5]=t[2],ae[6]=r[0],ae[7]=r[1],ae[8]=r[2],n.quaternion=function(e,t){const r=t[0]+t[4]+t[8];if(r>0){let i=Math.sqrt(r+1);e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i}else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const i=(r+1)%3,o=(r+2)%3;let a=Math.sqrt(t[3*r+r]-t[3*i+i]-t[3*o+o]+1);e[r]=.5*a,a=.5/a,e[3]=(t[3*i+o]-t[3*o+i])*a,e[i]=(t[3*i+r]+t[3*r+i])*a,e[o]=(t[3*o+r]+t[3*r+o])*a}return e}(ne,ae),de(re,i,o),me(re,re,.5),me(ie,e,re[0]),me(oe,t,re[1]),de(ie,ie,oe),me(oe,r,re[2]),n.center=(0,l.g)(ie,ie,oe),n.halfSize=(0,l.i)(re,a,.5)}class le{constructor(e){this.minVert=new Array(7),this.maxVert=new Array(7),this.buffer=new ArrayBuffer(448);let t=0;this.minProj=new Float64Array(this.buffer,t,7),t+=56,this.maxProj=new Float64Array(this.buffer,t,7),t+=56;for(let e=0;e<7;++e)this.minVert[e]=new Float64Array(this.buffer,t,3),t+=24;for(let e=0;e<7;++e)this.maxVert[e]=new Float64Array(this.buffer,t,3),t+=24;for(let e=0;e<7;++e)this.minProj[e]=Number.POSITIVE_INFINITY,this.maxProj[e]=Number.NEGATIVE_INFINITY;const r=new Array(7),i=new Array(7),{data:o,size:a}=e;for(let e=0;e<o.length;e+=a){let t=o[e];t<this.minProj[0]&&(this.minProj[0]=t,r[0]=e),t>this.maxProj[0]&&(this.maxProj[0]=t,i[0]=e),t=o[e+1],t<this.minProj[1]&&(this.minProj[1]=t,r[1]=e),t>this.maxProj[1]&&(this.maxProj[1]=t,i[1]=e),t=o[e+2],t<this.minProj[2]&&(this.minProj[2]=t,r[2]=e),t>this.maxProj[2]&&(this.maxProj[2]=t,i[2]=e),t=o[e]+o[e+1]+o[e+2],t<this.minProj[3]&&(this.minProj[3]=t,r[3]=e),t>this.maxProj[3]&&(this.maxProj[3]=t,i[3]=e),t=o[e]+o[e+1]-o[e+2],t<this.minProj[4]&&(this.minProj[4]=t,r[4]=e),t>this.maxProj[4]&&(this.maxProj[4]=t,i[4]=e),t=o[e]-o[e+1]+o[e+2],t<this.minProj[5]&&(this.minProj[5]=t,r[5]=e),t>this.maxProj[5]&&(this.maxProj[5]=t,i[5]=e),t=o[e]-o[e+1]-o[e+2],t<this.minProj[6]&&(this.minProj[6]=t,r[6]=e),t>this.maxProj[6]&&(this.maxProj[6]=t,i[6]=e)}for(let e=0;e<7;++e){let t=r[e];fe(this.minVert[e],o,t),t=i[e],fe(this.maxVert[e],o,t)}}}class ce{constructor(){this.b0=(0,c.WK)(1,0,0),this.b1=(0,c.WK)(0,1,0),this.b2=(0,c.WK)(0,0,1),this.quality=0}}function ue(e){return e[0]*e[1]+e[0]*e[2]+e[1]*e[2]}function de(e,t,r){e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2]}function he(e,t,r){e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2]}function me(e,t,r){e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r}function fe(e,t,r=0){e[0]=t[r],e[1]=t[r+1],e[2]=t[r+2]}function pe(e,t,r){const i=t[0],o=t[1],a=t[2],n=r[0],s=r[1],l=r[2];e[0]=o*l-a*s,e[1]=a*n-i*l,e[2]=i*s-o*n}function ge(e,t){const r=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];if(r>0){const i=1/Math.sqrt(r);e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i}}function ve(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]}function _e(e,t){const r=t[0]-e[0],i=t[1]-e[1],o=t[2]-e[2];return r*r+i*i+o*o}function xe(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}class Te{constructor(e=c.cX,t=We,r=s.IJ){this._data=[e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3]]}clone(){const e=new Te;return e._data=this._data.slice(),e}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(e){const t=new Te;return t._data=e.slice(),t}static fromJSON(e){return new Te(e.center,e.halfSize,e.quaternion)}copy(e){this._data=e.data.slice()}get center(){return(0,l.s)(x.Wq.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set center(e){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2]}setCenter(e,t,r){this._data[0]=e,this._data[1]=t,this._data[2]=r}get halfSize(){return(0,l.s)(x.Wq.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(e){return e[0]=this._data[3],e[1]=this._data[4],e[2]=this._data[5],e}set halfSize(e){this._data[3]=e[0],this._data[4]=e[1],this._data[5]=e[2]}get quaternion(){return(0,n.WO)(x.QX.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(e){return e[0]=this._data[6],e[1]=this._data[7],e[2]=this._data[8],e[3]=this._data[9],e}set quaternion(e){this._data[6]=e[0],this._data[7]=e[1],this._data[8]=e[2],this._data[9]=e[3]}get data(){return this._data}getCorners(e){const t=be,r=this._data;t[0]=r[6],t[1]=r[7],t[2]=r[8],t[3]=r[9];for(let i=0;i<8;++i){const o=e[i];o[0]=(1&i?-1:1)*r[3],o[1]=(2&i?-1:1)*r[4],o[2]=(4&i?-1:1)*r[5],(0,l.r)(o,o,t),o[0]+=r[0],o[1]+=r[1],o[2]+=r[2]}}isVisible(e){return this.intersectPlane(e[0])<=0&&this.intersectPlane(e[1])<=0&&this.intersectPlane(e[2])<=0&&this.intersectPlane(e[3])<=0&&this.intersectPlane(e[4])<=0&&this.intersectPlane(e[5])<=0}get radius(){const e=this._data[3],t=this._data[4],r=this._data[5];return Math.sqrt(e*e+t*t+r*r)}intersectSphere(e){Ae[0]=this._data[0]-e[0],Ae[1]=this._data[1]-e[1],Ae[2]=this._data[2]-e[2];const t=this.getQuaternion(Se);return(0,n.fO)(be,t),(0,l.r)(Ae,Ae,be),(0,l.u)(Ae,Ae),ye[0]=Math.min(Ae[0],this._data[3]),ye[1]=Math.min(Ae[1],this._data[4]),ye[2]=Math.min(Ae[2],this._data[5]),(0,l.v)(ye,Ae)<e[3]*e[3]}intersectSphereWithMBS(e,t=this.radius){const r=this._data;Ae[0]=r[0]-e[0],Ae[1]=r[1]-e[1],Ae[2]=r[2]-e[2];const i=e[3],o=i+t;return!((0,l.w)(Ae)>o*o)&&(be[0]=-r[6],be[1]=-r[7],be[2]=-r[8],be[3]=r[9],(0,l.r)(Ae,Ae,be),(0,l.u)(Ae,Ae),ye[0]=Math.min(Ae[0],r[3]),ye[1]=Math.min(Ae[1],r[4]),ye[2]=Math.min(Ae[2],r[5]),(0,l.v)(ye,Ae)<i*i)}intersectPlane(e){const t=e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3],r=this.projectedRadius((0,v.Oq)(e));return t>r?1:t<-r?-1:0}intersectRay(e,t,r=0){const i=this._data,o=be;o[0]=-i[6],o[1]=-i[7],o[2]=-i[8],o[3]=i[9],Ae[0]=e[0]-i[0],Ae[1]=e[1]-i[1],Ae[2]=e[2]-i[2];const a=(0,l.r)(Ae,Ae,be),n=(0,l.r)(ye,t,be);let s=-1/0,c=1/0;const u=this.getHalfSize(Ue);for(let e=0;e<3;e++){const t=a[e],i=n[e],o=u[e]+r;if(Math.abs(i)>1e-6){const e=(o-t)/i,r=(-o-t)/i;s=Math.max(s,Math.min(e,r)),c=Math.min(c,Math.max(e,r))}else if(t>o||t<-o)return!1}return s<=c}projectedArea(e,t,r,o){const a=this.getQuaternion(Se);(0,n.fO)(be,a),Ae[0]=e[0]-this._data[0],Ae[1]=e[1]-this._data[1],Ae[2]=e[2]-this._data[2],(0,l.r)(Ae,Ae,be);const s=this.getHalfSize(Ue),c=Ae[0]<-s[0]?-1:Ae[0]>s[0]?1:0,d=Ae[1]<-s[1]?-1:Ae[1]>s[1]?1:0,h=Ae[2]<-s[2]?-1:Ae[2]>s[2]?1:0,m=Math.abs(c)+Math.abs(d)+Math.abs(h);if(0===m)return 1/0;const f=1===m?4:6,p=6*(c+3*d+9*h+13);(0,i.KU)(Be,a),(0,i.aU)(Be,Be,s);const g=this.getCenter(De);for(let e=0;e<f;e++){const r=Ie[p+e];(0,l.s)(Ae,((1&r)<<1)-1,(2&r)-1,((4&r)>>1)-1),(0,l.t)(Ae,Ae,Be),(0,l.g)(Ce,g,Ae),Ce[3]=1,(0,u.t)(Ce,Ce,t);const i=1/Math.max(1e-6,Ce[3]);we[2*e]=Ce[0]*i,we[2*e+1]=Ce[1]*i}const v=2*f-2;let _=we[0]*(we[3]-we[v+1])+we[v]*(we[1]-we[v-1]);for(let e=2;e<v;e+=2)_+=we[e]*(we[e+3]-we[e-1]);return Math.abs(_)*r*o*.125}projectedRadius(e){const t=this.getQuaternion(Se);return(0,n.fO)(be,t),(0,l.r)(Ae,e,be),Math.abs(Ae[0]*this._data[3])+Math.abs(Ae[1]*this._data[4])+Math.abs(Ae[2]*this._data[5])}minimumDistancePlane(e){return e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3]-this.projectedRadius((0,v.Oq)(e))}maximumDistancePlane(e){return e[0]*this._data[0]+e[1]*this._data[1]+e[2]*this._data[2]+e[3]+this.projectedRadius((0,v.Oq)(e))}toAaBoundingBox(e){const t=this.getQuaternion(Se),r=(0,i.KU)(Be,t),o=this._data[3]*Math.abs(r[0])+this._data[4]*Math.abs(r[3])+this._data[5]*Math.abs(r[6]),a=this._data[3]*Math.abs(r[1])+this._data[4]*Math.abs(r[4])+this._data[5]*Math.abs(r[7]),n=this._data[3]*Math.abs(r[2])+this._data[4]*Math.abs(r[5])+this._data[5]*Math.abs(r[8]);e[0]=this._data[0]-o,e[1]=this._data[1]-a,e[2]=this._data[2]-n,e[3]=this._data[0]+o,e[4]=this._data[1]+a,e[5]=this._data[2]+n}transform(e,t,r,i=0,o=(0,m._s)(r),a=(0,m._s)(t),s=(0,g.Mx)(t,a)){if(r===o)t.isGeographic?function(e,t,r,i,o=(0,m._s)(r)){const a=(0,h.e0)(r),s=1+Math.max(0,i)/(a.radius+e.centerZ);e.getCenter(Le),Le[2]+=i,(0,p.projectBuffer)(Le,r,0,Le,o,0,1),t.center=Le;const c=e.getQuaternion(Se);t.quaternion=c,(0,n.fO)(be,c),(0,l.s)(ze,0,0,1),(0,l.r)(ze,ze,be);const u=e.getHalfSize(Ue);(0,l.s)(ze,u[0]*Math.abs(ze[0]),u[1]*Math.abs(ze[1]),u[2]*Math.abs(ze[2])),(0,l.i)(ze,ze,a.inverseFlattening),(0,l.g)(ze,u,ze),t.halfSize=(0,l.i)(ze,ze,s)}(this,e,t,i,a):function(e,t,r,i,o=(0,m._s)(r),a=(0,g.Mx)(r,o)){e.getCorners(Ve),e.getCenter(Le),Le[2]+=i,(0,f.y)(r,Le,Ge,o),t.setCenter(Ge[12],Ge[13],Ge[14]);const s=2*Math.sqrt(1+Ge[0]+Ge[5]+Ge[10]);be[0]=(Ge[6]-Ge[9])/s,be[1]=(Ge[8]-Ge[2])/s,be[2]=(Ge[1]-Ge[4])/s,be[3]=.25*s;const c=e.getQuaternion(Se);t.quaternion=(0,n.iW)(be,be,c),(0,n.fO)(be,be),(0,l.s)(Ye,0,0,0);const u=t.getCenter(Fe);for(const e of Ve)e[2]+=i,a(e,0,e,0),(0,l.y)(ze,e,u),(0,l.r)(ze,ze,be),(0,l.B)(Ye,Ye,ze);t.halfSize=Ye}(this,e,t,i,a,s);else if(t.isWGS84&&(r.isWebMercator||(0,_.GK)(r)))!function(e,t,r,i,o){t.getCenter(De),De[2]+=o;const a=(0,m._s)(r);(0,p.projectBuffer)(De,e,0,De,a,0,1),Oe(a,t,De,r,i)}(t,this,r,e,i);else if(t.isWebMercator&&(0,_.GK)(r))!function(e,t,r,i,o){t.getCenter(De),De[2]+=o,Oe(e,t,De,r,i)}(t,this,r,e,i);else{const o=this.getCenter(De);o[2]+=i,(0,p.projectBuffer)(o,t,0,o,r,0,1),e.center=o,this!==e&&(e.quaternion=this.getQuaternion(Se),e.halfSize=this.getHalfSize(Ue))}}}const be=(0,s.Su)(),Se=(0,s.Su)(),Ee=(0,s.Su)(),Ae=(0,c.Su)(),ye=(0,c.Su)(),Ce=(0,d.Su)();function Me(e,t=new Te){return function(e,t){const{data:r,size:i}=e,o=r.length/i;if(o<=0)return;const a=new le(e);de(A,a.minProj,a.maxProj),me(A,A,.5),he(y,a.maxProj,a.minProj);const n=ue(y),s=new ce;s.quality=n,o<14&&(e=new S.Y(new Float64Array(a.buffer,112,42),3));const l=(0,c.Su)(),u=(0,c.Su)(),d=(0,c.Su)(),h=(0,c.Su)(),m=(0,c.Su)(),f=(0,c.Su)(),p=(0,c.Su)();switch(C(a,e,p,l,u,d,h,m,f,s)){case 1:return void k(A,y,t);case 2:return void ee(e,h,t)}D(e,p,l,u,d,h,m,f,s),te(e,s.b0,s.b1,s.b2,J,Z);const g=(0,c.Su)();he(g,Z,J),s.quality=ue(g),s.quality<n?se(s.b0,s.b1,s.b2,J,Z,g,t):k(A,y,t)}(e,t),t}const we=[.1,.2,.3,.4,.5,.6,.7,.8,.9,1,1.1,1.2],Ie=(()=>{const e=new Int8Array(162);let t=0;const r=r=>{for(let i=0;i<r.length;i++)e[t+i]=r[i];t+=6};return r([6,2,3,1,5,4]),r([0,2,3,1,5,4]),r([0,2,3,7,5,4]),r([0,1,3,2,6,4]),r([0,1,3,2,0,0]),r([0,1,5,7,3,2]),r([0,1,3,7,6,4]),r([0,1,3,7,6,2]),r([0,1,5,7,6,2]),r([0,1,5,4,6,2]),r([0,1,5,4,0,0]),r([0,1,3,7,5,4]),r([0,2,6,4,0,0]),r([0,0,0,0,0,0]),r([1,3,7,5,0,0]),r([2,3,7,6,4,0]),r([2,3,7,6,0,0]),r([2,3,1,5,7,6]),r([0,1,5,7,6,2]),r([0,1,5,7,6,4]),r([0,1,3,7,6,4]),r([4,5,7,6,2,0]),r([4,5,7,6,0,0]),r([4,5,1,3,7,6]),r([0,2,3,7,5,4]),r([6,2,3,7,5,4]),r([6,2,3,1,5,4]),e})();function Re(e,t,r,i,o){const a=e.getQuaternion(Se);o.quaternion=a,(0,n.fO)(be,a);const s=e.getCenter(De),u=e.getHalfSize(Ue);if(i===T.UZ.Global){(0,l.r)(ze,s,be),(0,l.u)(Ye,ze),(0,l.x)(He,Ye,u),(0,l.y)(He,Ye,He);const i=(0,l.l)(He);(0,l.g)(He,Ye,u);const a=(0,l.l)(He);if(i<r)o.center=s,(0,l.s)(ze,r,r,r),o.halfSize=(0,l.g)(ze,u,ze);else{const n=a>0?1+t/a:1,s=i>0?1+r/i:1,c=(s+n)/2,d=(s-n)/2;(0,l.i)(He,Ye,d),o.halfSize=(0,l.q)(He,He,u,c),(0,l.i)(He,Ye,c),(0,l.q)(He,He,u,d),(0,l.z)(ze,ze),(0,l.A)(ze,He,ze);const h=e.getQuaternion(Ee);o.center=(0,l.r)(ze,ze,h)}}else{o.center=(0,l.q)(ze,s,c.wx,(r+t)/2);const e=(0,l.r)(ze,c.wx,be);(0,l.u)(e,e),o.halfSize=(0,l.q)(Ye,u,e,(r-t)/2)}return o}function Oe(e,t,r,o,a){const n=t.getQuaternion(Se),s=(0,i.KU)(Be,n),l=t.getHalfSize(Ue);for(let e=0;e<8;++e){for(let t=0;t<3;++t)Le[t]=l[t]*(0!=(e&1<<t)?-1:1);for(let t=0;t<3;++t){let i=r[t];for(let e=0;e<3;++e)i+=Le[e]*s[3*e+t];Ne[3*e+t]=i}}(0,p.projectBuffer)(Ne,e,0,Ne,o,0,8),Me(Pe,a)}const Ne=new Array(24),Pe=new S.Y(Ne,3),Le=(0,c.Su)(),De=(0,c.Su)(),Fe=(0,c.Su)(),Ue=(0,c.Su)(),Be=(0,o.Su)(),Ge=(0,a.Su)(),Ve=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],ze=(0,c.Su)(),Ye=(0,c.Su)(),He=(0,c.Su)(),We=(0,c.WK)(-1,-1,-1)},90124:(e,t,r)=>{r.d(t,{Er:()=>u,G8:()=>c,_J:()=>l});var i=r(80324),o=r(44840),a=r(48688),n=r(60288);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.$("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.Y`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
281
|
-
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
282
|
-
}`)}function u(e,t){const{vertex:r}=e;switch(t.output){case i.mC.Color:if(t.receiveShadows)return s(e),void r.code.add(n.Y`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.mC.LinearDepth:case i.mC.Shadow:case i.mC.ShadowHighlight:case i.mC.ShadowExcludeHighlight:return e.include(o.AX,t),s(e),l(e),c(e),void r.code.add(n.Y`void forwardLinearDepth() {
|
|
283
|
-
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
284
|
-
}`)}r.code.add(n.Y`void forwardLinearDepth() {}`)}},97760:(e,t,r)=>{r.d(t,{m:()=>o});var i=r(60288);function o(e){e.vertex.code.add(i.Y`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
285
|
-
vec3 camToVert = posWorld - camPosWorld;
|
|
286
|
-
bool isBackface = dot(camToVert, normalWorld) > 0.0;
|
|
287
|
-
if (isBackface) {
|
|
288
|
-
posClip.z += 0.0000003 * posClip.w;
|
|
289
|
-
}
|
|
290
|
-
return posClip;
|
|
291
|
-
}`)}},99556:(e,t,r)=>{r.d(t,{Y:()=>a});var i=r(60288),o=r(4636);function a(e,t=!0){e.attributes.add(o.K.POSITION,"vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.code.add(i.Y`
|
|
292
|
-
void main(void) {
|
|
293
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
294
|
-
${t?i.Y`uv = position * 0.5 + vec2(0.5);`:""}
|
|
295
|
-
}
|
|
296
|
-
`)}},80324:(e,t,r)=>{var i;function o(e){return e===i.Shadow||e===i.ShadowHighlight||e===i.ShadowExcludeHighlight}function a(e){return function(e){return function(e){return s(e)||n(e)}(e)||e===i.LinearDepth}(e)||e===i.Normal}function n(e){return e===i.Highlight||e===i.ObjectAndLayerIdColor}function s(e){return e===i.Color||e===i.Alpha}r.d(t,{KQ:()=>o,mC:()=>i,ue:()=>a}),function(e){e[e.Color=0]="Color",e[e.LinearDepth=1]="LinearDepth",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.Highlight=7]="Highlight",e[e.Alpha=8]="Alpha",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.CompositeColor=10]="CompositeColor",e[e.COUNT=11]="COUNT"}(i||(i={}))},68828:(e,t,r)=>{r.d(t,{A3:()=>c});var i=r(15008),o=r(87104),a=r(98472),n=r(62484),s=r(80645),l=(r(56124),r(60288));function c(e,t){!function(e,t,...r){if(!t.hasSlicePlane){const r=l.Y`#define rejectBySlice(_pos_) false
|
|
297
|
-
#define discardBySlice(_pos_) {}
|
|
298
|
-
#define highlightSlice(_color_, _pos_) (_color_)`;return t.hasSliceInVertexProgram&&e.vertex.code.add(r),void e.fragment.code.add(r)}t.hasSliceInVertexProgram&&e.vertex.uniforms.add(...r),e.fragment.uniforms.add(...r);const i=l.Y`struct SliceFactors {
|
|
299
|
-
float front;
|
|
300
|
-
float side0;
|
|
301
|
-
float side1;
|
|
302
|
-
float side2;
|
|
303
|
-
float side3;
|
|
304
|
-
};
|
|
305
|
-
SliceFactors calculateSliceFactors(vec3 pos) {
|
|
306
|
-
vec3 rel = pos - slicePlaneOrigin;
|
|
307
|
-
vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
|
|
308
|
-
float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
|
|
309
|
-
float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
|
|
310
|
-
float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
|
|
311
|
-
float basis1Dot = dot(slicePlaneBasis1, rel);
|
|
312
|
-
float basis2Dot = dot(slicePlaneBasis2, rel);
|
|
313
|
-
return SliceFactors(
|
|
314
|
-
dot(slicePlaneNormal, pos) + slicePlaneW,
|
|
315
|
-
-basis1Dot - basis1Len2,
|
|
316
|
-
basis1Dot - basis1Len2,
|
|
317
|
-
-basis2Dot - basis2Len2,
|
|
318
|
-
basis2Dot - basis2Len2
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
bool sliceByFactors(SliceFactors factors) {
|
|
322
|
-
return factors.front < 0.0
|
|
323
|
-
&& factors.side0 < 0.0
|
|
324
|
-
&& factors.side1 < 0.0
|
|
325
|
-
&& factors.side2 < 0.0
|
|
326
|
-
&& factors.side3 < 0.0;
|
|
327
|
-
}
|
|
328
|
-
bool sliceEnabled() {
|
|
329
|
-
return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
|
|
330
|
-
}
|
|
331
|
-
bool sliceByPlane(vec3 pos) {
|
|
332
|
-
return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
333
|
-
}
|
|
334
|
-
#define rejectBySlice(_pos_) sliceByPlane(_pos_)
|
|
335
|
-
#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,o=l.Y`vec4 applySliceHighlight(vec4 color, vec3 pos) {
|
|
336
|
-
SliceFactors factors = calculateSliceFactors(pos);
|
|
337
|
-
const float HIGHLIGHT_WIDTH = 1.0;
|
|
338
|
-
const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
|
|
339
|
-
factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
|
|
340
|
-
factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
|
|
341
|
-
factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
|
|
342
|
-
factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
|
|
343
|
-
factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
|
|
344
|
-
if (sliceByFactors(factors)) {
|
|
345
|
-
return color;
|
|
346
|
-
}
|
|
347
|
-
float highlightFactor = (1.0 - step(0.5, factors.front))
|
|
348
|
-
* (1.0 - step(0.5, factors.side0))
|
|
349
|
-
* (1.0 - step(0.5, factors.side1))
|
|
350
|
-
* (1.0 - step(0.5, factors.side2))
|
|
351
|
-
* (1.0 - step(0.5, factors.side3));
|
|
352
|
-
return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
|
|
353
|
-
}`,a=t.hasSliceHighlight?l.Y`
|
|
354
|
-
${o}
|
|
355
|
-
#define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
|
|
356
|
-
`:l.Y`#define highlightSlice(_color_, _pos_) (_color_)`;t.hasSliceInVertexProgram&&e.vertex.code.add(i),e.fragment.code.add(i),e.fragment.code.add(a)}(e,t,new s.m("slicePlaneOrigin",((e,r)=>function(e,t,r){if(null==r.slicePlane)return n.cX;const i=u(e,t,r),o=d(i,r.slicePlane),s=h(e,i,r);return null!=s?(0,a.e)(p,o,s):o}(t,e,r))),new s.m("slicePlaneBasis1",((e,r)=>m(t,e,r,r.slicePlane?.basis1))),new s.m("slicePlaneBasis2",((e,r)=>m(t,e,r,r.slicePlane?.basis2))))}function u(e,t,r){return e.instancedDoublePrecision?(0,a.s)(f,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]):t.slicePlaneLocalOrigin}function d(e,t){return null!=e?(0,a.f)(p,t.origin,e):t.origin}function h(e,t,r){return e.hasSliceTranslatedView?null!=t?(0,i.GS)(v,r.camera.viewMatrix,t):r.camera.viewMatrix:null}function m(e,t,r,i){if(null==i||null==r.slicePlane)return n.cX;const o=u(e,t,r),s=d(o,r.slicePlane),l=h(e,o,r);return null!=l?((0,a.g)(g,i,s),(0,a.e)(p,s,l),(0,a.e)(g,g,l),(0,a.f)(g,g,p)):i}l.a;const f=(0,n.Su)(),p=(0,n.Su)(),g=(0,n.Su)(),v=(0,o.Su)()},70984:(e,t,r)=>{r.d(t,{w:()=>a});var i=r(90124),o=r(60288);function a(e){(0,i.G8)(e),e.vertex.code.add(o.Y`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
|
|
357
|
-
vec4 eye = view * vec4(pos, 1.0);
|
|
358
|
-
depth = calculateLinearDepth(nearFar,eye.z);
|
|
359
|
-
return proj * eye;
|
|
360
|
-
}`),e.vertex.code.add(o.Y`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
|
|
361
|
-
return proj * (view * vec4(pos, 1.0));
|
|
362
|
-
}`)}},11925:(e,t,r)=>{r.d(t,{As:()=>b,i0:()=>x});var i=r(41948),o=r(77556),a=r(68612),n=r(87104),s=r(98472),l=r(62484),c=r(80324),u=r(36752),d=r(95224),h=r(80645),m=r(60288),f=r(11388),p=r(47572),g=r(74912),v=r(4636),_=r(5480);class x extends g.K{constructor(){super(...arguments),this.instancedDoublePrecision=!1,this.hasModelTransformation=!1}}(0,i._)([(0,g.y)()],x.prototype,"instancedDoublePrecision",void 0),(0,i._)([(0,g.y)()],x.prototype,"hasModelTransformation",void 0),m.a;const T=(0,a.Su)();function b(e,t){const r=t.hasModelTransformation,i=t.instancedDoublePrecision;r&&(e.vertex.uniforms.add(new p.O("model",(e=>e.modelTransformation??n.IJ))),e.vertex.uniforms.add(new f.q("normalLocalOriginFromModel",(e=>((0,o.yy)(T,e.modelTransformation??n.IJ),T))))),t.instanced&&i&&(e.attributes.add(v.K.INSTANCEMODELORIGINHI,"vec3"),e.attributes.add(v.K.INSTANCEMODELORIGINLO,"vec3"),e.attributes.add(v.K.INSTANCEMODEL,"mat3"),e.attributes.add(v.K.INSTANCEMODELNORMAL,"mat3"));const a=e.vertex;i&&(a.include(u.O,t),a.uniforms.add(new h.m("viewOriginHi",((e,t)=>(0,_.KM)((0,s.s)(S,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),S))),new h.m("viewOriginLo",((e,t)=>(0,_.Ky)((0,s.s)(S,t.camera.viewInverseTransposeMatrix[3],t.camera.viewInverseTransposeMatrix[7],t.camera.viewInverseTransposeMatrix[11]),S))))),a.code.add(m.Y`
|
|
363
|
-
vec3 getVertexInLocalOriginSpace() {
|
|
364
|
-
return ${r?i?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":i?"instanceModel * localPosition().xyz":"localPosition().xyz"};
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
vec3 subtractOrigin(vec3 _pos) {
|
|
368
|
-
${i?m.Y`
|
|
369
|
-
// Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped
|
|
370
|
-
// working for macOS 14+ and iOS 17+.
|
|
371
|
-
// Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280
|
|
372
|
-
vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo);
|
|
373
|
-
return _pos - originDelta;`:"return vpos;"}
|
|
374
|
-
}
|
|
375
|
-
`),a.code.add(m.Y`
|
|
376
|
-
vec3 dpNormal(vec4 _normal) {
|
|
377
|
-
return normalize(${r?i?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":i?"instanceModelNormal * _normal.xyz":"_normal.xyz"});
|
|
378
|
-
}
|
|
379
|
-
`),t.output===c.mC.Normal&&((0,d.CI)(a),a.code.add(m.Y`
|
|
380
|
-
vec3 dpNormalView(vec4 _normal) {
|
|
381
|
-
return normalize((viewNormal * ${r?i?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":i?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz);
|
|
382
|
-
}
|
|
383
|
-
`)),t.hasVertexTangents&&a.code.add(m.Y`
|
|
384
|
-
vec4 dpTransformVertexTangent(vec4 _tangent) {
|
|
385
|
-
${r?i?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":i?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"}
|
|
386
|
-
}`)}const S=(0,l.Su)()},88196:(e,t,r)=>{r.d(t,{g:()=>i,k:()=>l});var i,o,a=r(44584),n=r(60288),s=r(4636);function l(e,t){switch(t.normalType){case i.Compressed:e.attributes.add(s.K.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n.Y`vec3 decompressNormal(vec2 normal) {
|
|
387
|
-
float z = 1.0 - abs(normal.x) - abs(normal.y);
|
|
388
|
-
return vec3(normal + sign(normal) * min(z, 0.0), z);
|
|
389
|
-
}
|
|
390
|
-
vec3 normalModel() {
|
|
391
|
-
return decompressNormal(normalCompressed);
|
|
392
|
-
}`);break;case i.Attribute:e.attributes.add(s.K.NORMAL,"vec3"),e.vertex.code.add(n.Y`vec3 normalModel() {
|
|
393
|
-
return normal;
|
|
394
|
-
}`);break;case i.ScreenDerivative:e.fragment.code.add(n.Y`vec3 screenDerivativeNormal(vec3 positionView) {
|
|
395
|
-
return normalize(cross(dFdx(positionView), dFdy(positionView)));
|
|
396
|
-
}`);break;default:(0,a.aM)(t.normalType);case i.COUNT:case i.Ground:}}(o=i||(i={}))[o.Attribute=0]="Attribute",o[o.Compressed=1]="Compressed",o[o.Ground=2]="Ground",o[o.ScreenDerivative=3]="ScreenDerivative",o[o.COUNT=4]="COUNT"},32704:(e,t,r)=>{r.d(t,{s:()=>a});var i=r(60288),o=r(4636);function a(e){e.attributes.add(o.K.POSITION,"vec3"),e.vertex.code.add(i.Y`vec3 positionModel() { return position; }`)}},49168:(e,t,r)=>{r.d(t,{i:()=>c});var i=r(78720),o=r(60288);function a(e){e.vertex.code.add(o.Y`
|
|
397
|
-
vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
|
|
398
|
-
float symbolAlpha = 0.0;
|
|
399
|
-
|
|
400
|
-
const float maxTint = 85.0;
|
|
401
|
-
const float maxReplace = 170.0;
|
|
402
|
-
const float scaleAlpha = 3.0;
|
|
403
|
-
|
|
404
|
-
if (symbolColor.a > maxReplace) {
|
|
405
|
-
colorMixMode = ${o.Y.int(i.KQ.Multiply)};
|
|
406
|
-
symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
|
|
407
|
-
} else if (symbolColor.a > maxTint) {
|
|
408
|
-
colorMixMode = ${o.Y.int(i.KQ.Replace)};
|
|
409
|
-
symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
|
|
410
|
-
} else if (symbolColor.a > 0.0) {
|
|
411
|
-
colorMixMode = ${o.Y.int(i.KQ.Tint)};
|
|
412
|
-
symbolAlpha = scaleAlpha * symbolColor.a;
|
|
413
|
-
} else {
|
|
414
|
-
colorMixMode = ${o.Y.int(i.KQ.Multiply)};
|
|
415
|
-
symbolAlpha = 0.0;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
|
|
419
|
-
}
|
|
420
|
-
`)}var n=r(5512),s=r(4636),l=r(22592);function c(e,t){t.hasSymbolColors?(e.include(a),e.attributes.add(s.K.SYMBOLCOLOR,"vec4"),e.varyings.add("colorMixMode","mediump float"),e.vertex.code.add(o.Y`int symbolColorMixMode;
|
|
421
|
-
vec4 getSymbolColor() {
|
|
422
|
-
return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
|
|
423
|
-
}
|
|
424
|
-
void forwardColorMixMode() {
|
|
425
|
-
colorMixMode = float(symbolColorMixMode) + 0.5;
|
|
426
|
-
}`)):(e.fragment.uniforms.add(new n.i("colorMixMode",(e=>l.An[e.colorMixMode]))),e.vertex.code.add(o.Y`vec4 getSymbolColor() { return vec4(1.0); }
|
|
427
|
-
void forwardColorMixMode() {}`))}},55164:(e,t,r)=>{r.d(t,{I:()=>l,i:()=>i});var i,o,a=r(44584),n=r(60288),s=r(4636);function l(e,t){switch(t.textureCoordinateType){case i.Default:return e.attributes.add(s.K.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(n.Y`void forwardTextureCoordinates() {
|
|
428
|
-
vuv0 = uv0;
|
|
429
|
-
}`);case i.Compressed:return e.attributes.add(s.K.UV0,"vec2"),e.varyings.add("vuv0","vec2"),void e.vertex.code.add(n.Y`vec2 getUV0() {
|
|
430
|
-
return uv0 / 16384.0;
|
|
431
|
-
}
|
|
432
|
-
void forwardTextureCoordinates() {
|
|
433
|
-
vuv0 = getUV0();
|
|
434
|
-
}`);case i.Atlas:return e.attributes.add(s.K.UV0,"vec2"),e.varyings.add("vuv0","vec2"),e.attributes.add(s.K.UVREGION,"vec4"),e.varyings.add("vuvRegion","vec4"),void e.vertex.code.add(n.Y`void forwardTextureCoordinates() {
|
|
435
|
-
vuv0 = uv0;
|
|
436
|
-
vuvRegion = uvRegion;
|
|
437
|
-
}`);default:(0,a.aM)(t.textureCoordinateType);case i.None:return void e.vertex.code.add(n.Y`void forwardTextureCoordinates() {}`);case i.COUNT:return}}(o=i||(i={}))[o.None=0]="None",o[o.Default=1]="Default",o[o.Atlas=2]="Atlas",o[o.Compressed=3]="Compressed",o[o.COUNT=4]="COUNT"},41804:(e,t,r)=>{r.d(t,{O:()=>a});var i=r(60288),o=r(4636);function a(e,t){t.hasVertexColors?(e.attributes.add(o.K.COLOR,"vec4"),e.varyings.add("vColor","vec4"),e.vertex.code.add(i.Y`void forwardVertexColor() { vColor = color; }`),e.vertex.code.add(i.Y`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):e.vertex.code.add(i.Y`void forwardVertexColor() {}
|
|
438
|
-
void forwardNormalizedVertexColor() {}`)}},60072:(e,t,r)=>{r.d(t,{Yj:()=>h,u8:()=>d,yO:()=>m});var i=r(44584),o=r(68612),a=r(37008),n=r(88196),s=r(44840),l=r(60288),c=r(44228),u=r(11388);function d(e,t){switch(t.normalType){case n.g.Attribute:case n.g.Compressed:e.include(n.k,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.o("transformNormalGlobalFromModel",(e=>e.transformNormalGlobalFromModel)),new u.q("transformNormalViewFromGlobal",(e=>e.transformNormalViewFromGlobal))),e.vertex.code.add(l.Y`void forwardNormal() {
|
|
439
|
-
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
440
|
-
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
441
|
-
}`);break;case n.g.Ground:e.include(s.AX,t),e.varyings.add("vNormalWorld","vec3"),e.vertex.code.add(l.Y`
|
|
442
|
-
void forwardNormal() {
|
|
443
|
-
vNormalWorld = ${t.spherical?l.Y`normalize(vPositionWorldCameraRelative);`:l.Y`vec3(0.0, 0.0, 1.0);`}
|
|
444
|
-
}
|
|
445
|
-
`);break;case n.g.ScreenDerivative:e.vertex.code.add(l.Y`void forwardNormal() {}`);break;default:(0,i.aM)(t.normalType);case n.g.COUNT:}}class h extends s.Y5{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.Su)()}}class m extends s.iS{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.Su)(),this.toMapSpace=(0,a.Su)()}}},44840:(e,t,r)=>{r.d(t,{AX:()=>f,Y5:()=>p,iS:()=>g});var i=r(68612),o=r(87104),a=r(62484),n=r(32704),s=r(36752),l=r(80645),c=r(56124),u=r(60288),d=r(44228),h=r(11388),m=r(47572);function f(e,t){e.include(n.s);const r=e.vertex;r.include(s.O,t),e.varyings.add("vPositionWorldCameraRelative","vec3"),e.varyings.add("vPosition_view","vec3"),r.uniforms.add(new c.C("transformWorldFromViewTH",(e=>e.transformWorldFromViewTH)),new c.C("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL)),new h.q("transformViewFromCameraRelativeRS",(e=>e.transformViewFromCameraRelativeRS)),new m.O("transformProjFromView",(e=>e.transformProjFromView)),new d.o("transformWorldFromModelRS",(e=>e.transformWorldFromModelRS)),new l.m("transformWorldFromModelTH",(e=>e.transformWorldFromModelTH)),new l.m("transformWorldFromModelTL",(e=>e.transformWorldFromModelTL))),r.code.add(u.Y`vec3 positionWorldCameraRelative() {
|
|
446
|
-
vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
|
|
447
|
-
vec3 transform_CameraRelativeFromModel = dpAdd(
|
|
448
|
-
transformWorldFromModelTL,
|
|
449
|
-
transformWorldFromModelTH,
|
|
450
|
-
-transformWorldFromViewTL,
|
|
451
|
-
-transformWorldFromViewTH
|
|
452
|
-
);
|
|
453
|
-
return transform_CameraRelativeFromModel + rotatedModelPosition;
|
|
454
|
-
}`),r.code.add(u.Y`
|
|
455
|
-
void forwardPosition(float fOffset) {
|
|
456
|
-
vPositionWorldCameraRelative = positionWorldCameraRelative();
|
|
457
|
-
if (fOffset != 0.0) {
|
|
458
|
-
vPositionWorldCameraRelative += fOffset * ${t.spherical?u.Y`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:u.Y`vec3(0.0, 0.0, 1.0)`};
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
|
|
462
|
-
gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
|
|
463
|
-
}
|
|
464
|
-
`),e.fragment.uniforms.add(new c.C("transformWorldFromViewTL",(e=>e.transformWorldFromViewTL))),r.code.add(u.Y`vec3 positionWorld() {
|
|
465
|
-
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
466
|
-
}`),e.fragment.code.add(u.Y`vec3 positionWorld() {
|
|
467
|
-
return transformWorldFromViewTL + vPositionWorldCameraRelative;
|
|
468
|
-
}`)}class p extends u.a{constructor(){super(...arguments),this.transformWorldFromViewTH=(0,a.Su)(),this.transformWorldFromViewTL=(0,a.Su)(),this.transformViewFromCameraRelativeRS=(0,i.Su)(),this.transformProjFromView=(0,o.Su)()}}class g extends u.a{constructor(){super(...arguments),this.transformWorldFromModelRS=(0,i.Su)(),this.transformWorldFromModelTH=(0,a.Su)(),this.transformWorldFromModelTL=(0,a.Su)()}}},33610:(e,t,r)=>{r.d(t,{C:()=>s});var i=r(44584),o=r(55164),a=r(60288);function n(e){e.fragment.code.add(a.Y`vec4 textureAtlasLookup(sampler2D tex, vec2 textureCoordinates, vec4 atlasRegion) {
|
|
469
|
-
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
|
|
470
|
-
vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
|
|
471
|
-
float maxdUV = 0.125;
|
|
472
|
-
vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
473
|
-
vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
|
|
474
|
-
return textureGrad(tex, uvAtlas, dUVdx, dUVdy);
|
|
475
|
-
}`)}function s(e,t){switch(e.include(o.I,t),t.textureCoordinateType){case o.i.Default:case o.i.Compressed:return void e.fragment.code.add(a.Y`vec4 textureLookup(sampler2D tex, vec2 uv) {
|
|
476
|
-
return texture(tex, uv);
|
|
477
|
-
}`);case o.i.Atlas:return e.include(n),void e.fragment.code.add(a.Y`vec4 textureLookup(sampler2D tex, vec2 uv) {
|
|
478
|
-
return textureAtlasLookup(tex, uv, vuvRegion);
|
|
479
|
-
}`);default:(0,i.aM)(t.textureCoordinateType);case o.i.None:case o.i.COUNT:return}}},11544:(e,t,r)=>{r.d(t,{k:()=>m});var i=r(74784),o=r(37008),a=r(98472),n=r(62484),s=r(56124),l=r(60288);function c(e){e.vertex.code.add(l.Y`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
|
|
480
|
-
return absCosAngle * absCosAngle * absCosAngle;
|
|
481
|
-
}`),e.vertex.code.add(l.Y`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) {
|
|
482
|
-
return vec3(
|
|
483
|
-
min(params.x / (distanceToCamera - params.y), 1.0),
|
|
484
|
-
screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
|
|
485
|
-
params.z
|
|
486
|
-
);
|
|
487
|
-
}`),e.vertex.code.add(l.Y`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) {
|
|
488
|
-
return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
|
|
489
|
-
}`),e.vertex.code.add(l.Y`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
490
|
-
return applyScreenSizePerspectiveScaleFactorFloat(
|
|
491
|
-
size,
|
|
492
|
-
screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
493
|
-
);
|
|
494
|
-
}`),e.vertex.code.add(l.Y`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) {
|
|
495
|
-
return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y);
|
|
496
|
-
}`),e.vertex.code.add(l.Y`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
497
|
-
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
498
|
-
}`)}const u=(0,n.Su)();var d=r(95224),h=r(56192);function m(e,t){const r=e.vertex;t.hasVerticalOffset?(function(e){e.uniforms.add(new h.U("verticalOffset",((e,t)=>{const{minWorldLength:r,maxWorldLength:o,screenLength:a}=e.verticalOffset,n=Math.tan(.5*t.camera.fovY)/(.5*t.camera.fullViewport[3]),s=t.camera.pixelRatio||1;return(0,i.s)(f,a*s,n,r,o)})))}(r),t.hasScreenSizePerspective&&(e.include(c),function(e){e.uniforms.add(new s.C("screenSizePerspectiveAlignment",(e=>function(e){return(0,a.s)(u,e.parameters.divisor,e.parameters.offset,e.minScaleFactor)}(e.screenSizePerspectiveAlignment||e.screenSizePerspective))))}(r),(0,d.E7)(e.vertex,t)),r.code.add(l.Y`
|
|
499
|
-
vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
500
|
-
float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
|
|
501
|
-
${t.spherical?l.Y`vec3 worldNormal = normalize(worldPos + localOrigin);`:l.Y`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
|
|
502
|
-
${t.hasScreenSizePerspective?l.Y`
|
|
503
|
-
float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
|
|
504
|
-
float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:l.Y`
|
|
505
|
-
float verticalOffsetScreenHeight = verticalOffset.x;`}
|
|
506
|
-
// Screen sized offset in world space, used for example for line callouts
|
|
507
|
-
float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
|
|
508
|
-
return worldNormal * worldOffset;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
|
|
512
|
-
return worldPos + calculateVerticalOffset(worldPos, localOrigin);
|
|
513
|
-
}
|
|
514
|
-
`)):r.code.add(l.Y`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const f=(0,o.Su)()},2288:(e,t,r)=>{r.d(t,{y:()=>y});var i=r(90124),o=r(80324),a=r(68828),n=r(70984),s=r(88196),l=r(60288),c=r(4636);function u(e,t){const r=t.output===o.mC.ObjectAndLayerIdColor,i=t.objectAndLayerIdColorInstanced;r&&(e.varyings.add("objectAndLayerIdColorVarying","vec4"),i?e.attributes.add(c.K.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):e.attributes.add(c.K.OBJECTANDLAYERIDCOLOR,"vec4")),e.vertex.code.add(l.Y`
|
|
515
|
-
void forwardObjectAndLayerIdColor() {
|
|
516
|
-
${r?i?l.Y`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:l.Y`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:l.Y``} }`),e.fragment.code.add(l.Y`
|
|
517
|
-
void outputObjectAndLayerIdColor() {
|
|
518
|
-
${r?l.Y`fragColor = objectAndLayerIdColorVarying;`:l.Y``} }`)}var d=r(55164),h=r(60072),m=r(60512),f=r(54132);function p(e,t){switch(t.output){case o.mC.Shadow:case o.mC.ShadowHighlight:case o.mC.ShadowExcludeHighlight:e.fragment.include(m.K),e.fragment.code.add(l.Y`float _calculateFragDepth(const in float depth) {
|
|
519
|
-
const float SLOPE_SCALE = 2.0;
|
|
520
|
-
const float BIAS = 20.0 * .000015259;
|
|
521
|
-
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
522
|
-
return depth + SLOPE_SCALE * m + BIAS;
|
|
523
|
-
}
|
|
524
|
-
void outputDepth(float _linearDepth) {
|
|
525
|
-
fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
|
|
526
|
-
}`);break;case o.mC.LinearDepth:e.fragment.include(f.s),e.fragment.code.add(l.Y`void outputDepth(float _linearDepth) {
|
|
527
|
-
fragColor = float2rgba(_linearDepth);
|
|
528
|
-
}`)}}var g=r(37008),v=r(49916);const _=(0,g.WK)(1,1,0,1),x=(0,g.WK)(1,0,1,1);function T(e){e.fragment.uniforms.add(new v.W("depthTexture",((e,t)=>t.mainDepth))),e.fragment.constants.add("occludedHighlightFlag","vec4",_).add("unoccludedHighlightFlag","vec4",x),e.fragment.code.add(l.Y`void outputHighlight() {
|
|
529
|
-
float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x);
|
|
530
|
-
if (gl_FragCoord.z > sceneDepth + 5e-7) {
|
|
531
|
-
fragColor = occludedHighlightFlag;
|
|
532
|
-
} else {
|
|
533
|
-
fragColor = unoccludedHighlightFlag;
|
|
534
|
-
}
|
|
535
|
-
}`)}var b=r(36244),S=r(93904),E=r(95224),A=r(12260);function y(e,t){const{vertex:r,fragment:c}=e,m=t.hasColorTexture&&t.alphaDiscardMode!==A.OA.Opaque;switch(t.output){case o.mC.LinearDepth:case o.mC.Shadow:case o.mC.ShadowHighlight:case o.mC.ShadowExcludeHighlight:case o.mC.ObjectAndLayerIdColor:(0,E.IE)(r,t),e.include(n.w,t),e.include(d.I,t),e.include(b.a,t),e.include(p,t),e.include(a.A3,t),e.include(u,t),(0,i._J)(e),e.varyings.add("depth","float"),m&&c.uniforms.add(new v.W("tex",(e=>e.texture))),r.code.add(l.Y`void main(void) {
|
|
536
|
-
vpos = getVertexInLocalOriginSpace();
|
|
537
|
-
vpos = subtractOrigin(vpos);
|
|
538
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
539
|
-
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
540
|
-
forwardTextureCoordinates();
|
|
541
|
-
forwardObjectAndLayerIdColor();
|
|
542
|
-
}`),e.include(S.Q,t),c.code.add(l.Y`
|
|
543
|
-
void main(void) {
|
|
544
|
-
discardBySlice(vpos);
|
|
545
|
-
${m?l.Y`
|
|
546
|
-
vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.Y`colorUV`:l.Y`vuv0`});
|
|
547
|
-
discardOrAdjustAlpha(texColor);`:""}
|
|
548
|
-
${t.output===o.mC.ObjectAndLayerIdColor?l.Y`outputObjectAndLayerIdColor();`:l.Y`outputDepth(depth);`}
|
|
549
|
-
}
|
|
550
|
-
`);break;case o.mC.Normal:{(0,E.IE)(r,t),e.include(n.w,t),e.include(s.k,t),e.include(h.u8,t),e.include(d.I,t),e.include(b.a,t),m&&c.uniforms.add(new v.W("tex",(e=>e.texture))),t.normalType===s.g.ScreenDerivative&&e.varyings.add("vPositionView","vec3");const i=t.normalType===s.g.Attribute||t.normalType===s.g.Compressed;r.code.add(l.Y`
|
|
551
|
-
void main(void) {
|
|
552
|
-
vpos = getVertexInLocalOriginSpace();
|
|
553
|
-
|
|
554
|
-
${i?l.Y`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:l.Y`
|
|
555
|
-
// Get vertex position in camera space for screen-space derivative normals
|
|
556
|
-
vPositionView = (view * vec4(vpos, 1.0)).xyz;
|
|
557
|
-
`}
|
|
558
|
-
vpos = subtractOrigin(vpos);
|
|
559
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
560
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
561
|
-
forwardTextureCoordinates();
|
|
562
|
-
}
|
|
563
|
-
`),e.include(a.A3,t),e.include(S.Q,t),c.code.add(l.Y`
|
|
564
|
-
void main() {
|
|
565
|
-
discardBySlice(vpos);
|
|
566
|
-
${m?l.Y`
|
|
567
|
-
vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.Y`colorUV`:l.Y`vuv0`});
|
|
568
|
-
discardOrAdjustAlpha(texColor);`:""}
|
|
569
|
-
|
|
570
|
-
${t.normalType===s.g.ScreenDerivative?l.Y`vec3 normal = screenDerivativeNormal(vPositionView);`:l.Y`
|
|
571
|
-
vec3 normal = normalize(vNormalWorld);
|
|
572
|
-
if (gl_FrontFacing == false){
|
|
573
|
-
normal = -normal;
|
|
574
|
-
}`}
|
|
575
|
-
fragColor = vec4(0.5 + 0.5 * normal, 1.0);
|
|
576
|
-
}
|
|
577
|
-
`);break}case o.mC.Highlight:(0,E.IE)(r,t),e.include(n.w,t),e.include(d.I,t),e.include(b.a,t),m&&c.uniforms.add(new v.W("tex",(e=>e.texture))),r.code.add(l.Y`void main(void) {
|
|
578
|
-
vpos = getVertexInLocalOriginSpace();
|
|
579
|
-
vpos = subtractOrigin(vpos);
|
|
580
|
-
vpos = addVerticalOffset(vpos, localOrigin);
|
|
581
|
-
gl_Position = transformPosition(proj, view, vpos);
|
|
582
|
-
forwardTextureCoordinates();
|
|
583
|
-
}`),e.include(a.A3,t),e.include(S.Q,t),e.include(T,t),c.code.add(l.Y`
|
|
584
|
-
void main() {
|
|
585
|
-
discardBySlice(vpos);
|
|
586
|
-
${m?l.Y`
|
|
587
|
-
vec4 texColor = texture(tex, ${t.hasColorTextureTransform?l.Y`colorUV`:l.Y`vuv0`});
|
|
588
|
-
discardOrAdjustAlpha(texColor);`:""}
|
|
589
|
-
outputHighlight();
|
|
590
|
-
}
|
|
591
|
-
`)}}},22340:(e,t,r)=>{r.d(t,{E:()=>a,W:()=>n});var i=r(54132),o=r(60288);function a(e){e.include(i.s),e.code.add(o.Y`float linearDepthFromFloat(float depth, vec2 nearFar) {
|
|
592
|
-
return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
|
|
593
|
-
}
|
|
594
|
-
float linearDepthFromRGBA(vec4 depth, vec2 nearFar) {
|
|
595
|
-
return linearDepthFromFloat(rgba2float(depth), nearFar);
|
|
596
|
-
}
|
|
597
|
-
float linearDepthFromTexture(sampler2D depthTexture, vec2 uv, vec2 nearFar) {
|
|
598
|
-
ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
|
|
599
|
-
return linearDepthFromRGBA(texelFetch(depthTexture, iuv, 0), nearFar);
|
|
600
|
-
}`)}function n(e){e.code.add(o.Y`float linearizeDepth(float depth, vec2 nearFar) {
|
|
601
|
-
float depthNdc = depth * 2.0 - 1.0;
|
|
602
|
-
return (2.0 * nearFar[0] * nearFar[1]) / (depthNdc * (nearFar[1] - nearFar[0]) - (nearFar[1] + nearFar[0]));
|
|
603
|
-
}
|
|
604
|
-
float linearDepthFromTexture(sampler2D depthTexture, vec2 uv, vec2 nearFar) {
|
|
605
|
-
ivec2 iuv = ivec2(uv * vec2(textureSize(depthTexture, 0)));
|
|
606
|
-
float depth = texelFetch(depthTexture, iuv, 0).r;
|
|
607
|
-
return linearizeDepth(depth, nearFar);
|
|
608
|
-
}`)}},87836:(e,t,r)=>{r.d(t,{W:()=>d});var i=r(55164),o=r(33610),a=r(58472),n=r(60288),s=r(83028),l=r(49916),c=r(75040),u=r(4636);function d(e,t){const r=e.fragment;t.hasVertexTangents?(e.attributes.add(u.K.TANGENT,"vec4"),e.varyings.add("vTangent","vec4"),t.doubleSidedMode===a.J.WindingOrder?r.code.add(n.Y`mat3 computeTangentSpace(vec3 normal) {
|
|
609
|
-
float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;
|
|
610
|
-
vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);
|
|
611
|
-
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
612
|
-
return mat3(tangent, bitangent, normal);
|
|
613
|
-
}`):r.code.add(n.Y`mat3 computeTangentSpace(vec3 normal) {
|
|
614
|
-
float tangentHeadedness = vTangent.w;
|
|
615
|
-
vec3 tangent = normalize(vTangent.xyz);
|
|
616
|
-
vec3 bitangent = cross(normal, tangent) * tangentHeadedness;
|
|
617
|
-
return mat3(tangent, bitangent, normal);
|
|
618
|
-
}`)):r.code.add(n.Y`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {
|
|
619
|
-
vec3 Q1 = dFdx(pos);
|
|
620
|
-
vec3 Q2 = dFdy(pos);
|
|
621
|
-
vec2 stx = dFdx(st);
|
|
622
|
-
vec2 sty = dFdy(st);
|
|
623
|
-
float det = stx.t * sty.s - sty.t * stx.s;
|
|
624
|
-
vec3 T = stx.t * Q2 - sty.t * Q1;
|
|
625
|
-
T = T - normal * dot(normal, T);
|
|
626
|
-
T *= inversesqrt(max(dot(T,T), 1.e-10));
|
|
627
|
-
vec3 B = sign(det) * cross(normal, T);
|
|
628
|
-
return mat3(T, B, normal);
|
|
629
|
-
}`),t.textureCoordinateType!==i.i.None&&(e.include(o.C,t),r.uniforms.add(t.pbrTextureBindType===c.u.Pass?new l.W("normalTexture",(e=>e.textureNormal)):new s.y("normalTexture",(e=>e.textureNormal))),r.code.add(n.Y`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
|
|
630
|
-
vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
|
|
631
|
-
return tangentSpace * rawNormal;
|
|
632
|
-
}`))}},8844:(e,t,r)=>{r.d(t,{i:()=>H});var i,o,a=r(60288),n=r(49916),s=r(41948),l=r(70680),c=r(57896),u=r(82003),d=r(1580),h=(r(9456),r(66360),r(72052),r(12552)),m=r(37648);!function(e){e[e.RED=0]="RED",e[e.RG=1]="RG",e[e.RGBA4=2]="RGBA4",e[e.RGBA=3]="RGBA",e[e.RGBA_MIPMAP=4]="RGBA_MIPMAP",e[e.R16F=5]="R16F",e[e.RGBA16F=6]="RGBA16F"}(i||(i={})),function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH16_BUFFER=1]="DEPTH16_BUFFER"}(o||(o={}));var f=r(43780),p=r(80324);const g={required:[]},v=(p.mC.LinearDepth,p.mC.CompositeColor,p.mC.Highlight,{required:[p.mC.Depth,p.mC.Normal]});class _ extends f.c{consumes(){return g}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}get materialReference(){return null}modify(e){}get numGeometries(){return 0}get hasOccludees(){return!1}queryRenderOccludedState(e){return!1}}class x extends _{}var T=r(74780),b=r(93316),S=r(63524),E=r(1492),A=r(52404),y=r(81472);class C extends b.O{initializeProgram(e){return new E.G(e.rctx,C.shader.get().build(),S.q)}initializePipeline(){return(0,y._w)({colorWrite:y.kp})}}C.shader=new T.O(A.S,(()=>r.e(6e3).then(r.bind(r,96e3))));var M=r(85256);class w extends a.a{constructor(){super(...arguments),this.projScale=1}}class I extends w{constructor(){super(...arguments),this.intensity=1}}class R extends a.a{}class O extends R{constructor(){super(...arguments),this.blurSize=(0,M.Su)()}}var N,P,L=r(81844);class D extends b.O{initializeProgram(e){return new E.G(e.rctx,D.shader.get().build(),S.q)}initializePipeline(){return(0,y._w)({colorWrite:y.kp})}}D.shader=new T.O(L.S,(()=>r.e(1739).then(r.bind(r,1739)))),r(27308),(P=N||(N={}))[P.Antialiasing=0]="Antialiasing",P[P.HighQualityTransparency=1]="HighQualityTransparency",P[P.HighResolutionVoxel=2]="HighResolutionVoxel",P[P.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",P[P.SSAO=4]="SSAO",P[P.WaterReflection=5]="WaterReflection",P[P.HighResolutionShadows=6]="HighResolutionShadows",P[P.PhysicalPixelRendering=7]="PhysicalPixelRendering";var F=r(40328),U=r(77800),B=r(22184),G=r(51576);const V=2;let z=class extends x{constructor(e){super(e),this._context=null,this._passParameters=new I,this._drawParameters=new O,this.produces=new Map([[F.y.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?v:g}initializeRenderContext(e){this._context=e,this.addHandles([(0,c.aE)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(N.SSAO)),(e=>e?this._enable():this._disable()),c.KG)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,l.yI)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new G.O;t.wrapMode=U.Qz.CLAMP_TO_EDGE,t.pixelFormat=U.Id.RGB,t.wrapMode=U.Qz.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new B.w(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(D)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(C)),this._enableTime=(0,u.w$)(0),this._context?.requestRender()}renderNode(e,t,r){const o=e.bindParameters,a=r?.get("normals"),n=a?.getTexture(),s=a?.getTexture(U.GE);if(null==this._enableTime||null==this._context||!n||!s)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const l=e.rctx,c=o.camera,u=this.view.qualitySettings.fadeDuration,d=u>0?Math.min(u,e.time-this._enableTime)/u:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=s,this._passParameters.projScale=1/c.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Y/(0,L.g)(c)**6*d;const h=c.fullViewport[2],f=c.fullViewport[3],p=Math.round(h/V),g=Math.round(f/V),v=this._context.fbos,_=v.acquire(h,f,"ssao input",i.RG);l.setViewport(0,0,h,f),l.bindTechnique(this._ssaoTechnique,o,this._passParameters,this._drawParameters),l.screen.draw();const x=v.acquire(p,g,"ssao blur",i.RED);this._drawParameters.colorTexture=_.getTexture(),(0,m.WO)(this._drawParameters.blurSize,0,V/f),l.bindTechnique(this._blurTechnique,o,this._passParameters,this._drawParameters),l.setViewport(0,0,p,g),l.screen.draw(),_.release();const T=v.acquire(p,g,"ssao",i.RED);return l.setViewport(0,0,h,f),l.setClearColor(1,1,1,0),l.clear(U.sl.COLOR_BUFFER_BIT),this._drawParameters.colorTexture=x.getTexture(),(0,m.WO)(this._drawParameters.blurSize,V/h,0),l.bindTechnique(this._blurTechnique,o,this._passParameters,this._drawParameters),l.setViewport(0,0,p,g),l.screen.draw(),l.setViewport4fv(c.fullViewport),x.release(),d<1&&this._context.requestRender(),T}};(0,s._)([(0,d.qq)({constructOnly:!0})],z.prototype,"view",void 0),(0,s._)([(0,d.qq)()],z.prototype,"_context",void 0),z=(0,s._)([(0,h.c)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],z);const Y=.5;function H(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new n.W("ssaoTex",((e,t)=>t.ssao?.getTexture()))),r.constants.add("blurSizePixelsInverse","float",1/V),r.code.add(a.Y`float evaluateAmbientOcclusionInverse() {
|
|
633
|
-
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
634
|
-
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
635
|
-
}
|
|
636
|
-
float evaluateAmbientOcclusion() {
|
|
637
|
-
return 1.0 - evaluateAmbientOcclusionInverse();
|
|
638
|
-
}`)):r.code.add(a.Y`float evaluateAmbientOcclusionInverse() { return 1.0; }
|
|
639
|
-
float evaluateAmbientOcclusion() { return 0.0; }`)}},57704:(e,t,r)=>{r.d(t,{kf:()=>C,I4:()=>A,oZ:()=>y});var i=r(44584),o=r(98472),a=r(62484),n=r(74784),s=r(37008),l=r(81832),c=r(56124),u=r(56192),d=r(60288);function h(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new c.C("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0])))),r.code.add(d.Y`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
640
|
-
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
641
|
-
return ambientLight * (1.0 - ambientOcclusion);
|
|
642
|
-
}`)):1===i?(r.uniforms.add(new u.U("lightingAmbientSH_R",((e,t)=>(0,n.s)(f,t.lighting.sh.r[0],t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3]))),new u.U("lightingAmbientSH_G",((e,t)=>(0,n.s)(f,t.lighting.sh.g[0],t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3]))),new u.U("lightingAmbientSH_B",((e,t)=>(0,n.s)(f,t.lighting.sh.b[0],t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3])))),r.code.add(d.Y`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
643
|
-
vec4 sh0 = vec4(
|
|
644
|
-
0.282095,
|
|
645
|
-
0.488603 * normal.x,
|
|
646
|
-
0.488603 * normal.z,
|
|
647
|
-
0.488603 * normal.y
|
|
648
|
-
);
|
|
649
|
-
vec3 ambientLight = vec3(
|
|
650
|
-
dot(lightingAmbientSH_R, sh0),
|
|
651
|
-
dot(lightingAmbientSH_G, sh0),
|
|
652
|
-
dot(lightingAmbientSH_B, sh0)
|
|
653
|
-
);
|
|
654
|
-
return ambientLight * (1.0 - ambientOcclusion);
|
|
655
|
-
}`)):2===i&&(r.uniforms.add(new c.C("lightingAmbientSH0",((e,t)=>(0,o.s)(m,t.lighting.sh.r[0],t.lighting.sh.g[0],t.lighting.sh.b[0]))),new u.U("lightingAmbientSH_R1",((e,t)=>(0,n.s)(f,t.lighting.sh.r[1],t.lighting.sh.r[2],t.lighting.sh.r[3],t.lighting.sh.r[4]))),new u.U("lightingAmbientSH_G1",((e,t)=>(0,n.s)(f,t.lighting.sh.g[1],t.lighting.sh.g[2],t.lighting.sh.g[3],t.lighting.sh.g[4]))),new u.U("lightingAmbientSH_B1",((e,t)=>(0,n.s)(f,t.lighting.sh.b[1],t.lighting.sh.b[2],t.lighting.sh.b[3],t.lighting.sh.b[4]))),new u.U("lightingAmbientSH_R2",((e,t)=>(0,n.s)(f,t.lighting.sh.r[5],t.lighting.sh.r[6],t.lighting.sh.r[7],t.lighting.sh.r[8]))),new u.U("lightingAmbientSH_G2",((e,t)=>(0,n.s)(f,t.lighting.sh.g[5],t.lighting.sh.g[6],t.lighting.sh.g[7],t.lighting.sh.g[8]))),new u.U("lightingAmbientSH_B2",((e,t)=>(0,n.s)(f,t.lighting.sh.b[5],t.lighting.sh.b[6],t.lighting.sh.b[7],t.lighting.sh.b[8])))),r.code.add(d.Y`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
656
|
-
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
657
|
-
vec4 sh1 = vec4(
|
|
658
|
-
0.488603 * normal.x,
|
|
659
|
-
0.488603 * normal.z,
|
|
660
|
-
0.488603 * normal.y,
|
|
661
|
-
1.092548 * normal.x * normal.y
|
|
662
|
-
);
|
|
663
|
-
vec4 sh2 = vec4(
|
|
664
|
-
1.092548 * normal.y * normal.z,
|
|
665
|
-
0.315392 * (3.0 * normal.z * normal.z - 1.0),
|
|
666
|
-
1.092548 * normal.x * normal.z,
|
|
667
|
-
0.546274 * (normal.x * normal.x - normal.y * normal.y)
|
|
668
|
-
);
|
|
669
|
-
ambientLight += vec3(
|
|
670
|
-
dot(lightingAmbientSH_R1, sh1),
|
|
671
|
-
dot(lightingAmbientSH_G1, sh1),
|
|
672
|
-
dot(lightingAmbientSH_B1, sh1)
|
|
673
|
-
);
|
|
674
|
-
ambientLight += vec3(
|
|
675
|
-
dot(lightingAmbientSH_R2, sh2),
|
|
676
|
-
dot(lightingAmbientSH_G2, sh2),
|
|
677
|
-
dot(lightingAmbientSH_B2, sh2)
|
|
678
|
-
);
|
|
679
|
-
return ambientLight * (1.0 - ambientOcclusion);
|
|
680
|
-
}`),t.pbrMode!==l.Ax.Normal&&t.pbrMode!==l.Ax.Schematic||r.code.add(d.Y`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
|
|
681
|
-
vec3 calculateAmbientRadiance(float ambientOcclusion)
|
|
682
|
-
{
|
|
683
|
-
vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
|
|
684
|
-
return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
|
|
685
|
-
}`))}const m=(0,a.Su)(),f=(0,s.Su)();var p=r(8844),g=r(53672),v=r(36908),_=r(10060),x=r(7544),T=r(75040);class b extends x.C{constructor(e,t){super(e,"bool",T.u.Pass,((r,i,o)=>r.setUniform1b(e,t(i,o))))}}var S=r(95464);r(53648),(0,a.Su)();const E=.4;function A(e){e.constants.add("ambientBoostFactor","float",E)}function y(e){e.uniforms.add(new S.d("lightingGlobalFactor",((e,t)=>t.lighting.globalFactor)))}function C(e,t){const r=e.fragment;switch(e.include(p.i,t),t.pbrMode!==l.Ax.Disabled&&e.include(v.I,t),e.include(h,t),e.include(_.m),r.code.add(d.Y`
|
|
686
|
-
const float GAMMA_SRGB = 2.1;
|
|
687
|
-
const float INV_GAMMA_SRGB = 0.4761904;
|
|
688
|
-
${t.pbrMode===l.Ax.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
|
|
689
|
-
`),A(r),y(r),(0,g.OB)(r),r.code.add(d.Y`
|
|
690
|
-
float additionalDirectedAmbientLight(vec3 vPosWorld) {
|
|
691
|
-
float vndl = dot(${t.spherical?d.Y`normalize(vPosWorld)`:d.Y`vec3(0.0, 0.0, 1.0)`}, mainLightDirection);
|
|
692
|
-
return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
|
|
693
|
-
}
|
|
694
|
-
`),(0,g.o1)(r),r.code.add(d.Y`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
|
|
695
|
-
float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
|
|
696
|
-
return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity;
|
|
697
|
-
}`),t.pbrMode){case l.Ax.Disabled:case l.Ax.WaterOnIntegratedMesh:case l.Ax.Water:e.include(g.me),r.code.add(d.Y`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
|
|
698
|
-
{
|
|
699
|
-
vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
|
|
700
|
-
vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
|
|
701
|
-
vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
702
|
-
vec3 totalLight = mainLighting + ambientLighting + additionalLight;
|
|
703
|
-
totalLight = min(totalLight, vec3(PI));
|
|
704
|
-
vec3 outColor = vec3((albedoLinear / PI) * totalLight);
|
|
705
|
-
return pow(outColor, vec3(INV_GAMMA_SRGB));
|
|
706
|
-
}`);break;case l.Ax.Normal:case l.Ax.Schematic:r.code.add(d.Y`const float fillLightIntensity = 0.25;
|
|
707
|
-
const float horizonLightDiffusion = 0.4;
|
|
708
|
-
const float additionalAmbientIrradianceFactor = 0.02;
|
|
709
|
-
vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
|
|
710
|
-
{
|
|
711
|
-
vec3 viewDirection = -viewDir;
|
|
712
|
-
vec3 h = normalize(viewDirection + mainLightDirection);
|
|
713
|
-
PBRShadingInfo inputs;
|
|
714
|
-
inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
|
|
715
|
-
inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
|
|
716
|
-
inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
|
|
717
|
-
inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
|
|
718
|
-
inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
|
|
719
|
-
vec3 reflectedView = normalize(reflect(viewDirection, normal));
|
|
720
|
-
inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
|
|
721
|
-
inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
|
|
722
|
-
inputs.ssao = ssao;
|
|
723
|
-
inputs.metalness = mrr[0];
|
|
724
|
-
inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),r.code.add(d.Y`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
|
|
725
|
-
inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
726
|
-
inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),t.useFillLights?r.uniforms.add(new b("hasFillLights",((e,t)=>t.enableFillLights))):r.constants.add("hasFillLights","bool",!1),r.code.add(d.Y`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]);
|
|
727
|
-
ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
|
|
728
|
-
inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
|
|
729
|
-
vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity;
|
|
730
|
-
vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity;
|
|
731
|
-
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
|
|
732
|
-
inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
|
|
733
|
-
inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),r.uniforms.add(new S.d("lightingSpecularStrength",((e,t)=>t.lighting.mainLight.specularStrength)),new S.d("lightingEnvironmentStrength",((e,t)=>t.lighting.mainLight.environmentStrength))),r.code.add(d.Y`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
|
|
734
|
-
vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
|
|
735
|
-
inputs.NdotH_Horizon = dot(normal, horizonRingH);
|
|
736
|
-
vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow);
|
|
737
|
-
vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity;
|
|
738
|
-
vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
|
|
739
|
-
float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0));
|
|
740
|
-
inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
741
|
-
inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent;
|
|
742
|
-
inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),r.code.add(d.Y`
|
|
743
|
-
vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
|
|
744
|
-
vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
|
|
745
|
-
vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB));
|
|
746
|
-
vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
|
|
747
|
-
${t.pbrMode!==l.Ax.Schematic||t.hasColorTexture?d.Y`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:d.Y`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
|
|
748
|
-
return outColor;
|
|
749
|
-
}
|
|
750
|
-
`);break;case l.Ax.Simplified:case l.Ax.TerrainWithWater:e.include(g.me),r.code.add(d.Y`const float roughnessTerrain = 0.5;
|
|
751
|
-
const float specularityTerrain = 0.5;
|
|
752
|
-
const vec3 fresnelReflectionTerrain = vec3(0.04);
|
|
753
|
-
vec3 evaluatePBRSimplifiedLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) {
|
|
754
|
-
vec3 viewDirection = -vd;
|
|
755
|
-
vec3 h = normalize(viewDirection + mainLightDirection);
|
|
756
|
-
float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0);
|
|
757
|
-
float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0);
|
|
758
|
-
float NdotH = clamp(dot(n, h), 0.0, 1.0);
|
|
759
|
-
float NdotNG = clamp(dot(n, nup), -1.0, 1.0);
|
|
760
|
-
vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB));
|
|
761
|
-
float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2];
|
|
762
|
-
vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain;
|
|
763
|
-
vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0));
|
|
764
|
-
vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity;
|
|
765
|
-
vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al;
|
|
766
|
-
vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent;
|
|
767
|
-
vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5;
|
|
768
|
-
vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI;
|
|
769
|
-
vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity;
|
|
770
|
-
vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV);
|
|
771
|
-
vec3 specularColor = f0 * dfg.x + f90 * dfg.y;
|
|
772
|
-
vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent;
|
|
773
|
-
vec3 outColorLinear = outDiffColor + specularComponent;
|
|
774
|
-
vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB));
|
|
775
|
-
return outColor;
|
|
776
|
-
}`);break;default:(0,i.aM)(t.pbrMode);case l.Ax.COUNT:}}(0,a.Su)()},53672:(e,t,r)=>{r.d(t,{OB:()=>a,me:()=>s,o1:()=>n});var i=r(56124),o=r(60288);function a(e){e.uniforms.add(new i.C("mainLightDirection",((e,t)=>t.lighting.mainLight.direction)))}function n(e){e.uniforms.add(new i.C("mainLightIntensity",((e,t)=>t.lighting.mainLight.intensity)))}function s(e){a(e.fragment),n(e.fragment),e.fragment.code.add(o.Y`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
|
|
777
|
-
float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0);
|
|
778
|
-
return mainLightIntensity * ((1.0 - shadowing) * dotVal);
|
|
779
|
-
}`)}},50143:(e,t,r)=>{r.d(t,{_:()=>s});var i=r(22340),o=r(48688),a=r(60288),n=r(49916);function s(e,t){if(!t.multipassEnabled)return;e.fragment.include(i.E),e.fragment.uniforms.add(new n.W("terrainDepthTexture",((e,t)=>t.multipassTerrain.linearDepth?.getTexture())),new o.$("nearFar",((e,t)=>t.camera.nearFar)));const r=t.occlusionPass;e.fragment.code.add(a.Y`
|
|
780
|
-
${r?"bool":"void"} terrainDepthTest(float fragmentDepth) {
|
|
781
|
-
vec4 data = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0);
|
|
782
|
-
float linearDepth = linearDepthFromRGBA(data, nearFar);
|
|
783
|
-
${r?a.Y`return fragmentDepth < linearDepth && data != vec4(0.0, 0.0, 0.0, 1.0);`:a.Y`
|
|
784
|
-
if(fragmentDepth ${t.cullAboveGround?">":"<="} linearDepth){
|
|
785
|
-
discard;
|
|
786
|
-
}`}
|
|
787
|
-
}`)}},58472:(e,t,r)=>{r.d(t,{J:()=>i,u:()=>s});var i,o,a=r(44584),n=r(60288);function s(e,t){const r=e.fragment;switch(r.code.add(n.Y`struct ShadingNormalParameters {
|
|
788
|
-
vec3 normalView;
|
|
789
|
-
vec3 viewDirection;
|
|
790
|
-
} shadingParams;`),t.doubleSidedMode){case i.None:r.code.add(n.Y`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
791
|
-
return normalize(params.normalView);
|
|
792
|
-
}`);break;case i.View:r.code.add(n.Y`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
793
|
-
return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView);
|
|
794
|
-
}`);break;case i.WindingOrder:r.code.add(n.Y`vec3 shadingNormal(ShadingNormalParameters params) {
|
|
795
|
-
return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView);
|
|
796
|
-
}`);break;default:(0,a.aM)(t.doubleSidedMode);case i.COUNT:}}(o=i||(i={}))[o.None=0]="None",o[o.View=1]="View",o[o.WindingOrder=2]="WindingOrder",o[o.COUNT=3]="COUNT"},36908:(e,t,r)=>{r.d(t,{I:()=>s});var i=r(60288);function o(e){const t=e.fragment.code;t.add(i.Y`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
|
|
797
|
-
{
|
|
798
|
-
return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
|
|
799
|
-
}`),t.add(i.Y`float integratedRadiance(float cosTheta2, float roughness)
|
|
800
|
-
{
|
|
801
|
-
return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
|
|
802
|
-
}`),t.add(i.Y`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
|
|
803
|
-
{
|
|
804
|
-
float cosTheta2 = 1.0 - RdotNG * RdotNG;
|
|
805
|
-
float intRadTheta = integratedRadiance(cosTheta2, roughness);
|
|
806
|
-
float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
|
|
807
|
-
float sky = 2.0 - ground;
|
|
808
|
-
return (ground * ambientGround + sky * ambientSky) * 0.5;
|
|
809
|
-
}`)}var a=r(81832),n=r(10060);function s(e,t){const r=e.fragment.code;e.include(n.m),t.pbrMode!==a.Ax.Normal&&t.pbrMode!==a.Ax.Schematic&&t.pbrMode!==a.Ax.Simplified&&t.pbrMode!==a.Ax.TerrainWithWater||(r.add(i.Y`float normalDistribution(float NdotH, float roughness)
|
|
810
|
-
{
|
|
811
|
-
float a = NdotH * roughness;
|
|
812
|
-
float b = roughness / (1.0 - NdotH * NdotH + a * a);
|
|
813
|
-
return b * b * INV_PI;
|
|
814
|
-
}`),r.add(i.Y`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
|
|
815
|
-
const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
|
|
816
|
-
const vec2 c2 = vec2(-1.04, 1.04);
|
|
817
|
-
vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
|
|
818
|
-
vec4 r = roughness * c0 + c1;
|
|
819
|
-
float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
|
|
820
|
-
return c2 * a004 + r.zw;
|
|
821
|
-
}`)),t.pbrMode!==a.Ax.Normal&&t.pbrMode!==a.Ax.Schematic||(e.include(o),r.add(i.Y`struct PBRShadingInfo
|
|
822
|
-
{
|
|
823
|
-
float NdotL;
|
|
824
|
-
float NdotV;
|
|
825
|
-
float NdotH;
|
|
826
|
-
float VdotH;
|
|
827
|
-
float LdotH;
|
|
828
|
-
float NdotNG;
|
|
829
|
-
float RdotNG;
|
|
830
|
-
float NdotAmbDir;
|
|
831
|
-
float NdotH_Horizon;
|
|
832
|
-
vec3 skyRadianceToSurface;
|
|
833
|
-
vec3 groundRadianceToSurface;
|
|
834
|
-
vec3 skyIrradianceToSurface;
|
|
835
|
-
vec3 groundIrradianceToSurface;
|
|
836
|
-
float averageAmbientRadiance;
|
|
837
|
-
float ssao;
|
|
838
|
-
vec3 albedoLinear;
|
|
839
|
-
vec3 f0;
|
|
840
|
-
vec3 f90;
|
|
841
|
-
vec3 diffuseColor;
|
|
842
|
-
float metalness;
|
|
843
|
-
float roughness;
|
|
844
|
-
};`),r.add(i.Y`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
|
|
845
|
-
vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
|
|
846
|
-
vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
|
|
847
|
-
vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
|
|
848
|
-
vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
|
|
849
|
-
vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
|
|
850
|
-
vec3 specularComponent = specularColor * indirectSpecular;
|
|
851
|
-
return (diffuseComponent + specularComponent);
|
|
852
|
-
}`),r.add(i.Y`float gamutMapChanel(float x, vec2 p){
|
|
853
|
-
return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
|
|
854
|
-
}`),r.add(i.Y`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
|
|
855
|
-
vec3 outColor;
|
|
856
|
-
vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
|
|
857
|
-
outColor.x = gamutMapChanel(inColor.x, p) ;
|
|
858
|
-
outColor.y = gamutMapChanel(inColor.y, p) ;
|
|
859
|
-
outColor.z = gamutMapChanel(inColor.z, p) ;
|
|
860
|
-
return outColor;
|
|
861
|
-
}`))}},81832:(e,t,r)=>{r.d(t,{Ax:()=>i,G4:()=>h});var i,o,a=r(33610),n=r(80645),s=r(56124),l=r(60288),c=r(83028),u=r(49916),d=r(75040);function h(e,t){const r=e.fragment,o=t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture;if(t.pbrMode===i.Normal&&o&&e.include(a.C,t),t.pbrMode!==i.Schematic)if(t.pbrMode!==i.Disabled){if(t.pbrMode===i.Normal){r.code.add(l.Y`vec3 mrr;
|
|
862
|
-
vec3 emission;
|
|
863
|
-
float occlusion;`);const e=t.pbrTextureBindType;t.hasMetallicRoughnessTexture&&(r.uniforms.add(e===d.u.Pass?new u.W("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new c.y("texMetallicRoughness",(e=>e.textureMetallicRoughness))),r.code.add(l.Y`void applyMetallnessAndRoughness(vec2 uv) {
|
|
864
|
-
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
|
|
865
|
-
mrr[0] *= metallicRoughness.b;
|
|
866
|
-
mrr[1] *= metallicRoughness.g;
|
|
867
|
-
}`)),t.hasEmissionTexture&&(r.uniforms.add(e===d.u.Pass?new u.W("texEmission",(e=>e.textureEmissive)):new c.y("texEmission",(e=>e.textureEmissive))),r.code.add(l.Y`void applyEmission(vec2 uv) {
|
|
868
|
-
emission *= textureLookup(texEmission, uv).rgb;
|
|
869
|
-
}`)),t.hasOcclusionTexture?(r.uniforms.add(e===d.u.Pass?new u.W("texOcclusion",(e=>e.textureOcclusion)):new c.y("texOcclusion",(e=>e.textureOcclusion))),r.code.add(l.Y`void applyOcclusion(vec2 uv) {
|
|
870
|
-
occlusion *= textureLookup(texOcclusion, uv).r;
|
|
871
|
-
}
|
|
872
|
-
float getBakedOcclusion() {
|
|
873
|
-
return occlusion;
|
|
874
|
-
}`)):r.code.add(l.Y`float getBakedOcclusion() { return 1.0; }`),e===d.u.Pass?r.uniforms.add(new s.C("emissionFactor",(e=>e.emissiveFactor)),new s.C("mrrFactors",(e=>e.mrrFactors))):r.uniforms.add(new n.m("emissionFactor",(e=>e.emissiveFactor)),new n.m("mrrFactors",(e=>e.mrrFactors))),r.code.add(l.Y`
|
|
875
|
-
void applyPBRFactors() {
|
|
876
|
-
mrr = mrrFactors;
|
|
877
|
-
emission = emissionFactor;
|
|
878
|
-
occlusion = 1.0;
|
|
879
|
-
|
|
880
|
-
${t.hasMetallicRoughnessTexture?l.Y`applyMetallnessAndRoughness(${t.hasMetallicRoughnessTextureTransform?l.Y`metallicRoughnessUV`:"vuv0"});`:""}
|
|
881
|
-
|
|
882
|
-
${t.hasEmissionTexture?l.Y`applyEmission(${t.hasEmissiveTextureTransform?l.Y`emissiveUV`:"vuv0"});`:""}
|
|
883
|
-
|
|
884
|
-
${t.hasOcclusionTexture?l.Y`applyOcclusion(${t.hasOcclusionTextureTransform?l.Y`occlusionUV`:"vuv0"});`:""}
|
|
885
|
-
}
|
|
886
|
-
`)}}else r.code.add(l.Y`float getBakedOcclusion() { return 1.0; }`);else r.code.add(l.Y`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
887
|
-
vec3 emission = vec3(0.0);
|
|
888
|
-
float occlusion = 1.0;
|
|
889
|
-
void applyPBRFactors() {}
|
|
890
|
-
float getBakedOcclusion() { return 1.0; }`)}r(10375),(o=i||(i={}))[o.Disabled=0]="Disabled",o[o.Normal=1]="Normal",o[o.Schematic=2]="Schematic",o[o.Water=3]="Water",o[o.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",o[o.Simplified=5]="Simplified",o[o.TerrainWithWater=6]="TerrainWithWater",o[o.COUNT=7]="COUNT"},10060:(e,t,r)=>{r.d(t,{m:()=>o});var i=r(60288);function o(e){e.vertex.code.add(i.Y`const float PI = 3.141592653589793;`),e.fragment.code.add(i.Y`const float PI = 3.141592653589793;
|
|
891
|
-
const float LIGHT_NORMALIZATION = 1.0 / PI;
|
|
892
|
-
const float INV_PI = 0.3183098861837907;
|
|
893
|
-
const float HALF_PI = 1.570796326794897;`)}},64352:(e,t,r)=>{r.d(t,{WK:()=>m,i8:()=>h}),r(87104),r(62484);var i=r(60512),o=r(56192),a=r(5512),n=r(60288),s=r(7544),l=r(75040);class c extends s.C{constructor(e,t,r){super(e,"mat4",l.u.Draw,((r,i,o,a)=>r.setUniformMatrix4fv(e,t(i,o,a))),r)}}class u extends s.C{constructor(e,t,r){super(e,"mat4",l.u.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))),r)}}var d=r(49916);function h(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new u("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function m(e,t){t.receiveShadows&&(e.fragment.uniforms.add(new c("shadowMapMatrix",((e,t)=>t.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function f(e){const t=e.fragment;t.include(i.K),t.uniforms.add(new d.W("shadowMap",((e,t)=>t.shadowMap.depthTexture)),new a.i("numCascades",((e,t)=>t.shadowMap.numCascades)),new o.U("cascadeDistances",((e,t)=>t.shadowMap.cascadeDistances))),t.code.add(n.Y`int chooseCascade(float depth, out mat4 mat) {
|
|
894
|
-
vec4 distance = cascadeDistances;
|
|
895
|
-
int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
|
|
896
|
-
mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
|
|
897
|
-
return i;
|
|
898
|
-
}
|
|
899
|
-
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
900
|
-
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
901
|
-
lv.xy /= lv.w;
|
|
902
|
-
return 0.5 * lv.xyz + vec3(0.5);
|
|
903
|
-
}
|
|
904
|
-
vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
|
|
905
|
-
float xScale = float(textureSize.y) / float(textureSize.x);
|
|
906
|
-
return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
|
|
907
|
-
}
|
|
908
|
-
float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) {
|
|
909
|
-
return rgba4ToFloat(texelFetch(_depthTex, uv, 0));
|
|
910
|
-
}
|
|
911
|
-
float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) {
|
|
912
|
-
return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
|
|
913
|
-
}
|
|
914
|
-
float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) {
|
|
915
|
-
vec2 st = fract(uv * vec2(texSize) + vec2(0.5));
|
|
916
|
-
ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5));
|
|
917
|
-
float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex);
|
|
918
|
-
float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex);
|
|
919
|
-
float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex);
|
|
920
|
-
float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex);
|
|
921
|
-
return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
|
|
922
|
-
}
|
|
923
|
-
float readShadowMap(const in vec3 _vpos, float _linearDepth) {
|
|
924
|
-
mat4 mat;
|
|
925
|
-
int i = chooseCascade(_linearDepth, mat);
|
|
926
|
-
if (i >= numCascades) { return 0.0; }
|
|
927
|
-
vec3 lvpos = lightSpacePosition(_vpos, mat);
|
|
928
|
-
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
|
|
929
|
-
ivec2 size = textureSize(shadowMap, 0);
|
|
930
|
-
vec2 uv = cascadeCoordinates(i, size, lvpos);
|
|
931
|
-
return filterShadow(uv, lvpos, size, shadowMap);
|
|
932
|
-
}`)}n.a,n.a},95128:(e,t,r)=>{r.d(t,{Qr:()=>c,UJ:()=>d,U_:()=>u,Wq:()=>l,wZ:()=>s});var i=r(68612),o=r(55164),a=r(60288),n=r(11388);function s(e,t){t.hasColorTextureTransform?(e.vertex.uniforms.add(new n.q("colorTextureTransformMatrix",(e=>e.colorTextureTransformMatrix??i.IJ))),e.varyings.add("colorUV","vec2"),e.vertex.code.add(a.Y`void forwardColorUV(){
|
|
933
|
-
colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
934
|
-
}`)):e.vertex.code.add(a.Y`void forwardColorUV(){}`)}function l(e,t){t.hasNormalTextureTransform&&t.textureCoordinateType!==o.i.None?(e.vertex.uniforms.add(new n.q("normalTextureTransformMatrix",(e=>e.normalTextureTransformMatrix??i.IJ))),e.varyings.add("normalUV","vec2"),e.vertex.code.add(a.Y`void forwardNormalUV(){
|
|
935
|
-
normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
936
|
-
}`)):e.vertex.code.add(a.Y`void forwardNormalUV(){}`)}function c(e,t){t.hasEmissionTextureTransform&&t.textureCoordinateType!==o.i.None?(e.vertex.uniforms.add(new n.q("emissiveTextureTransformMatrix",(e=>e.emissiveTextureTransformMatrix??i.IJ))),e.varyings.add("emissiveUV","vec2"),e.vertex.code.add(a.Y`void forwardEmissiveUV(){
|
|
937
|
-
emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
938
|
-
}`)):e.vertex.code.add(a.Y`void forwardEmissiveUV(){}`)}function u(e,t){t.hasOcclusionTextureTransform&&t.textureCoordinateType!==o.i.None?(e.vertex.uniforms.add(new n.q("occlusionTextureTransformMatrix",(e=>e.occlusionTextureTransformMatrix??i.IJ))),e.varyings.add("occlusionUV","vec2"),e.vertex.code.add(a.Y`void forwardOcclusionUV(){
|
|
939
|
-
occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
940
|
-
}`)):e.vertex.code.add(a.Y`void forwardOcclusionUV(){}`)}function d(e,t){t.hasMetallicRoughnessTextureTransform&&t.textureCoordinateType!==o.i.None?(e.vertex.uniforms.add(new n.q("metallicRoughnessTextureTransformMatrix",(e=>e.metallicRoughnessTextureTransformMatrix??i.IJ))),e.varyings.add("metallicRoughnessUV","vec2"),e.vertex.code.add(a.Y`void forwardMetallicRoughnessUV(){
|
|
941
|
-
metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy;
|
|
942
|
-
}`)):e.vertex.code.add(a.Y`void forwardMetallicRoughnessUV(){}`)}},36244:(e,t,r)=>{r.d(t,{a:()=>S});var i=r(56124),o=r(7544),a=r(75040);class n extends o.C{constructor(e,t,r){super(e,"vec4",a.u.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))),r)}}class s extends o.C{constructor(e,t,r){super(e,"float",a.u.Pass,((r,i,o)=>r.setUniform1fv(e,t(i,o))),r)}}var l=r(60288),c=r(11388),u=r(4636),d=(r(9456),r(53648),r(77556),r(68612),r(15008),r(87104)),h=(r(98472),r(62484)),m=(r(12780),r(41948)),f=r(43780),p=r(1580),g=(r(66360),r(72052),r(12552));let v=class extends f.c{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};var _,x,T;(0,m._)([(0,p.qq)()],v.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,m._)([(0,p.qq)()],v.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,m._)([(0,p.qq)()],v.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,m._)([(0,p.qq)()],v.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,m._)([(0,p.qq)()],v.prototype,"LABELS_SHOW_BORDER",void 0),(0,m._)([(0,p.qq)()],v.prototype,"TEXT_SHOW_BASELINE",void 0),(0,m._)([(0,p.qq)()],v.prototype,"TEXT_SHOW_BORDER",void 0),(0,m._)([(0,p.qq)()],v.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,m._)([(0,p.qq)()],v.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,m._)([(0,p.qq)()],v.prototype,"SHOW_POI",void 0),(0,m._)([(0,p.qq)()],v.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),(0,m._)([(0,p.qq)()],v.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,m._)([(0,p.qq)()],v.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,m._)([(0,p.qq)()],v.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,m._)([(0,p.qq)()],v.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,m._)([(0,p.qq)()],v.prototype,"LINE_WIREFRAMES",void 0),v=(0,m._)([(0,g.c)("esri.views.3d.support.DebugFlags")],v),new v,(T=_||(_={}))[T.Undefined=0]="Undefined",T[T.DefinedSize=1]="DefinedSize",T[T.DefinedScale=2]="DefinedScale",function(e){e[e.Undefined=0]="Undefined",e[e.DefinedAngle=1]="DefinedAngle"}(x||(x={})),l.a,(0,d.Su)(),(0,h.Su)(),(0,d.Su)(),r(81048);const b=8;function S(e,t){const{vertex:r,attributes:o}=e;t.hasVvInstancing&&(t.vvSize||t.vvColor)&&o.add(u.K.INSTANCEFEATUREATTRIBUTE,"vec4"),t.vvSize?(r.uniforms.add(new i.C("vvSizeMinSize",(e=>e.vvSize.minSize))),r.uniforms.add(new i.C("vvSizeMaxSize",(e=>e.vvSize.maxSize))),r.uniforms.add(new i.C("vvSizeOffset",(e=>e.vvSize.offset))),r.uniforms.add(new i.C("vvSizeFactor",(e=>e.vvSize.factor))),r.uniforms.add(new c.q("vvSymbolRotationMatrix",(e=>e.vvSymbolRotationMatrix))),r.uniforms.add(new i.C("vvSymbolAnchor",(e=>e.vvSymbolAnchor))),r.code.add(l.Y`vec3 vvScale(vec4 _featureAttribute) {
|
|
943
|
-
return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
|
|
944
|
-
}
|
|
945
|
-
vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
|
|
946
|
-
return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
|
|
947
|
-
}`),r.code.add(l.Y`
|
|
948
|
-
const float eps = 1.192092896e-07;
|
|
949
|
-
vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
|
|
950
|
-
vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
|
|
951
|
-
return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
${t.hasVvInstancing?l.Y`
|
|
955
|
-
vec4 vvLocalNormal(vec3 _normal) {
|
|
956
|
-
return vvTransformNormal(_normal, instanceFeatureAttribute);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
vec4 localPosition() {
|
|
960
|
-
return vvTransformPosition(position, instanceFeatureAttribute);
|
|
961
|
-
}`:""}
|
|
962
|
-
`)):r.code.add(l.Y`vec4 localPosition() { return vec4(position, 1.0); }
|
|
963
|
-
vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),t.vvColor?(r.constants.add("vvColorNumber","int",b),r.uniforms.add(new s("vvColorValues",(e=>e.vvColor.values),b),new n("vvColorColors",(e=>e.vvColor.colors),b)),r.code.add(l.Y`
|
|
964
|
-
vec4 interpolateVVColor(float value) {
|
|
965
|
-
if (value <= vvColorValues[0]) {
|
|
966
|
-
return vvColorColors[0];
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
for (int i = 1; i < vvColorNumber; ++i) {
|
|
970
|
-
if (vvColorValues[i] >= value) {
|
|
971
|
-
float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]);
|
|
972
|
-
return mix(vvColorColors[i-1], vvColorColors[i], f);
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
return vvColorColors[vvColorNumber - 1];
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
vec4 vvGetColor(vec4 featureAttribute) {
|
|
979
|
-
return interpolateVVColor(featureAttribute.y);
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
${t.hasVvInstancing?l.Y`
|
|
983
|
-
vec4 vvColor() {
|
|
984
|
-
return vvGetColor(instanceFeatureAttribute);
|
|
985
|
-
}`:"vec4 vvColor() { return vec4(1.0); }"}
|
|
986
|
-
`)):r.code.add(l.Y`vec4 vvColor() { return vec4(1.0); }`)}},74072:(e,t,r)=>{r.d(t,{A:()=>o,k:()=>i});const i=.1,o=.001},93904:(e,t,r)=>{r.d(t,{Q:()=>c});var i=r(74072),o=r(60288);function a(e){e.fragment.code.add(o.Y`
|
|
987
|
-
#define discardOrAdjustAlpha(color) { if (color.a < ${o.Y.float(i.A)}) { discard; } }
|
|
988
|
-
`)}var n=r(7544);r(75040),n.C;var s=r(95464),l=r(12260);function c(e,t){!function(e,t,r){const i=e.fragment;switch(t.alphaDiscardMode!==l.OA.Mask&&t.alphaDiscardMode!==l.OA.MaskBlend||i.uniforms.add(r),t.alphaDiscardMode){case l.OA.Blend:return e.include(a);case l.OA.Opaque:i.code.add(o.Y`void discardOrAdjustAlpha(inout vec4 color) {
|
|
989
|
-
color.a = 1.0;
|
|
990
|
-
}`);break;case l.OA.Mask:i.code.add(o.Y`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case l.OA.MaskBlend:e.fragment.code.add(o.Y`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}(e,t,new s.d("textureAlphaCutoff",(e=>e.textureAlphaCutoff)))}},252:(e,t,r)=>{r.d(t,{ig:()=>u});var i=r(37648),o=r(85256),a=r(74784),n=r(37008),s=r(48688),l=r(56192),c=r(60288);function u(e){e.fragment.uniforms.add(new l.U("projInfo",((e,t)=>function(e){const t=e.projectionMatrix;return 0===t[11]?(0,a.s)(d,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):(0,a.s)(d,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}(t.camera)))),e.fragment.uniforms.add(new s.$("zScale",((e,t)=>function(e){return 0===e.projectionMatrix[11]?(0,i.WO)(h,0,1):(0,i.WO)(h,1,0)}(t.camera)))),e.fragment.code.add(c.Y`vec3 reconstructPosition(vec2 fragCoord, float depth) {
|
|
991
|
-
return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth);
|
|
992
|
-
}`)}const d=(0,n.Su)(),h=(0,o.Su)()},36752:(e,t,r)=>{r.d(t,{O:()=>o});var i=r(60288);function o({code:e},t){t.doublePrecisionRequiresObfuscation?e.add(i.Y`vec3 dpPlusFrc(vec3 a, vec3 b) {
|
|
993
|
-
return mix(a, a + b, vec3(notEqual(b, vec3(0))));
|
|
994
|
-
}
|
|
995
|
-
vec3 dpMinusFrc(vec3 a, vec3 b) {
|
|
996
|
-
return mix(vec3(0), a - b, vec3(notEqual(a, b)));
|
|
997
|
-
}
|
|
998
|
-
vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
|
|
999
|
-
vec3 t1 = dpPlusFrc(hiA, hiB);
|
|
1000
|
-
vec3 e = dpMinusFrc(t1, hiA);
|
|
1001
|
-
vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
|
|
1002
|
-
return t1 + t2;
|
|
1003
|
-
}`):e.add(i.Y`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
|
|
1004
|
-
vec3 t1 = hiA + hiB;
|
|
1005
|
-
vec3 e = t1 - hiA;
|
|
1006
|
-
vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
|
|
1007
|
-
return t1 + t2;
|
|
1008
|
-
}`)}},29484:(e,t,r)=>{r.d(t,{u:()=>n});var i=r(78720),o=r(60288);function a(e){e.code.add(o.Y`vec4 premultiplyAlpha(vec4 v) {
|
|
1009
|
-
return vec4(v.rgb * v.a, v.a);
|
|
1010
|
-
}
|
|
1011
|
-
vec3 rgb2hsv(vec3 c) {
|
|
1012
|
-
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
1013
|
-
vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
|
|
1014
|
-
vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
|
|
1015
|
-
float d = q.x - min(q.w, q.y);
|
|
1016
|
-
float e = 1.0e-10;
|
|
1017
|
-
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
|
|
1018
|
-
}
|
|
1019
|
-
vec3 hsv2rgb(vec3 c) {
|
|
1020
|
-
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
1021
|
-
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
|
1022
|
-
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
|
1023
|
-
}
|
|
1024
|
-
float rgb2v(vec3 c) {
|
|
1025
|
-
return max(c.x, max(c.y, c.z));
|
|
1026
|
-
}`)}function n(e){e.include(a),e.code.add(o.Y`
|
|
1027
|
-
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
|
|
1028
|
-
// workaround for artifacts in OSX using Intel Iris Pro
|
|
1029
|
-
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
1030
|
-
vec3 internalMixed = internalColor * textureColor;
|
|
1031
|
-
vec3 allMixed = internalMixed * externalColor;
|
|
1032
|
-
|
|
1033
|
-
if (mode == ${o.Y.int(i.KQ.Multiply)}) {
|
|
1034
|
-
return allMixed;
|
|
1035
|
-
}
|
|
1036
|
-
if (mode == ${o.Y.int(i.KQ.Ignore)}) {
|
|
1037
|
-
return internalMixed;
|
|
1038
|
-
}
|
|
1039
|
-
if (mode == ${o.Y.int(i.KQ.Replace)}) {
|
|
1040
|
-
return externalColor;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
// tint (or something invalid)
|
|
1044
|
-
float vIn = rgb2v(internalMixed);
|
|
1045
|
-
vec3 hsvTint = rgb2hsv(externalColor);
|
|
1046
|
-
vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
|
|
1047
|
-
return hsv2rgb(hsvOut);
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
|
|
1051
|
-
// workaround for artifacts in OSX using Intel Iris Pro
|
|
1052
|
-
// see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
|
|
1053
|
-
float internalMixed = internalOpacity * textureOpacity;
|
|
1054
|
-
float allMixed = internalMixed * externalOpacity;
|
|
1055
|
-
|
|
1056
|
-
if (mode == ${o.Y.int(i.KQ.Ignore)}) {
|
|
1057
|
-
return internalMixed;
|
|
1058
|
-
}
|
|
1059
|
-
if (mode == ${o.Y.int(i.KQ.Replace)}) {
|
|
1060
|
-
return externalOpacity;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
// multiply or tint (or something invalid)
|
|
1064
|
-
return allMixed;
|
|
1065
|
-
}
|
|
1066
|
-
`)}},60512:(e,t,r)=>{r.d(t,{K:()=>o});var i=r(60288);function o(e){e.code.add(i.Y`const float MAX_RGBA4_FLOAT =
|
|
1067
|
-
15.0 / 16.0 +
|
|
1068
|
-
15.0 / 16.0 / 16.0 +
|
|
1069
|
-
15.0 / 16.0 / 16.0 / 16.0 +
|
|
1070
|
-
15.0 / 16.0 / 16.0 / 16.0 / 16.0;
|
|
1071
|
-
const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0);
|
|
1072
|
-
vec4 floatToRgba4(const float value) {
|
|
1073
|
-
float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT);
|
|
1074
|
-
vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0);
|
|
1075
|
-
const float toU4AsFloat = 1.0 / 15.0;
|
|
1076
|
-
return fixedPointU4 * toU4AsFloat;
|
|
1077
|
-
}
|
|
1078
|
-
const vec4 RGBA4_2_FLOAT_FACTORS = vec4(
|
|
1079
|
-
15.0 / (16.0),
|
|
1080
|
-
15.0 / (16.0 * 16.0),
|
|
1081
|
-
15.0 / (16.0 * 16.0 * 16.0),
|
|
1082
|
-
15.0 / (16.0 * 16.0 * 16.0 * 16.0)
|
|
1083
|
-
);
|
|
1084
|
-
float rgba4ToFloat(vec4 rgba) {
|
|
1085
|
-
return dot(rgba, RGBA4_2_FLOAT_FACTORS);
|
|
1086
|
-
}`)}},54132:(e,t,r)=>{r.d(t,{s:()=>o});var i=r(60288);function o(e){e.code.add(i.Y`const float MAX_RGBA_FLOAT =
|
|
1087
|
-
255.0 / 256.0 +
|
|
1088
|
-
255.0 / 256.0 / 256.0 +
|
|
1089
|
-
255.0 / 256.0 / 256.0 / 256.0 +
|
|
1090
|
-
255.0 / 256.0 / 256.0 / 256.0 / 256.0;
|
|
1091
|
-
const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
|
|
1092
|
-
vec4 float2rgba(const float value) {
|
|
1093
|
-
float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
|
|
1094
|
-
vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
|
|
1095
|
-
const float toU8AsFloat = 1.0 / 255.0;
|
|
1096
|
-
return fixedPointU8 * toU8AsFloat;
|
|
1097
|
-
}
|
|
1098
|
-
const vec4 RGBA_2_FLOAT_FACTORS = vec4(
|
|
1099
|
-
255.0 / (256.0),
|
|
1100
|
-
255.0 / (256.0 * 256.0),
|
|
1101
|
-
255.0 / (256.0 * 256.0 * 256.0),
|
|
1102
|
-
255.0 / (256.0 * 256.0 * 256.0 * 256.0)
|
|
1103
|
-
);
|
|
1104
|
-
float rgba2float(vec4 rgba) {
|
|
1105
|
-
return dot(rgba, RGBA_2_FLOAT_FACTORS);
|
|
1106
|
-
}`)}},95224:(e,t,r)=>{r.d(t,{E7:()=>m,IE:()=>f,CI:()=>v});var i=r(15008),o=r(87104),a=r(98472),n=r(62484),s=r(80645),l=r(56124),c=(r(95464),r(7544)),u=r(75040);class d extends c.C{constructor(e,t){super(e,"mat4",u.u.Draw,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}var h=r(47572);function m(e,t){t.instancedDoublePrecision?e.constants.add("cameraPosition","vec3",n.cX):e.uniforms.add(new s.m("cameraPosition",((e,t)=>(0,a.s)(g,t.camera.viewInverseTransposeMatrix[3]-e.origin[0],t.camera.viewInverseTransposeMatrix[7]-e.origin[1],t.camera.viewInverseTransposeMatrix[11]-e.origin[2]))))}function f(e,t){if(!t.instancedDoublePrecision)return void e.uniforms.add(new h.O("proj",((e,t)=>t.camera.projectionMatrix)),new d("view",((e,t)=>(0,i.GS)(p,t.camera.viewMatrix,e.origin))),new s.m("localOrigin",(e=>e.origin)));const r=e=>(0,a.s)(g,e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]);e.uniforms.add(new h.O("proj",((e,t)=>t.camera.projectionMatrix)),new h.O("view",((e,t)=>(0,i.GS)(p,t.camera.viewMatrix,r(t)))),new l.C("localOrigin",((e,t)=>r(t))))}const p=(0,o.Su)(),g=(0,n.Su)();function v(e){e.uniforms.add(new h.O("viewNormal",((e,t)=>t.camera.viewInverseTransposeMatrix)))}},79216:(e,t,r)=>{r.d(t,{O:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"vec2",o.u.Draw,((r,i,o,a)=>r.setUniform2fv(e,t(i,o,a))))}}},48688:(e,t,r)=>{r.d(t,{$:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"vec2",o.u.Pass,((r,i,o)=>r.setUniform2fv(e,t(i,o))))}}},80645:(e,t,r)=>{r.d(t,{m:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"vec3",o.u.Draw,((r,i,o,a)=>r.setUniform3fv(e,t(i,o,a))))}}},56124:(e,t,r)=>{r.d(t,{C:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"vec3",o.u.Pass,((r,i,o)=>r.setUniform3fv(e,t(i,o))))}}},56192:(e,t,r)=>{r.d(t,{U:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"vec4",o.u.Pass,((r,i,o)=>r.setUniform4fv(e,t(i,o))))}}},95464:(e,t,r)=>{r.d(t,{d:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"float",o.u.Pass,((r,i,o)=>r.setUniform1f(e,t(i,o))))}}},5512:(e,t,r)=>{r.d(t,{i:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"int",o.u.Pass,((r,i,o)=>r.setUniform1i(e,t(i,o))))}}},44228:(e,t,r)=>{r.d(t,{o:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"mat3",o.u.Draw,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},11388:(e,t,r)=>{r.d(t,{q:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"mat3",o.u.Pass,((r,i,o)=>r.setUniformMatrix3fv(e,t(i,o))))}}},47572:(e,t,r)=>{r.d(t,{O:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"mat4",o.u.Pass,((r,i,o)=>r.setUniformMatrix4fv(e,t(i,o))))}}},14920:(e,t,r)=>{r.d(t,{i0:()=>c});var i=r(20744),o=r(66360),a=r(75040),n=r(90736);const s=()=>o.c.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class l{constructor(){this._includedModules=new Map}include(e,t){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==t){s().error("Shader module included multiple times with different configuration.");const t=new Set;for(const i of Object.keys(r))r[i]!==e[i]&&t.add(i);for(const i of Object.keys(e))r[i]!==e[i]&&t.add(i);t.forEach((t=>console.error(` ${t}: current ${r[t]} new ${e[t]}`)))}}else this._includedModules.set(e,t),e(this.builder,t)}}class c extends l{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new f,this.extensions=new p,this.constants=new v,this.outputs=new g}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,a=o.uniforms.generateSource(),n=o.code.generateSource(),s="vertex"===e?x:_,l=this.constants.generateSource().concat(o.constants.generateSource()),c=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${s}\n\n${l.join("\n")}\n\n${a.join("\n")}\n\n${r.join("\n")}\n\n${i.join("\n")}\n\n${c.join("\n")}\n\n${n.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[a.u.Pass];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[a.u.Pass];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let a=0;a<i;++a)r[a](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const r=e.bind[a.u.Draw];r&&t.set(e.name,r)})),this.fragment.uniforms.entries.forEach((e=>{const r=e.bind[a.u.Draw];r&&t.set(e.name,r)}));const r=Array.from(t.values()),i=r.length;return(t,o,a)=>{for(let n=0;n<i;++n)r[n](e,t,o,a)}}}class u{constructor(){this._entries=new Map}add(...e){for(const t of e)this._add(t)}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.c(`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class d{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}}class h extends l{constructor(){super(...arguments),this.uniforms=new u,this.code=new d,this.constants=new v}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class f{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&(0,n.Uc)(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,i)=>t.push("vertex"===e?`out ${r} ${i};`:`in ${r} ${i};`))),t}}class p{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?p.ALLOWLIST_VERTEX:p.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}p.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],p.ALLOWLIST_VERTEX=[];class g{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?(0,n.Uc)(i.name===e&&i.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:g.DEFAULT_NAME,type:g.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}g.DEFAULT_TYPE="vec4",g.DEFAULT_NAME="fragColor";class v{constructor(){this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=v._numberToFloatStr(r);break;case"int":i=v._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${v._numberToFloatStr(r[0])}, ${v._numberToFloatStr(r[1])}, ${v._numberToFloatStr(r[2])}, ${v._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${v._numberToIntStr(r[0])}, ${v._numberToIntStr(r[1])}, ${v._numberToIntStr(r[2])}, ${v._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,(e=>v._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const _="#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",x="precision highp float;\nprecision highp sampler2D;"},83028:(e,t,r)=>{r.d(t,{y:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"sampler2D",o.u.Draw,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},49916:(e,t,r)=>{r.d(t,{W:()=>a});var i=r(7544),o=r(75040);class a extends i.C{constructor(e,t){super(e,"sampler2D",o.u.Pass,((r,i,o)=>r.bindTexture(e,t(i,o))))}}},7544:(e,t,r)=>{r.d(t,{C:()=>o});var i=r(75040);class o{constructor(e,t,r,o,a=null){if(this.name=e,this.type=t,this.arraySize=a,this.bind={[i.u.Pass]:null,[i.u.Draw]:null},o)switch(r){case i.u.Pass:this.bind[i.u.Pass]=o;break;case i.u.Draw:this.bind[i.u.Draw]=o}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},60288:(e,t,r)=>{r.d(t,{Y:()=>o,a:()=>i});const i=class{};function o(e,...t){let r="";for(let i=0;i<t.length;i++)r+=e[i]+t[i];return r+=e[e.length-1],r}var a;(a=o||(o={})).int=function(e){return Math.round(e).toString()},a.float=function(e){return e.toPrecision(8)}},75040:(e,t,r)=>{var i;r.d(t,{u:()=>i}),function(e){e[e.Pass=0]="Pass",e[e.Draw=1]="Draw"}(i||(i={}))},74780:(e,t,r)=>{r.d(t,{O:()=>i});class i{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}},93316:(e,t,r)=>{r.d(t,{O:()=>a});var i=r(70680),o=r(77800);class a{constructor(e,t,r){this.release=r,this.initializeConfiguration(e,t),this._configuration=t.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}destroy(){this._program=(0,i.yI)(this._program),this._pipeline=this._configuration=null}reload(e){(0,i.yI)(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return o.Uf.TRIANGLES}getPipeline(e,t,r){return this._pipeline}initializeConfiguration(e,t){}}},74912:(e,t,r)=>{r.d(t,{K:()=>o,y:()=>a});var i=r(60288);class o extends i.a{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}function a(e={}){return(t,r)=>{if(t._parameterNames=t._parameterNames??[],t._parameterNames.push(r),null!=e.constValue)Object.defineProperty(t,r,{get:()=>e.constValue});else{const i=t._parameterNames.length-1,o=e.count||2,a=Math.ceil(Math.log2(o)),n=t._parameterBits??[0];let s=0;for(;n[s]+a>16;)s++,s>=n.length&&n.push(0);t._parameterBits=n;const l=n[s],c=(1<<a)-1<<l;n[s]+=a,Object.defineProperty(t,r,{get(){return this[i]},set(e){if(this[i]!==e&&(this[i]=e,this._keyDirty=!0,this._parameterBits[s]=this._parameterBits[s]&~c|+e<<l&c,"number"!=typeof e&&"boolean"!=typeof e))throw new Error("Configuration value for "+r+" must be boolean or number, got "+typeof e)}})}}}},58608:(e,t,r)=>{r.d(t,{u:()=>o});var i=r(60924);class o{constructor(){this.id=(0,i.Q)()}}},74376:(e,t,r)=>{var i;r.d(t,{C:()=>i}),function(e){e[e.Layer=0]="Layer",e[e.Object=1]="Object",e[e.Mesh=2]="Mesh",e[e.Line=3]="Line",e[e.Point=4]="Point",e[e.Material=5]="Material",e[e.Texture=6]="Texture",e[e.COUNT=7]="COUNT"}(i||(i={}))},63524:(e,t,r)=>{r.d(t,{q:()=>o});var i=r(4636);const o=new Map([[i.K.POSITION,0],[i.K.NORMAL,1],[i.K.NORMALCOMPRESSED,1],[i.K.UV0,2],[i.K.COLOR,3],[i.K.COLORFEATUREATTRIBUTE,3],[i.K.SIZE,4],[i.K.TANGENT,4],[i.K.CENTEROFFSETANDDISTANCE,5],[i.K.SYMBOLCOLOR,5],[i.K.FEATUREATTRIBUTE,6],[i.K.INSTANCEFEATUREATTRIBUTE,6],[i.K.INSTANCECOLOR,7],[i.K.OBJECTANDLAYERIDCOLOR,7],[i.K.INSTANCEOBJECTANDLAYERIDCOLOR,7],[i.K.INSTANCEMODEL,8],[i.K.INSTANCEMODELNORMAL,12],[i.K.INSTANCEMODELORIGINHI,11],[i.K.INSTANCEMODELORIGINLO,15]])},10375:(e,t,r)=>{r.d(t,{Q:()=>l});var i=r(70680),o=r(10860),a=r(60288),n=r(12260);class s{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,t){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,t),this._technique),this._technique}ensureResources(e){return n.Iv.LOADED}}class l extends s{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),this._acquire(e.normalTextureId,(e=>this._textureNormal=e)),this._acquire(e.emissiveTextureId,(e=>this._textureEmissive=e)),this._acquire(e.occlusionTextureId,(e=>this._textureOcclusion=e)),this._acquire(e.metallicRoughnessTextureId,(e=>this._textureMetallicRoughness=e))}dispose(){this._texture=(0,i.gT)(this._texture),this._textureNormal=(0,i.gT)(this._textureNormal),this._textureEmissive=(0,i.gT)(this._textureEmissive),this._textureOcclusion=(0,i.gT)(this._textureOcclusion),this._textureMetallicRoughness=(0,i.gT)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?n.Iv.LOADED:n.Iv.LOADING}get textureBindParameters(){return new c(null!=this._texture?this._texture.glTexture:null,null!=this._textureNormal?this._textureNormal.glTexture:null,null!=this._textureEmissive?this._textureEmissive.glTexture:null,null!=this._textureOcclusion?this._textureOcclusion.glTexture:null,null!=this._textureMetallicRoughness?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,i.gT)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}_acquire(e,t){if(null==e)return void t(null);const r=this._textureRepository.acquire(e);if((0,o.eW)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,i.gT)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}class c extends a.a{constructor(e=null,t=null,r=null,i=null,o=null){super(),this.texture=e,this.textureNormal=t,this.textureEmissive=r,this.textureOcclusion=i,this.textureMetallicRoughness=o}}},71520:(e,t,r)=>{r.d(t,{K:()=>w});var i=r(87104),o=r(98472),a=r(97143),n=r(72008);function s(e){if(e.length<n._)return Array.from(e);if((0,n.c7)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,n.Qx)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var l=r(12260),c=r(24680),u=r(62484),d=r(90736);class h{constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._children=void 0,(0,d.Uc)(e.length>=1),(0,d.Uc)(3===r.size||4===r.size);const{data:i,size:a,indices:n}=r;(0,d.Uc)(n.length%this._numIndexPerPrimitive==0),(0,d.Uc)(n.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let l=a*n[this._numIndexPerPrimitive*e[0]];m.clear(),m.push(l);const c=(0,u.WK)(i[l],i[l+1],i[l+2]),h=(0,u.ct)(c);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){l=a*n[r+e],m.push(l);let t=i[l];c[0]=Math.min(t,c[0]),h[0]=Math.max(t,h[0]),t=i[l+1],c[1]=Math.min(t,c[1]),h[1]=Math.max(t,h[1]),t=i[l+2],c[2]=Math.min(t,c[2]),h[2]=Math.max(t,h[2])}}this.bbMin=c,this.bbMax=h;const f=(0,o.k)((0,u.Su)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(h[0]-c[0],h[1]-c[1]),h[2]-c[2]);let p=this.radius*this.radius;for(let e=0;e<m.length;++e){l=m.at(e);const t=i[l]-f[0],r=i[l+1]-f[1],o=i[l+2]-f[2],a=t*t+r*r+o*o;if(a<=p)continue;const n=Math.sqrt(a),s=.5*(n-this.radius);this.radius=this.radius+s,p=this.radius*this.radius;const c=s/n;f[0]+=t*c,f[1]+=r*c,f[2]+=o*c}this.center=f,m.clear()}getChildren(){if(this._children||(0,o.a)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,o.k)((0,u.Su)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:n,indices:s}=this.position;for(let o=0;o<t;++o){let t=0;const l=this._numIndexPerPrimitive*this.primitiveIndices[o];let c=n*s[l],u=a[c],d=a[c+1],h=a[c+2];for(let e=1;e<this._numIndexPerPrimitive;++e){c=n*s[l+e];const t=a[c],r=a[c+1],i=a[c+2];t<u&&(u=t),r<d&&(d=r),i<h&&(h=i)}u<e[0]&&(t|=1),d<e[1]&&(t|=2),h<e[2]&&(t|=4),r[o]=t,++i[t]}let l=0;for(let e=0;e<8;++e)i[e]>0&&++l;if(l<2)return;const c=new Array(8);for(let e=0;e<8;++e)c[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];c[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==c[e]&&this._children.push(new h(c[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){m.prune()}}const m=new c.c({deallocator:null});var f=r(58608),p=r(74376),g=r(52180),v=r(24363);function _(e,t,r){return(0,o.f)(x,t,e),(0,o.f)(T,r,e),.5*(0,o.l)((0,o.b)(x,x,T))}r(20136),new g.o(v.Su),new g.o((()=>{return e?{p0:(0,u.ct)(e.p0),p1:(0,u.ct)(e.p1),p2:(0,u.ct)(e.p2)}:{p0:(0,u.Su)(),p1:(0,u.Su)(),p2:(0,u.Su)()};var e}));const x=(0,u.Su)(),T=(0,u.Su)(),b=(0,u.Su)(),S=(0,u.Su)(),E=(0,u.Su)(),A=(0,u.Su)();var y=r(60924);class C{constructor(e){this.channel=e,this.id=(0,y.Q)()}}var M=r(4636);r(5480),(0,u.Su)(),new Float32Array(6);class w extends f.u{constructor(e,t,r=null,i=p.C.Mesh,o=null,n=-1){super(),this.material=e,this.mapPositions=r,this.type=i,this.objectAndLayerIdColor=o,this.edgeIndicesLength=n,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[e,r]of t)this._attributes.set(e,{...r,indices:(0,a.Uv)(r.indices)}),e===M.K.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(e).indices.length:this.edgeIndicesLength)}instantiate(e={}){const t=new w(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach(((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)})),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get attributes(){return this._attributes}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:s(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:t})}get indexCount(){const e=this._attributes.values().next().value.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===p.C.Mesh?this._computeAttachmentOriginTriangles(e):this.type===p.C.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.e)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:a}=e;(0,o.s)(t,0,0,0),(0,o.s)(A,0,0,0);let n=0,s=0;for(let e=0;e<a.length-2;e+=3){const l=a[e]*r,c=a[e+1]*r,u=a[e+2]*r;(0,o.s)(b,i[l],i[l+1],i[l+2]),(0,o.s)(S,i[c],i[c+1],i[c+2]),(0,o.s)(E,i[u],i[u+1],i[u+2]);const d=_(b,S,E);d?((0,o.g)(b,b,S),(0,o.g)(b,b,E),(0,o.i)(b,b,1/3*d),(0,o.g)(t,t,b),n+=d):((0,o.g)(A,A,b),(0,o.g)(A,A,S),(0,o.g)(A,A,E),s+=3)}return!(0===s&&0===n||(0!==n?((0,o.i)(t,t,1/n),0):0===s||((0,o.i)(t,A,1/s),0)))}(this.attributes.get(M.K.POSITION),e)}_computeAttachmentOriginLines(e){const t=this.attributes.get(M.K.POSITION);return function(e,t,r){if(!e)return!1;(0,o.s)(r,0,0,0),(0,o.s)(A,0,0,0);let i=0,a=0;const{size:n,data:s,indices:l}=e,c=l.length-1,u=c+(t?2:0);for(let e=0;e<u;e+=2){const t=e<c?e+1:0,u=l[e<c?e:c]*n,d=l[t]*n;b[0]=s[u],b[1]=s[u+1],b[2]=s[u+2],S[0]=s[d],S[1]=s[d+1],S[2]=s[d+2],(0,o.i)(b,(0,o.g)(b,b,S),.5);const h=(0,o.m)(b,S);h>0?((0,o.g)(r,r,(0,o.i)(b,b,h)),i+=h):0===i&&((0,o.g)(A,A,b),a++)}return 0!==i?((0,o.i)(r,r,1/i),!0):0!==a&&((0,o.i)(r,A,1/a),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:a}=e;(0,o.s)(t,0,0,0);let n=-1,s=0;for(let e=0;e<a.length;e++){const o=a[e]*r;n!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),n=o}return s>1&&(0,o.i)(t,t,1/s),s>0}(this.attributes.get(M.K.POSITION),e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(M.K.POSITION);if(!e||0===e.indices.length)return null;const t=this.type===p.C.Mesh?3:1;(0,d.Uc)(e.indices.length%t==0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,a.yh)(e.indices.length/t);return new h(r,t,e)}get transformation(){return this._transformation??i.IJ}set transformation(e){this._transformation=e&&e!==i.IJ?(0,i.ct)(e):null}addHighlight(){const e=new C(l.sN.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}},81048:(e,t,r)=>{r.d(t,{iK:()=>h,C2:()=>i});var i,o,a=r(62484),n=r(60288),s=r(12260),l=r(58608),c=r(74376),u=r(63524),d=r(22592);class h extends l.u{constructor(e,t){super(),this.type=c.C.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._vertexAttributeLocations=u.q,this._pp0=(0,a.WK)(0,0,1),this._pp1=(0,a.WK)(0,0,0),this._parameters=(0,d.KM)(e,t),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,d.S_)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bindParameters.decorations===s.C2.ON)&&0!=(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){this.repository?.materialChanged(this)}queryRenderOccludedState(e){return this.isVisible()&&this.parameters.renderOccluded===e}intersectDraped(e,t,r,i,o,a){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this.intersect(e,t,r,this._pp0,this._pp1,o)}}(o=i||(i={}))[o.None=0]="None",o[o.Occlude=1]="Occlude",o[o.Transparent=2]="Transparent",o[o.OccludeAndTransparent=4]="OccludeAndTransparent",o[o.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",o[o.Opaque=16]="Opaque",n.a},1492:(e,t,r)=>{r.d(t,{G:()=>a});var i=r(24680),o=r(94460);class a{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new i.c({deallocator:null}),this._glProgram=e.programCache.acquire(t.generate("vertex"),t.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=t.generateBindPass(this),this.bindDraw=t.generateBindDraw(this),this._fragmentUniforms=(0,o.gv)()?t.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(e,t){this._glProgram.setUniform1i(e,t?1:0)}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if(null==t?.glName){const t=this._textures.get(e);return t&&(this._context.bindTexture(null,t.unit),this._freeTextureUnit(t),this._textures.delete(e)),null}let r=this._textures.get(e);return null==r?(r=this._allocTextureUnit(t),this._textures.set(e,r)):r.texture=t,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(t,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),this._fragmentUniforms?.forEach((e=>{"sampler2D"!==e.type&&"samplerCube"!==e.type||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}},40328:(e,t,r)=>{var i;r.d(t,{y:()=>i}),function(e){e[e.INTEGRATED_MESH=0]="INTEGRATED_MESH",e[e.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",e[e.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",e[e.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",e[e.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",e[e.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",e[e.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",e[e.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",e[e.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",e[e.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",e[e.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",e[e.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",e[e.ANTIALIASING=12]="ANTIALIASING",e[e.COMPOSITE=13]="COMPOSITE",e[e.BLIT=14]="BLIT",e[e.SSAO=15]="SSAO",e[e.HIGHLIGHT=16]="HIGHLIGHT",e[e.SHADOW_HIGHLIGHT=17]="SHADOW_HIGHLIGHT",e[e.ENVIRONMENT_OPAQUE=18]="ENVIRONMENT_OPAQUE",e[e.ENVIRONMENT_TRANSPARENT=19]="ENVIRONMENT_TRANSPARENT",e[e.LASERLINES=20]="LASERLINES",e[e.LASERLINES_CONTRAST_CONTROL=21]="LASERLINES_CONTRAST_CONTROL",e[e.HUD_MATERIAL=22]="HUD_MATERIAL",e[e.LABEL_MATERIAL=23]="LABEL_MATERIAL",e[e.LINE_CALLOUTS=24]="LINE_CALLOUTS",e[e.LINE_CALLOUTS_HUD_DEPTH=25]="LINE_CALLOUTS_HUD_DEPTH",e[e.DRAPED_MATERIAL=26]="DRAPED_MATERIAL",e[e.DRAPED_WATER=27]="DRAPED_WATER",e[e.VOXEL=28]="VOXEL",e[e.MAX_SLOTS=29]="MAX_SLOTS"}(i||(i={}))},56336:(e,t,r)=>{var i;r.d(t,{H:()=>i}),function(e){e[e.Color=0]="Color",e[e.Alpha=1]="Alpha",e[e.FrontFace=2]="FrontFace",e[e.NONE=3]="NONE",e[e.COUNT=4]="COUNT"}(i||(i={}))},12260:(e,t,r)=>{var i,o,a,n,s,l,c,u,d;r.d(t,{Aj:()=>s,C2:()=>u,CM:()=>i,Iv:()=>n,OA:()=>c,sN:()=>l,sr:()=>o,yk:()=>d}),function(e){e[e.None=0]="None",e[e.Front=1]="Front",e[e.Back=2]="Back",e[e.COUNT=3]="COUNT"}(i||(i={})),function(e){e[e.Less=0]="Less",e[e.Lequal=1]="Lequal",e[e.COUNT=2]="COUNT"}(o||(o={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.UPDATE=1]="UPDATE"}(a||(a={})),function(e){e[e.NOT_LOADED=0]="NOT_LOADED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(n||(n={})),function(e){e[e.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",e[e.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(s||(s={})),function(e){e[e.Highlight=0]="Highlight",e[e.MaskOccludee=1]="MaskOccludee",e[e.COUNT=2]="COUNT"}(l||(l={})),function(e){e[e.Blend=0]="Blend",e[e.Opaque=1]="Opaque",e[e.Mask=2]="Mask",e[e.MaskBlend=3]="MaskBlend",e[e.COUNT=4]="COUNT"}(c||(c={})),function(e){e[e.OFF=0]="OFF",e[e.ON=1]="ON"}(u||(u={})),function(e){e.DDS_ENCODING="image/vnd-ms.dds",e.KTX2_ENCODING="image/ktx2",e.BASIS_ENCODING="image/x.basis"}(d||(d={}))},22592:(e,t,r)=>{r.d(t,{An:()=>C,KM:()=>E,Ep:()=>f,S_:()=>A,u6:()=>S});var i=r(92400),o=r(53648),a=r(98472),n=r(62484),s=r(77048),l=r(74376);function c(e,t,r,i){return function(e,t){return(0,o.Cq)(e*Math.max(t.scale,t.minScaleFactor),e,t.factor)}(e,function(e,t,r){const i=r.parameters;return u.scale=Math.min(i.divisor/(t-i.offset),1),u.factor=function(e){return Math.abs(e*e*e)}(e),u}(t,r,i))}r(21288),(0,o.EF)(10),(0,o.EF)(12),(0,o.EF)(70),(0,o.EF)(40);const u={scale:0,factor:0,minScaleFactor:0};var d=r(90736),h=r(4636);const m=(0,s.Su)();function f(e,t,r,i,o,a){if(e.visible)if(e.boundingInfo){(0,d.Uc)(e.type===l.C.Mesh);const n=t.tolerance;g(e.boundingInfo,r,i,n,o,a)}else{const t=e.attributes.get(h.K.POSITION),n=t.indices;_(r,i,0,n.length/3,n,t,void 0,o,a)}}const p=(0,n.Su)();function g(e,t,r,i,o,n){if(null==e)return;const l=function(e,t,r){return(0,a.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,p);if((0,s.C6)(m,e.bbMin),(0,s.mK)(m,e.bbMax),null!=o&&o.applyToAabb(m),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],u=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,u)),l<0)return!1;if(s=Math.max(s,Math.min(c,u)),s>l)return!1;const d=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(d,h)),!(l<0)&&(s=Math.max(s,Math.min(d,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(m,t,l,i)){const{primitiveIndices:a,position:s}=e,l=a?a.length:s.indices.length/3;if(l>M){const a=e.getChildren();if(void 0!==a){for(const e of a)g(e,t,r,i,o,n);return}}_(t,r,0,l,s.indices,s,a,o,n)}}const v=(0,n.Su)();function _(e,t,r,i,o,a,n,s,l){if(n)return function(e,t,r,i,o,a,n,s,l){const{data:c,stride:u}=a,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r;e<i;++e){const t=n[e];let r=3*t,i=u*o[r++],a=c[i++],_=c[i++],x=c[i];i=u*o[r++];let T=c[i++],S=c[i++],E=c[i];i=u*o[r];let A=c[i++],y=c[i++],C=c[i];null!=s&&([a,_,x]=s.applyToVertex(a,_,x,e),[T,S,E]=s.applyToVertex(T,S,E,e),[A,y,C]=s.applyToVertex(A,y,C,e));const M=T-a,w=S-_,I=E-x,R=A-a,O=y-_,N=C-x,P=p*N-O*g,L=g*R-N*f,D=f*O-R*p,F=M*P+w*L+I*D;if(Math.abs(F)<=Number.EPSILON)continue;const U=d-a,B=h-_,G=m-x,V=U*P+B*L+G*D;if(F>0){if(V<0||V>F)continue}else if(V>0||V<F)continue;const z=B*I-w*G,Y=G*M-I*U,H=U*w-M*B,W=f*z+p*Y+g*H;if(F>0){if(W<0||V+W>F)continue}else if(W>0||V+W<F)continue;const j=(R*z+O*Y+N*H)/F;j>=0&&l(j,b(M,w,I,R,O,N,v),t,!1)}}(e,t,r,i,o,a,n,s,l);const{data:c,stride:u}=a,d=e[0],h=e[1],m=e[2],f=t[0]-d,p=t[1]-h,g=t[2]-m;for(let e=r,t=3*r;e<i;++e){let r=u*o[t++],i=c[r++],a=c[r++],n=c[r];r=u*o[t++];let _=c[r++],x=c[r++],T=c[r];r=u*o[t++];let S=c[r++],E=c[r++],A=c[r];null!=s&&([i,a,n]=s.applyToVertex(i,a,n,e),[_,x,T]=s.applyToVertex(_,x,T,e),[S,E,A]=s.applyToVertex(S,E,A,e));const y=_-i,C=x-a,M=T-n,w=S-i,I=E-a,R=A-n,O=p*R-I*g,N=g*w-R*f,P=f*I-w*p,L=y*O+C*N+M*P;if(Math.abs(L)<=Number.EPSILON)continue;const D=d-i,F=h-a,U=m-n,B=D*O+F*N+U*P;if(L>0){if(B<0||B>L)continue}else if(B>0||B<L)continue;const G=F*M-C*U,V=U*y-M*D,z=D*C-y*F,Y=f*G+p*V+g*z;if(L>0){if(Y<0||B+Y>L)continue}else if(Y>0||B+Y<L)continue;const H=(w*G+I*V+R*z)/L;H>=0&&l(H,b(y,C,M,w,I,R,v),e,!1)}}const x=(0,n.Su)(),T=(0,n.Su)();function b(e,t,r,i,o,n,s){return(0,a.s)(x,e,t,r),(0,a.s)(T,i,o,n),(0,a.b)(s,x,T),(0,a.n)(s,s),s}function S(e,t,r,i,a){let n=(r.screenLength||0)*e.pixelRatio;null!=a&&(n=c(n,i,t,a));const s=n*Math.tan(.5*e.fovY)/(.5*e.fullHeight);return(0,o.qk)(s*t,r.minWorldLength||0,null!=r.maxWorldLength?r.maxWorldLength:1/0)}function E(e,t){const r=t?E(t):{};for(const t in e){let i=e[t];i?.forEach&&(i=y(i)),null==i&&t in r||(r[t]=i)}return r}function A(e,t){let r=!1;for(const o in t){const a=t[o];void 0!==a&&(Array.isArray(a)?null===e[o]?(e[o]=a.slice(),r=!0):(0,i.Jr)(e[o],a)&&(r=!0):e[o]!==a&&(r=!0,e[o]=a))}return r}function y(e){const t=[];return e.forEach((e=>t.push(e))),t}const C={multiply:1,ignore:2,replace:3,tint:4},M=1e3},21288:(e,t,r)=>{var i;r.d(t,{UZ:()=>i}),function(e){e[e.Global=1]="Global",e[e.Local=2]="Local"}(i||(i={}))},27308:(e,t,r)=>{var i;r.d(t,{K:()=>i}),function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(i||(i={}))},39104:(e,t,r)=>{var i;r.d(t,{A:()=>i}),function(e){e[e.Texture=0]="Texture",e[e.RenderBuffer=1]="RenderBuffer"}(i||(i={}))},22184:(e,t,r)=>{r.d(t,{w:()=>c});var i=r(20744),o=(r(9456),r(94460)),a=r(77800),n=r(39104),s=r(51576);class l extends s.O{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case a.UV.R16F:case a.UV.R16I:case a.UV.R16UI:case a.UV.R32F:case a.UV.R32I:case a.UV.R32UI:case a.UV.R8_SNORM:case a.UV.R8:case a.UV.R8I:case a.UV.R8UI:this.pixelFormat=a.Id.RED}}static validate(e,t){return new l(e,t)}}let c=class e{constructor(e,t=null,r=null){if(this.type=n.A.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=l.validate(e,t);if(!r)throw new i.c("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===a.c5.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return(0,s.k)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(a.y4.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.c("Immutable textures can't be resized!");r.width=e,r.height=t,this._descriptor.target===a.c5.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=a.c5.TEXTURE_CUBE_MAP_POSITIVE_X;t<=a.c5.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(t,r){if(!this._descriptor.context?.gl)return;const n=this._descriptor.context.gl;(0,o.m_)(n),this._glName||(this._glName=n.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(a.y4.Texture,this)),void 0===t&&(t=null);const s=this._descriptor,l=r??s.target,c=p(l);null===t&&(s.width=s.width||4,s.height=s.height||4,c&&(s.depth=s.depth??1));const v=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),u(s),this._configurePixelStorage(),(0,o.m_)(n);const _=this._deriveInternalFormat();if(f(t)){let e="width"in t?t.width:t.codedWidth,r="height"in t?t.height:t.codedHeight;const i=1;t instanceof HTMLVideoElement&&(e=t.videoWidth,r=t.videoHeight),s.width&&s.height,c&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,_,s.hasMipmap,e,r,i),this._texImage(l,0,_,e,r,i,t),(0,o.m_)(n),s.hasMipmap&&this.generateMipmap(),s.width||(s.width=e),s.height||(s.height=r),c&&!s.depth&&(s.depth=i)}else{const{width:e,height:r,depth:u}=s;if(null==e||null==r)throw new i.c("Width and height must be specified!");if(c&&null==u)throw new i.c("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,_,s.hasMipmap,e,r,u),m(t)){const o=t.levels,c=g(l,e,r,u),d=Math.min(c-1,o.length-1);n.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,d);const h=_;if(!(h in a.sr))throw new i.c("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel(((e,t,r,i)=>{const a=o[Math.min(e,o.length-1)];this._compressedTexImage(l,e,h,t,r,i,a)}),d)}else this._texImage(l,0,_,e,r,u,t),(0,o.m_)(n),s.hasMipmap&&this.generateMipmap()}d(n,this._descriptor),h(n,this._descriptor),function(e,t){const r=e.capabilities.textureFilterAnisotropic;r&&e.gl.texParameterf(t.target,r.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}(this._descriptor.context,this._descriptor),(0,o.m_)(n),this._descriptor.context.bindTexture(v,e.TEXTURE_UNIT_FOR_UPDATES)}updateData(t,r,o,a,n,s,l=0){s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor,u=this._deriveInternalFormat(),{context:d,pixelFormat:h,dataType:p,target:g,isImmutable:v}=c;if(v&&!this._wasImmutablyAllocated)throw new i.c("Cannot update immutable texture before allocation!");const _=d.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||a>c.width||n>c.height||r+a>c.width||o+n>c.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:x}=d;l&&x.pixelStorei(x.UNPACK_SKIP_ROWS,l),f(s)?x.texSubImage2D(g,t,r,o,a,n,h,p,s):m(s)?x.compressedTexSubImage2D(g,t,r,o,a,n,u,s.levels[t]):x.texSubImage2D(g,t,r,o,a,n,h,p,s),l&&x.pixelStorei(x.UNPACK_SKIP_ROWS,0),d.bindTexture(_,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,r,o,a,n,s,l,c){c||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const u=this._descriptor,d=this._deriveInternalFormat(),{context:h,pixelFormat:f,dataType:g,isImmutable:v,target:_}=u;if(v&&!this._wasImmutablyAllocated)throw new i.c("Cannot update immutable texture before allocation!");p(_)||console.warn("Attempting to set 3D texture data on a non-3D texture");const x=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||a<0||n>u.width||s>u.height||l>u.depth||r+n>u.width||o+s>u.height||a+l>u.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=h;if(m(c))c=c.levels[t],T.compressedTexSubImage3D(_,t,r,o,a,n,s,l,d,c);else{const e=c;T.texSubImage3D(_,t,r,o,a,n,s,l,f,g,e)}h.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new i.c("Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,u(t)}t.samplingMode===a.Ud.LINEAR?(this._samplingModeDirty=!0,t.samplingMode=a.Ud.LINEAR_MIPMAP_NEAREST):t.samplingMode===a.Ud.NEAREST&&(this._samplingModeDirty=!0,t.samplingMode=a.Ud.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,u(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,t=e.context.gl;this._samplingModeDirty&&(d(t,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(h(t,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===a.Id.DEPTH_STENCIL&&(this._descriptor.internalFormat=a.Id.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case a.OK.FLOAT:switch(this._descriptor.pixelFormat){case a.Id.RGBA:return this._descriptor.internalFormat=a.UV.RGBA32F;case a.Id.RGB:return this._descriptor.internalFormat=a.UV.RGB32F;default:throw new i.c("Unable to derive format")}case a.OK.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case a.Id.RGBA:return this._descriptor.internalFormat=a.UV.RGBA8;case a.Id.RGB:return this._descriptor.internalFormat=a.UV.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===a.Id.DEPTH_STENCIL?a.Id.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_texStorage(e,t,r,o,n,s){const{gl:l}=this._descriptor.context;if(!(t in a.UV))throw new i.c("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?g(e,o,n,s):1;if(p(e)){if(null==s)throw new i.c("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,t,o,n,s)}else l.texStorage2D(e,c,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,a,n,s){const l=this._descriptor.context.gl,c=p(e),{isImmutable:u,pixelFormat:d,dataType:h}=this._descriptor;if(u){if(null!=s){const r=s;if(c){if(null==n)throw new i.c("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,a,n,d,h,r)}else l.texSubImage2D(e,t,0,0,o,a,d,h,r)}}else{const u=s;if(c){if(null==n)throw new i.c("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,a,n,0,d,h,u)}else l.texImage2D(e,t,r,o,a,0,d,h,u)}}_compressedTexImage(e,t,r,o,a,n,s){const l=this._descriptor.context.gl,c=p(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==n)throw new i.c("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,a,n,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,a,r,s)}else if(c){if(null==n)throw new i.c("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,a,n,0,s)}else l.compressedTexImage2D(e,t,r,o,a,0,s)}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:s,target:l}=this._descriptor;const c=l===a.c5.TEXTURE_3D;if(null==r||null==o||c&&null==n)throw new i.c("Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),s&&(1!==r||1!==o||c&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),c&&(n=Math.max(1,n>>1))}};function u(e){(null!=e.width&&e.width<0||null!=e.height&&e.height<0||null!=e.depth&&e.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function d(e,t){let r=t.samplingMode,i=t.samplingMode;r===a.Ud.LINEAR_MIPMAP_NEAREST||r===a.Ud.LINEAR_MIPMAP_LINEAR?(r=a.Ud.LINEAR,t.hasMipmap||(i=a.Ud.LINEAR)):r!==a.Ud.NEAREST_MIPMAP_NEAREST&&r!==a.Ud.NEAREST_MIPMAP_LINEAR||(r=a.Ud.NEAREST,t.hasMipmap||(i=a.Ud.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,r),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,i)}function h(e,t){"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}function m(e){return null!=e&&"type"in e&&"compressed"===e.type}function f(e){return null!=e&&!m(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function p(e){return e===a.c5.TEXTURE_3D||e===a.c5.TEXTURE_2D_ARRAY}function g(e,t,r,i=1){let o=Math.max(t,r);return e===a.c5.TEXTURE_3D&&(o=Math.max(o,i)),Math.round(Math.log(o)/Math.LN2)+1}c.TEXTURE_UNIT_FOR_UPDATES=0},51576:(e,t,r)=>{r.d(t,{O:()=>a,k:()=>n});var i=r(77800),o=r(97684);class a{constructor(e=0,t=e){this.width=e,this.height=t,this.target=i.c5.TEXTURE_2D,this.pixelFormat=i.Id.RGBA,this.dataType=i.OK.UNSIGNED_BYTE,this.samplingMode=i.Ud.LINEAR,this.wrapMode=i.Qz.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function n(e){return e.width<=0||e.height<=0?0:Math.round(e.width*e.height*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,o.O4)(e.internalFormat)))}},97684:(e,t,r)=>{r.d(t,{O4:()=>o}),r(9456),r(94460);var i=r(77800);function o(e){switch(e){case i.Id.ALPHA:case i.Id.LUMINANCE:case i.Id.RED:case i.Id.RED_INTEGER:case i.UV.R8:case i.UV.R8I:case i.UV.R8UI:case i.UV.R8_SNORM:case i.Qb.STENCIL_INDEX8:return 1;case i.Id.LUMINANCE_ALPHA:case i.Id.RG:case i.Id.RG_INTEGER:case i.UV.RGBA4:case i.UV.R16F:case i.UV.R16I:case i.UV.R16UI:case i.UV.RG8:case i.UV.RG8I:case i.UV.RG8UI:case i.UV.RG8_SNORM:case i.UV.RGB565:case i.UV.RGB5_A1:case i.Qb.DEPTH_COMPONENT16:return 2;case i.Id.DEPTH_COMPONENT:case i.Id.RGB:case i.Id.RGB_INTEGER:case i.UV.RGB8:case i.UV.RGB8I:case i.UV.RGB8UI:case i.UV.RGB8_SNORM:case i.UV.SRGB8:case i.Qb.DEPTH_COMPONENT24:return 3;case i.Id.DEPTH_STENCIL:case i.Id.DEPTH24_STENCIL8:case i.Id.RGBA:case i.Id.RGBA_INTEGER:case i.UV.RGBA8:case i.UV.R32F:case i.UV.R11F_G11F_B10F:case i.UV.RG16F:case i.UV.R32I:case i.UV.R32UI:case i.UV.RG16I:case i.UV.RG16UI:case i.UV.RGBA8I:case i.UV.RGBA8UI:case i.UV.RGBA8_SNORM:case i.UV.SRGB8_ALPHA8:case i.UV.RGB9_E5:case i.UV.RGB10_A2UI:case i.UV.RGB10_A2:case i.Qb.DEPTH_STENCIL:case i.Qb.DEPTH_COMPONENT32F:case i.Qb.DEPTH24_STENCIL8:return 4;case i.Qb.DEPTH32F_STENCIL8:return 5;case i.UV.RGB16F:case i.UV.RGB16I:case i.UV.RGB16UI:return 6;case i.UV.RG32F:case i.UV.RG32I:case i.UV.RG32UI:case i.UV.RGBA16F:case i.UV.RGBA16I:case i.UV.RGBA16UI:return 8;case i.UV.RGB32F:case i.UV.RGB32I:case i.UV.RGB32UI:return 12;case i.UV.RGBA32F:case i.UV.RGBA32I:case i.UV.RGBA32UI:return 16;case i.sr.COMPRESSED_RGB_S3TC_DXT1_EXT:case i.sr.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case i.sr.COMPRESSED_RGBA_S3TC_DXT3_EXT:case i.sr.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case i.sr.COMPRESSED_R11_EAC:case i.sr.COMPRESSED_SIGNED_R11_EAC:case i.sr.COMPRESSED_RGB8_ETC2:case i.sr.COMPRESSED_SRGB8_ETC2:case i.sr.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case i.sr.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case i.sr.COMPRESSED_RG11_EAC:case i.sr.COMPRESSED_SIGNED_RG11_EAC:case i.sr.COMPRESSED_RGBA8_ETC2_EAC:case i.sr.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}r(2944)},94460:(e,t,r)=>{r.d(t,{E5:()=>c,gv:()=>l,m_:()=>u});var i=r(20744),o=r(9456),a=r(66360);const n=()=>a.c.getLogger("esri.views.webgl.checkWebGLError"),s=!!(0,o.c)("enable-feature:webgl-debug");function l(){return s}function c(){return s}function u(e){if(l()){const t=e.getError();if(t){const r=function(e,t){switch(t){case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}(e,t),o=(new Error).stack;n().error(new i.c("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}},5480:(e,t,r)=>{function i(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],t[i]=a[0];return t}function o(e,t){const r=e.length;for(let i=0;i<r;++i)a[0]=e[i],a[1]=e[i]-a[0],t[i]=a[1];return t}r.d(t,{KM:()=>i,Ky:()=>o});const a=new Float32Array(2)},2944:(e,t,r)=>{r(77800)},81472:(e,t,r)=>{r.d(t,{AD:()=>c,AT:()=>u,KO:()=>a,_w:()=>b,ac:()=>n,kp:()=>d});var i=r(12260),o=r(77800);function a(e,t,r=o.YT.ADD,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,a=o.YT.ADD,n=o.YT.ADD,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:a,opAlpha:n,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}const s={face:o.SC.BACK,mode:o.vs.CCW},l={face:o.SC.FRONT,mode:o.vs.CCW},c=e=>e===i.CM.Back?s:e===i.CM.Front?l:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function h(e){return A.intern(e)}function m(e){return C.intern(e)}function f(e){return w.intern(e)}function p(e){return R.intern(e)}function g(e){return N.intern(e)}function v(e){return L.intern(e)}function _(e){return F.intern(e)}function x(e){return B.intern(e)}function T(e){return V.intern(e)}function b(e){return Y.intern(e)}class S{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function E(e){return"["+e.join(",")+"]"}const A=new S(y,(e=>({__tag:"Blending",...e})));function y(e){return e?E([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const C=new S(M,(e=>({__tag:"Culling",...e})));function M(e){return e?E([e.face,e.mode]):null}const w=new S(I,(e=>({__tag:"PolygonOffset",...e})));function I(e){return e?E([e.factor,e.units]):null}const R=new S(O,(e=>({__tag:"DepthTest",...e})));function O(e){return e?E([e.func]):null}const N=new S(P,(e=>({__tag:"StencilTest",...e})));function P(e){return e?E([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const L=new S(D,(e=>({__tag:"DepthWrite",...e})));function D(e){return e?E([e.zNear,e.zFar]):null}const F=new S(U,(e=>({__tag:"ColorWrite",...e})));function U(e){return e?E([e.r,e.g,e.b,e.a]):null}const B=new S(G,(e=>({__tag:"StencilWrite",...e})));function G(e){return e?E([e.mask]):null}const V=new S(z,(e=>({__tag:"DrawBuffers",...e})));function z(e){return e?E(e.buffers):null}const Y=new S((function(e){return e?E([y(e.blending),M(e.culling),I(e.polygonOffset),O(e.depthTest),P(e.stencilTest),D(e.depthWrite),U(e.colorWrite),G(e.stencilWrite),z(e.drawBuffers)]):null}),(e=>({blending:h(e.blending),culling:m(e.culling),polygonOffset:f(e.polygonOffset),depthTest:p(e.depthTest),stencilTest:g(e.stencilTest),depthWrite:v(e.depthWrite),colorWrite:_(e.colorWrite),stencilWrite:x(e.stencilWrite),drawBuffers:T(e.drawBuffers)})))}}]);
|