@arcgis/core 4.27.0-rc.1 → 4.27.0-rc.3
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/README.md +2 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{a8565d1c676f3bfbcebb.js → 002fe1ec63ea33e6972d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0610691a0c0d9fbbd6d2.js → 013de5c2955801b329b3.js} +1 -1
- package/assets/esri/core/workers/chunks/07163dcbb871f927a580.js +1 -0
- package/assets/esri/core/workers/chunks/0e46687004392c493c06.js +1 -0
- package/assets/esri/core/workers/chunks/0e65e00173b66c7fec2e.js +1 -0
- package/assets/esri/core/workers/chunks/1aa8dd317ecd3c41e0ea.js +1 -0
- package/assets/esri/core/workers/chunks/21328f3dd26abe84a10d.js +1 -0
- package/assets/esri/core/workers/chunks/28c67c98039503b62e6e.js +1 -0
- package/assets/esri/core/workers/chunks/2faa8f08f2fdaac3f4af.js +1 -0
- package/assets/esri/core/workers/chunks/{0407bf97ad621c89a734.js → 3160af63b860b52db389.js} +1 -1
- package/assets/esri/core/workers/chunks/3767b9e7660873b018c2.js +1 -0
- package/assets/esri/core/workers/chunks/39ae4b9b766f674bc6f2.js +1 -0
- package/assets/esri/core/workers/chunks/45629ff775e77234b227.js +1 -0
- package/assets/esri/core/workers/chunks/471f6eba213412b82840.js +1 -0
- package/assets/esri/core/workers/chunks/4a4f14a3d8da270059c4.js +1 -0
- package/assets/esri/core/workers/chunks/{3e239bfad611985e50fb.js → 50f910797c17c3028521.js} +1 -1
- package/assets/esri/core/workers/chunks/{f339db2b599fa9585283.js → 5e6471dd2a08e66b47d0.js} +79 -81
- package/assets/esri/core/workers/chunks/642c5a93c0a454bdd115.js +1 -0
- package/assets/esri/core/workers/chunks/{14145959a3dab1437818.js → 6627f1bc9ee6b620e3aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{170bdbdb4e21bf91a17f.js → 6eaa7a51efde2dd4a5a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8bd3f498b3fa8153404.js → 6f510f28526c73ab453c.js} +1 -1
- package/assets/esri/core/workers/chunks/{2bdc63395c7466ce1641.js → 7053c2f5a958d4c8629b.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c35c663528f710e8c78.js → 79cb672c85ea29e8484a.js} +1 -1
- package/assets/esri/core/workers/chunks/82939ead43848a13f765.js +1 -0
- package/assets/esri/core/workers/chunks/83e3d104886b48f00397.js +1 -0
- package/assets/esri/core/workers/chunks/89001ee8d3f69fa03cc1.js +1 -0
- package/assets/esri/core/workers/chunks/8b6b963230df56850580.js +1 -0
- package/assets/esri/core/workers/chunks/9472184ef1432fc55d6b.js +1 -0
- package/assets/esri/core/workers/chunks/{3c5a64a545272f148e93.js → 9621b7d8d951aa881686.js} +1 -1
- package/assets/esri/core/workers/chunks/a6ddf80eb324c35076e1.js +1 -0
- package/assets/esri/core/workers/chunks/a80a6267d88246ede5d3.js +1 -0
- package/assets/esri/core/workers/chunks/{b6e173eddaad4244cb5f.js → b31974524932e638df8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f505ebd4bd3bfb6c790d.js → b6a55fdfe16795ebf02c.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9e1fde9f6b2b4f10c0.js +1 -0
- package/assets/esri/core/workers/chunks/cfa3b2b1e184681e9af4.js +1 -0
- package/assets/esri/core/workers/chunks/{92e7f224a80195e606d6.js → d4ba894a2583f3930a4f.js} +1 -1
- package/assets/esri/core/workers/chunks/d5dfd3d693d5e393a542.js +1 -0
- package/assets/esri/core/workers/chunks/dabd889e064c4e7807fa.js +1 -0
- package/assets/esri/core/workers/chunks/{74fd2059ddda9083cbcc.js → dc6c97a43d642eeaf477.js} +1 -1
- package/assets/esri/core/workers/chunks/{2154d395f405be3cd3ba.js → eca0c3d57b3a1e3a14ee.js} +1 -1
- package/assets/esri/core/workers/chunks/f35895e03c036d67b3ed.js +1 -0
- package/assets/esri/core/workers/chunks/f36697f6aac782007d1a.js +1 -0
- package/assets/esri/core/workers/chunks/f52054f27619a98b7bb7.js +1 -0
- package/assets/esri/core/workers/chunks/{c6efe2e04ea6a55bb6e3.js → f6e68befe2812b90b40d.js} +1 -1
- package/assets/esri/core/workers/chunks/fb7fe307a583b6a22218.js +1 -0
- package/assets/esri/core/workers/chunks/fbd3c78ee8e2219a6c7a.js +1 -0
- package/assets/esri/core/workers/chunks/ff42585e1b1d0c5497af.js +1 -0
- package/assets/esri/images/portal/livestreamvideolayer16.png +0 -0
- package/assets/esri/images/portal/{mediaservice16.png → videolayer16.png} +0 -0
- package/assets/esri/themes/base/widgets/_Feature.scss +4 -0
- package/assets/esri/themes/base/widgets/_FeatureContent.scss +9 -2
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +19 -2
- package/assets/esri/themes/base/widgets/_ScaleRangeSlider.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/DefaultMaterial.glsl.js +3 -2
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/core/timeUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/meshVertexSpaceUtils.js +5 -0
- package/interfaces.d.ts +263 -31
- package/kernel.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/controllers/StreamController.js +1 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/attributeSupport.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/support/editableLayers.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/video/videoUtils.js +5 -0
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/request.js +1 -1
- package/rest/support/meshFeatureSet.js +1 -1
- package/smartMapping/symbology/flow.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/StreamSource.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/II3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js +3 -9
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +12 -9
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +10 -10
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderModules/Matrix4sDrawUniform.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/webmap/initialViewPropertiesUtils.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateWorkflow.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/UpdateWorkflowData.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/FeatureRelationship.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/EditableInput.d.ts +2 -2
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/css.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
- package/widgets/UtilityNetworkTrace/support/ResultAreaHandler.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +4 -0
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.d.ts +4 -0
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/support/geolocationUtils.js +1 -1
- package/assets/esri/core/workers/chunks/07651ef8348f702d59ac.js +0 -1
- package/assets/esri/core/workers/chunks/0a02ac5628d1739372c6.js +0 -1
- package/assets/esri/core/workers/chunks/0fcb8d408696075338e2.js +0 -1
- package/assets/esri/core/workers/chunks/16e459b16bdd6e1a821b.js +0 -1
- package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +0 -1
- package/assets/esri/core/workers/chunks/39714837f9d3708e3806.js +0 -1
- package/assets/esri/core/workers/chunks/3ba2fcb9110230f8790c.js +0 -1
- package/assets/esri/core/workers/chunks/474d9b334812533bab36.js +0 -1
- package/assets/esri/core/workers/chunks/5576858f56314afcb4d5.js +0 -1
- package/assets/esri/core/workers/chunks/5706edf45402dff279a6.js +0 -1
- package/assets/esri/core/workers/chunks/659b7bad7281c0e2aed3.js +0 -1
- package/assets/esri/core/workers/chunks/785a6c925f29bc962992.js +0 -1
- package/assets/esri/core/workers/chunks/90da1ed112b82712d0ef.js +0 -1
- package/assets/esri/core/workers/chunks/9326120c750799eb2d28.js +0 -1
- package/assets/esri/core/workers/chunks/99e0cec47e3ef72c1de4.js +0 -1
- package/assets/esri/core/workers/chunks/9c0e1e87790424f42d7e.js +0 -1
- package/assets/esri/core/workers/chunks/9e66af3b1c70cf25fb32.js +0 -1
- package/assets/esri/core/workers/chunks/a1c31bb8c12831539328.js +0 -1
- package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +0 -1
- package/assets/esri/core/workers/chunks/b5fc6f2044ed047c5afd.js +0 -1
- package/assets/esri/core/workers/chunks/c08e03165043df67c11b.js +0 -1
- package/assets/esri/core/workers/chunks/c26148d4bfab3b3dfab2.js +0 -1
- package/assets/esri/core/workers/chunks/d6b6bb8aecc85d2a3f6b.js +0 -1
- package/assets/esri/core/workers/chunks/eeaf8010e38b65a101ac.js +0 -1
- package/assets/esri/core/workers/chunks/f235392c56063fbf89c6.js +0 -1
- package/assets/esri/core/workers/chunks/fdd0d3616c97e408b104.js +0 -1
package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as
|
|
5
|
+
import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as e}from"../ForwardLinearDepth.glsl.js";import{ShaderOutput as r}from"../ShaderOutput.js";import{SliceDraw as t}from"../Slice.glsl.js";import{Transform as i}from"../Transform.glsl.js";import{NormalAttribute as a,NormalType as s}from"../attributes/NormalAttribute.glsl.js";import{ObjectAndLayerIdColor as l}from"../attributes/ObjectAndLayerIdColor.glsl.js";import{TextureCoordinateAttribute as d}from"../attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormal as n}from"../attributes/VertexNormal.glsl.js";import{OutputDepth as c}from"../output/OutputDepth.glsl.js";import{OutputHighlight as u}from"../output/OutputHighlight.glsl.js";import{VisualVariables as m}from"../shading/VisualVariables.glsl.js";import{DiscardOrAdjustAlphaPass as p}from"../util/AlphaDiscard.glsl.js";import{addProjViewLocalOrigin as v}from"../util/View.glsl.js";import{glsl as f}from"../../shaderModules/interfaces.js";import{Matrix4PassUniform as h}from"../../shaderModules/Matrix4PassUniform.js";import{Texture2DPassUniform as g}from"../../shaderModules/Texture2DPassUniform.js";import{AlphaDiscardMode as x}from"../../../lib/basicInterfaces.js";function j(j,w){const{vertex:C,fragment:O}=j,b=w.hasModelTransformation;b&&C.uniforms.add(new h("model",(e=>e.modelTransformation??o)));const T=w.hasColorTexture&&w.alphaDiscardMode!==x.Opaque;switch(w.output){case r.Depth:case r.Shadow:case r.ShadowHighlight:case r.ShadowExcludeHighlight:case r.ObjectAndLayerIdColor:v(C,w),j.include(i,w),j.include(d,w),j.include(m,w),j.include(c,w),j.include(t,w),j.include(l,w),e(j),j.varyings.add("depth","float"),T&&O.uniforms.add(new g("tex",(o=>o.texture))),C.code.add(f`
|
|
6
6
|
void main(void) {
|
|
7
7
|
vpos = calculateVPos();
|
|
8
|
+
${b?"vpos = (model * vec4(vpos, 1.0)).xyz;":""}
|
|
8
9
|
vpos = subtractOrigin(vpos);
|
|
9
10
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
10
|
-
gl_Position = transformPositionWithDepth(proj, view,
|
|
11
|
+
gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);
|
|
11
12
|
forwardTextureCoordinates();
|
|
12
13
|
forwardObjectAndLayerIdColor();
|
|
13
14
|
}
|
|
@@ -17,20 +18,21 @@ import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as r}f
|
|
|
17
18
|
${T?f`
|
|
18
19
|
vec4 texColor = texture(tex, ${w.hasColorTextureTransform?f`colorUV`:f`vuv0`});
|
|
19
20
|
discardOrAdjustAlpha(texColor);`:""}
|
|
20
|
-
${w.output===
|
|
21
|
+
${w.output===r.ObjectAndLayerIdColor?f`outputObjectAndLayerIdColor();`:f`outputDepth(depth);`}
|
|
21
22
|
}
|
|
22
|
-
`);break;case
|
|
23
|
+
`);break;case r.Normal:{v(C,w),j.include(i,w),j.include(a,w),j.include(n,w),j.include(d,w),j.include(m,w),T&&O.uniforms.add(new g("tex",(o=>o.texture))),w.normalType===s.ScreenDerivative&&j.varyings.add("vPositionView","vec3");const o=w.normalType===s.Attribute||w.normalType===s.Compressed;C.code.add(f`
|
|
23
24
|
void main(void) {
|
|
24
25
|
vpos = calculateVPos();
|
|
26
|
+
${b?"vpos = (model * vec4(vpos, 1.0)).xyz;":""}
|
|
25
27
|
|
|
26
28
|
${o?f`
|
|
27
29
|
vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:f`
|
|
28
30
|
// Get vertex position in camera space for screen-space derivative normals
|
|
29
|
-
vPositionView = (view *
|
|
31
|
+
vPositionView = (view * vec4(vpos, 1.0)).xyz;
|
|
30
32
|
`}
|
|
31
33
|
vpos = subtractOrigin(vpos);
|
|
32
34
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
33
|
-
gl_Position = transformPosition(proj, view,
|
|
35
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
34
36
|
forwardTextureCoordinates();
|
|
35
37
|
}
|
|
36
38
|
`),j.include(t,w),j.include(p,w),O.code.add(f`
|
|
@@ -47,15 +49,16 @@ import{I as o}from"../../../../../../chunks/mat4f64.js";import{addNearFar as r}f
|
|
|
47
49
|
}`}
|
|
48
50
|
fragColor = vec4(0.5 + 0.5 * normal, 1.0);
|
|
49
51
|
}
|
|
50
|
-
`);break}case
|
|
52
|
+
`);break}case r.Highlight:v(C,w),j.include(i,w),j.include(d,w),j.include(m,w),T&&O.uniforms.add(new g("tex",(o=>o.texture))),C.code.add(f`
|
|
51
53
|
void main(void) {
|
|
52
54
|
vpos = calculateVPos();
|
|
55
|
+
${b?"vpos = (model * vec4(vpos, 1.0)).xyz;":""}
|
|
53
56
|
vpos = subtractOrigin(vpos);
|
|
54
57
|
vpos = addVerticalOffset(vpos, localOrigin);
|
|
55
|
-
gl_Position = transformPosition(proj, view,
|
|
58
|
+
gl_Position = transformPosition(proj, view, vpos);
|
|
56
59
|
forwardTextureCoordinates();
|
|
57
60
|
}
|
|
58
|
-
`),j.include(t,w),j.include(p,w),j.include(
|
|
61
|
+
`),j.include(t,w),j.include(p,w),j.include(u,w),O.code.add(f`
|
|
59
62
|
void main() {
|
|
60
63
|
discardBySlice(vpos);
|
|
61
64
|
${T?f`
|
package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
CHANGED
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{VertexTextureCoordinates as e}from"../attributes/VertexTextureCoordinates.glsl.js";import{Float3DrawUniform as s}from"../../shaderModules/Float3DrawUniform.js";import{Float3PassUniform as o}from"../../shaderModules/Float3PassUniform.js";import{glsl as r}from"../../shaderModules/interfaces.js";import{Texture2DDrawUniform as i}from"../../shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as t}from"../../shaderModules/Texture2DPassUniform.js";import{BindType as a}from"../../shaderTechnique/BindType.js";import{GLTextureMaterialBindParameters as n}from"../../../lib/GLTextureMaterial.js";var c;!function(e){e[e.Disabled=0]="Disabled",e[e.Normal=1]="Normal",e[e.Schematic=2]="Schematic",e[e.Water=3]="Water",e[e.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",e[e.Terrain=5]="Terrain",e[e.TerrainWithWater=6]="TerrainWithWater",e[e.COUNT=7]="COUNT"}(c||(c={}));class u extends n{}function l(n,u){const l=n.fragment,m=u.hasMetallicRoughnessTexture||u.hasEmissionTexture||u.hasOcclusionTexture;if(u.pbrMode===c.Normal&&m&&n.include(e,u),u.pbrMode!==c.Schematic)if(u.pbrMode!==c.Disabled){if(u.pbrMode===c.Normal){l.code.add(r`vec3 mrr;
|
|
6
6
|
vec3 emission;
|
|
7
|
-
float occlusion;`);const e=
|
|
7
|
+
float occlusion;`);const e=u.pbrTextureBindType;u.hasMetallicRoughnessTexture&&(l.uniforms.add(e===a.Pass?new t("texMetallicRoughness",(e=>e.textureMetallicRoughness)):new i("texMetallicRoughness",(e=>e.textureMetallicRoughness))),l.code.add(r`void applyMetallnessAndRoughness(vec2 uv) {
|
|
8
8
|
vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb;
|
|
9
9
|
mrr[0] *= metallicRoughness.b;
|
|
10
10
|
mrr[1] *= metallicRoughness.g;
|
|
11
|
-
}`)),
|
|
11
|
+
}`)),u.hasEmissionTexture&&(l.uniforms.add(e===a.Pass?new t("texEmission",(e=>e.textureEmissive)):new i("texEmission",(e=>e.textureEmissive))),l.code.add(r`void applyEmission(vec2 uv) {
|
|
12
12
|
emission *= textureLookup(texEmission, uv).rgb;
|
|
13
|
-
}`)),
|
|
13
|
+
}`)),u.hasOcclusionTexture?(l.uniforms.add(e===a.Pass?new t("texOcclusion",(e=>e.textureOcclusion)):new i("texOcclusion",(e=>e.textureOcclusion))),l.code.add(r`void applyOcclusion(vec2 uv) {
|
|
14
14
|
occlusion *= textureLookup(texOcclusion, uv).r;
|
|
15
15
|
}
|
|
16
16
|
float getBakedOcclusion() {
|
|
17
17
|
return occlusion;
|
|
18
|
-
}`)):
|
|
18
|
+
}`)):l.code.add(r`float getBakedOcclusion() { return 1.0; }`),e===a.Pass?l.uniforms.add(new o("emissionFactor",(e=>e.emissiveFactor)),new o("mrrFactors",(e=>e.mrrFactors))):l.uniforms.add(new s("emissionFactor",(e=>e.emissiveFactor)),new s("mrrFactors",(e=>e.mrrFactors))),l.code.add(r`
|
|
19
19
|
void applyPBRFactors() {
|
|
20
20
|
mrr = mrrFactors;
|
|
21
21
|
emission = emissionFactor;
|
|
22
22
|
occlusion = 1.0;
|
|
23
23
|
|
|
24
|
-
${
|
|
24
|
+
${u.hasMetallicRoughnessTexture?r`applyMetallnessAndRoughness(${u.hasMetallicRoughnessTextureTransform?r`metallicRoughnessUV`:"vuv0"});`:""}
|
|
25
25
|
|
|
26
|
-
${
|
|
26
|
+
${u.hasEmissionTexture?r`applyEmission(${u.hasEmissiveTextureTransform?r`emissiveUV`:"vuv0"});`:""}
|
|
27
27
|
|
|
28
|
-
${
|
|
28
|
+
${u.hasOcclusionTexture?r`applyOcclusion(${u.hasOcclusionTextureTransform?r`occlusionUV`:"vuv0"});`:""}
|
|
29
29
|
}
|
|
30
|
-
`)}}else
|
|
30
|
+
`)}}else l.code.add(r`float getBakedOcclusion() { return 1.0; }`);else l.code.add(r`vec3 mrr = vec3(0.0, 0.6, 0.2);
|
|
31
31
|
vec3 emission = vec3(0.0);
|
|
32
32
|
float occlusion = 1.0;
|
|
33
33
|
void applyPBRFactors() {}
|
|
34
|
-
float getBakedOcclusion() { return 1.0; }`)}export{
|
|
34
|
+
float getBakedOcclusion() { return 1.0; }`)}export{u as PBRBindParameters,c as PBRMode,l as PhysicallyBasedRenderingParameters};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{I as e}from"../../../../../../chunks/mat4f64.js";import{c as a}from"../../../../../../chunks/vec3f64.js";import{RgbaFloatEncoding as s}from"../util/RgbaFloatEncoding.glsl.js";import{Float4PassUniform as o}from"../../shaderModules/Float4PassUniform.js";import{IntegerPassUniform as t}from"../../shaderModules/IntegerPassUniform.js";import{NoParameters as i,glsl as r}from"../../shaderModules/interfaces.js";import{Matrix4sDrawUniform as d}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as l}from"../../shaderModules/Matrix4sPassUniform.js";import{Texture2DPassUniform as n}from"../../shaderModules/Texture2DPassUniform.js";class p extends i{constructor(){super(...arguments),this.origin=a()}}class c extends p{}class h extends i{constructor(){super(...arguments),this.modelTransformation=e}}class v extends h{constructor(){super(...arguments),this.origin=a()}}function f(e,a){a.receiveShadows&&(e.fragment.uniforms.add(new l("shadowMapMatrix",((e,a)=>a.shadowMap.getShadowMapMatrices(e.origin,e.modelTransformation)),4)),u(e))}function m(e,a){a.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,a,s)=>a.shadowMap.getShadowMapMatrices(e.origin,s.modelTransformation)),4)),u(e))}function u(e){const a=e.fragment;a.include(s),a.uniforms.add(new n("shadowMapTex",((e,a)=>a.shadowMap.depthTexture)),new t("numCascades",((e,a)=>a.shadowMap.numCascades)),new o("cascadeDistances",((e,a)=>a.shadowMap.cascadeDistances))),a.code.add(r`int chooseCascade(float depth, out mat4 mat) {
|
|
6
6
|
vec4 distance = cascadeDistances;
|
|
7
7
|
int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
|
|
8
8
|
mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
|
|
@@ -40,4 +40,4 @@ if (lvpos.z >= 1.0) { return 0.0; }
|
|
|
40
40
|
if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
|
|
41
41
|
vec2 uv = cascadeCoordinates(i, lvpos);
|
|
42
42
|
return filterShadow(uv, lvpos, float(textureSize(shadowMapTex, 0).x), shadowMapTex);
|
|
43
|
-
}`)}export{
|
|
43
|
+
}`)}export{m as ReadShadowMapDraw,c as ReadShadowMapDrawParameters,h as ReadShadowMapParameters,f as ReadShadowMapPass,v as ReadShadowMapPassParameters};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{s as e}from"../../../../../../chunks/vec2.js";import{a as t}from"../../../../../../chunks/vec2f64.js";import{s as r}from"../../../../../../chunks/vec4.js";import{c as a}from"../../../../../../chunks/vec4f64.js";import{FoamIntensity as o}from"./FoamRendering.glsl.js";import{
|
|
5
|
+
import{s as e}from"../../../../../../chunks/vec2.js";import{a as t}from"../../../../../../chunks/vec2f64.js";import{s as r}from"../../../../../../chunks/vec4.js";import{c as a}from"../../../../../../chunks/vec4f64.js";import{FoamIntensity as o}from"./FoamRendering.glsl.js";import{ReadShadowMapPassParameters as m}from"./ReadShadowMap.glsl.js";import{Float2PassUniform as s}from"../../shaderModules/Float2PassUniform.js";import{Float4PassUniform as v}from"../../shaderModules/Float4PassUniform.js";import{glsl as l}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as u}from"../../shaderModules/Texture2DPassUniform.js";function i(t){t.fragment.uniforms.add(new u("texWaveNormal",(e=>e.waveNormal)),new u("texWavePerturbation",(e=>e.wavePertubation)),new v("waveParams",(e=>r(f,e.waveStrength,e.waveTextureRepeat,e.flowStrength,e.flowOffset))),new s("waveDirection",(t=>e(c,t.waveDirection[0]*t.waveVelocity,t.waveDirection[1]*t.waveVelocity)))),t.include(o),t.fragment.code.add(l`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0);
|
|
6
6
|
vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) {
|
|
7
7
|
return 2.0 * texture(_tex, _uv).rg - 1.0;
|
|
8
8
|
}
|
|
@@ -51,4 +51,4 @@ float waveTextureRepeat = waveParams[1];
|
|
|
51
51
|
vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time);
|
|
52
52
|
float foam = normals2FoamIntensity(normal, waveParams[0]);
|
|
53
53
|
return vec4(normal, foam);
|
|
54
|
-
}`)}class n extends
|
|
54
|
+
}`)}class n extends m{}const f=a(),c=t();export{i as WaterDistortion,n as WaterDistortionPassParameters};
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{OverlayIndex as e}from"../../../../terrain/interfaces.js";import{BackgroundGrid as
|
|
5
|
+
import{OverlayIndex as e}from"../../../../terrain/interfaces.js";import{ReadShadowMapPassParameters as o}from"../shading/ReadShadowMap.glsl.js";import{BackgroundGrid as r}from"./BackgroundGrid.glsl.js";import{overlay as t}from"./Overlay.glsl.js";import{TileBlendInput as s}from"./TileBlendInput.js";import{FloatPassUniform as c}from"../../shaderModules/FloatPassUniform.js";import{glsl as a}from"../../shaderModules/interfaces.js";import{Texture2DPassUniform as n}from"../../shaderModules/Texture2DPassUniform.js";import{Uniform as d}from"../../shaderModules/Uniform.js";class i extends o{constructor(){super(...arguments),this.overlayOpacity=1}}function l(o,r){o.vertex.uniforms.add(new v("overlayTexOffset"),new v("overlayTexScale")),o.fragment.uniforms.add(new c("overlayOpacity",(e=>e.overlayOpacity)),new n("ovColorTex",((o,r)=>0===r.overlays.length?null:r.overlays[e.INNER].getColorTexture(o.overlaySource)))),t(o,r)}function u(e,o){const{vertex:t,fragment:c,varyings:n}=e;n.add("vtc","vec2"),t.uniforms.add(new v("texOffsetAndScale")),c.uniforms.add(new m("tex")),c.uniforms.add(new x("textureOpacities"));const d=o.textureFadingEnabled&&!o.renderOccluded;d&&(t.uniforms.add(new v("nextTexOffsetAndScale")),n.add("nvtc","vec2"),c.uniforms.add(new m("texNext")),c.uniforms.add(new x("nextTexOpacities")),c.uniforms.add(new f("fadeFactor")));const i=o.tileBlendInput===s.ColorComposite,l=o.tileBlendInput===s.GridComposite;l&&c.include(r),i&&c.uniforms.add(new x("backgroundColor")),t.code.add(a`
|
|
6
6
|
void forwardTextureCoordinatesWithTransform(in vec2 uv) {
|
|
7
7
|
vtc = uv * texOffsetAndScale.zw + texOffsetAndScale.xy;
|
|
8
|
-
${d?
|
|
9
|
-
}`),
|
|
8
|
+
${d?a`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:a``}
|
|
9
|
+
}`),c.code.add(a`
|
|
10
10
|
vec4 getColor(vec4 color, vec2 uv, vec3 opacities) {
|
|
11
|
-
${l||i?
|
|
11
|
+
${l||i?a`
|
|
12
12
|
if (opacities.y <= 0.0) {
|
|
13
13
|
return color * opacities.z * opacities.x;
|
|
14
14
|
}
|
|
15
|
-
vec4 bg = vec4(${i?
|
|
15
|
+
vec4 bg = vec4(${i?a`backgroundColor`:a`gridColor(uv)`} * opacities.y, opacities.y);
|
|
16
16
|
vec4 layer = color * opacities.z;
|
|
17
|
-
return (bg * (1.0 - layer.a) + layer) * opacities.x;`:
|
|
18
|
-
}`),d?
|
|
17
|
+
return (bg * (1.0 - layer.a) + layer) * opacities.x;`:a`return color;`}
|
|
18
|
+
}`),d?c.code.add(a`vec4 getTileColor() {
|
|
19
19
|
vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities);
|
|
20
20
|
if (fadeFactor >= 1.0) {
|
|
21
21
|
return color;
|
|
22
22
|
}
|
|
23
23
|
vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities);
|
|
24
24
|
return mix(nextColor, color, fadeFactor);
|
|
25
|
-
}`):
|
|
25
|
+
}`):c.code.add(a`vec4 getTileColor() {
|
|
26
26
|
return getColor(texture(tex, vtc), vtc, textureOpacities);
|
|
27
27
|
}`)}class f extends d{constructor(e){super(e,"float")}}class x extends d{constructor(e){super(e,"vec3")}}class v extends d{constructor(e){super(e,"vec4")}}class m extends d{constructor(e){super(e,"sampler2D")}}export{x as Float3Uniform,l as OverlayTerrain,i as OverlayTerrainPassParameters,u as TerrainTexture,m as Texture2DUniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Uniform as r}from"./Uniform.js";import{BindType as e}from"../shaderTechnique/BindType.js";class o extends r{constructor(r,o,s){super(r,"mat4",e.Draw,((e,s,t)=>e.setUniformMatrix4fv(r,o(s,t))),s)}}export{o as Matrix4sDrawUniform};
|
|
5
|
+
import{Uniform as r}from"./Uniform.js";import{BindType as e}from"../shaderTechnique/BindType.js";class o extends r{constructor(r,o,s){super(r,"mat4",e.Draw,((e,s,t,i)=>e.setUniformMatrix4fv(r,o(s,t,i))),s)}}export{o as Matrix4sDrawUniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{smoothstep as t,clamp as e}from"../../../../core/mathUtils.js";import{disposeMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{n as i,s as r,e as h}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{
|
|
5
|
+
import{smoothstep as t,clamp as e}from"../../../../core/mathUtils.js";import{disposeMaybe as s,releaseMaybe as a}from"../../../../core/maybe.js";import{n as i,s as r,e as h}from"../../../../chunks/vec3.js";import{c as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as c}from"../../../ViewingMode.js";import{ReadShadowMapDrawParameters as m}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{createQuadVAO as n}from"./glUtil3D.js";import{ShadowHighlightPassParameters as _,ShadowHighlightTechnique as p}from"../shaders/ShadowHighlightTechnique.js";import{vertexCount as d}from"../../../webgl/Util.js";const u=.001953125,l=4e4,g=5e4;class w{constructor(t,e){this._rctx=t,this._viewingMode=e,this._maxOpacity=1,this._passParameters=new _,this._drawParameters=new m,this._vao=n(this._rctx)}get _technique(){return null==this._techniqueCached&&(this._techniqueCached=new p({rctx:this._rctx,viewingMode:this._viewingMode})),this._techniqueCached}render(t,e){if(!t.shadowMap.enabled||!t.linearDepthTexture||!this.isVisible)return;const s=this._technique;this._drawParameters.origin=t.camera.center,this._rctx.bindFramebuffer(e),this._rctx.bindTechnique(s,this._passParameters,t).bindDraw(this._drawParameters,t,this._passParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(s.primitiveType,0,d(this._vao,"geometry"))}get gpuMemoryUsage(){return this._vao?.memoryEstimate??0}setDefaultOptions(t){this._passParameters={...this._passParameters,...t},this._updateMaxOpacity()}updateParameters(s,a){this._passParameters.opacityElevation=1-t(l,g,s.relativeElevation);const o=this._viewingMode===c.Global?i(y,s.center):r(y,0,0,1),m=h(o,a);this._passParameters.dayNightTerminator=t(0,1,e(30*m,0,1))}dispose(){this._vao=s(this._vao),this._techniqueCached=a(this._techniqueCached)}get isVisible(){const{opacityElevation:t,dayNightTerminator:e}=this._passParameters;return this._maxOpacity*t*e>=u}_updateMaxOpacity(){const t=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=t*this._passParameters.shadowColor[3]}}const y=o();export{w as ShadowHighlight};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{clamp as t,lerp as s,acosClamped as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{c as a}from"../../../../chunks/mat3f64.js";import{w as r,m as n,a as o,u as c}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as u,i as m,a as _,l,k as d,c as p,g as f,n as x,e as g,j as w}from"../../../../chunks/vec2.js";import{a as M}from"../../../../chunks/vec2f64.js";import{k as b,c as S,o as C,m as T,s as j}from"../../../../chunks/vec3.js";import{c as y}from"../../../../chunks/vec3f64.js";import{s as D,t as v}from"../../../../chunks/vec4.js";import{c as z}from"../../../../chunks/vec4f64.js";import{ViewingMode as E}from"../../../ViewingMode.js";import{CascadeCamera as O}from"./CascadeCamera.js";import{applyTextureResizeModulo as R}from"./textureUtils.js";import{assert as U,logWithBase as F,verify as N,rayRay2D as k}from"./Util.js";import{TextureType as A,ClearBufferBit as L,TextureWrapMode as H,TextureSamplingMode as Q,RenderbufferFormat as V}from"../../../webgl/enums.js";import{FramebufferObject as I}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as P}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as B}from"../../../webgl/Texture.js";import{TextureDescriptor as G}from"../../../webgl/TextureDescriptor.js";var X;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(X||(X={}));class q{constructor(){this.camera=new O,this.lightMat=h()}}class W{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class J{get depthTexture(){return this._fbo?.colorTexture}get textureSize(){return this._textureSize}get numCascades(){return this._numCascades}get cascadeDistances(){return D(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}constructor(t,s){this._rctx=t,this._viewingMode=s,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this._numCascades=1,this.settings=new W,this._projectionView=h(),this._projectionViewInverse=h(),this._modelViewLight=h(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=z(),this._cascades=[new q,new q,new q,new q],this._lastOrigin=null,this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1,this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._fbo=i(this._fbo),this._discardAllSnapshots()}set maxCascades(s){this.settings.maxNumCascadesHighQuality=t(Math.floor(s),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(t){this._enabled=t,t||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&null!=this.depthTexture}getSnapshot(t){return this.enabled?this._snapshots[t]:null}get cascades(){for(let t=0;t<this._numCascades;++t)rt[t]=this._cascades[t];return rt.length=this._numCascades,rt}start(t,s,e,i,a){U(this.enabled),this._textureSize=this._computeTextureSize(t,a,i),this._ensureDepthTexture();const{near:r,far:n}=this._clampNearFar(e);this._computeCascadeDistances(n,r,i),this._setupMatrices(t,s);const{viewMatrix:o,projectionMatrix:c}=t;for(let h=0;h<this._numCascades;++h)this._constructCascade(h,c,o,s);this._lastOrigin=null,this.clear()}finish(t){U(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t){if(!this._lastOrigin||!b(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||y(),S(this._lastOrigin,t);for(let
|
|
5
|
+
import has from"../../../../core/has.js";import{clamp as t,lerp as s,acosClamped as e}from"../../../../core/mathUtils.js";import{disposeMaybe as i}from"../../../../core/maybe.js";import{c as a}from"../../../../chunks/mat3f64.js";import{w as r,m as n,a as o,u as c}from"../../../../chunks/mat4.js";import{c as h}from"../../../../chunks/mat4f64.js";import{s as u,i as m,a as _,l,k as d,c as p,g as f,n as x,e as g,j as w}from"../../../../chunks/vec2.js";import{a as M}from"../../../../chunks/vec2f64.js";import{k as b,c as S,o as C,m as T,s as j}from"../../../../chunks/vec3.js";import{c as y}from"../../../../chunks/vec3f64.js";import{s as D,t as v}from"../../../../chunks/vec4.js";import{c as z}from"../../../../chunks/vec4f64.js";import{ViewingMode as E}from"../../../ViewingMode.js";import{CascadeCamera as O}from"./CascadeCamera.js";import{applyTextureResizeModulo as R}from"./textureUtils.js";import{assert as U,logWithBase as F,verify as N,rayRay2D as k}from"./Util.js";import{TextureType as A,ClearBufferBit as L,TextureWrapMode as H,TextureSamplingMode as Q,RenderbufferFormat as V}from"../../../webgl/enums.js";import{FramebufferObject as I}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as P}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as B}from"../../../webgl/Texture.js";import{TextureDescriptor as G}from"../../../webgl/TextureDescriptor.js";var X;!function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"}(X||(X={}));class q{constructor(){this.camera=new O,this.lightMat=h()}}class W{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}}class J{get depthTexture(){return this._fbo?.colorTexture}get textureSize(){return this._textureSize}get numCascades(){return this._numCascades}get cascadeDistances(){return D(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}constructor(t,s){this._rctx=t,this._viewingMode=s,this._enabled=!1,this._snapshots=new Array,this._textureSize=0,this._numCascades=1,this.settings=new W,this._projectionView=h(),this._projectionViewInverse=h(),this._modelViewLight=h(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=z(),this._cascades=[new q,new q,new q,new q],this._lastOrigin=null,this._maxTextureSize=Math.min(has("esri-mobile")?2048:8192,this._rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1,this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._fbo=i(this._fbo),this._discardAllSnapshots()}set maxCascades(s){this.settings.maxNumCascadesHighQuality=t(Math.floor(s),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(t){this._enabled=t,t||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&null!=this.depthTexture}getSnapshot(t){return this.enabled?this._snapshots[t]:null}get cascades(){for(let t=0;t<this._numCascades;++t)rt[t]=this._cascades[t];return rt.length=this._numCascades,rt}start(t,s,e,i,a){U(this.enabled),this._textureSize=this._computeTextureSize(t,a,i),this._ensureDepthTexture();const{near:r,far:n}=this._clampNearFar(e);this._computeCascadeDistances(n,r,i),this._setupMatrices(t,s);const{viewMatrix:o,projectionMatrix:c}=t;for(let h=0;h<this._numCascades;++h)this._constructCascade(h,c,o,s);this._lastOrigin=null,this.clear()}finish(t){U(this.enabled),this._rctx.bindFramebuffer(t)}getShadowMapMatrices(t,s){if(!this._lastOrigin||!b(t,this._lastOrigin)){this._lastOrigin=this._lastOrigin||y(),S(this._lastOrigin,t);for(let e=0;e<this._numCascades;++e){r(nt,this._cascades[e].lightMat,t),null!=s&&n(nt,nt,s);for(let t=0;t<16;++t)ot[16*e+t]=nt[t]}}return ot}takeCascadeSnapshotTo(t,s){U(this.enabled);const e=this._ensureSnapshot(s);this._bindFbo();const i=this._rctx,a=i.bindTexture(e,B.TEXTURE_UNIT_FOR_UPDATES);i.gl.copyTexSubImage2D(A.TEXTURE_2D,0,t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[0],t.camera.viewport[1],t.camera.viewport[2],t.camera.viewport[3]),i.bindTexture(a,B.TEXTURE_UNIT_FOR_UPDATES)}clear(){const t=this._rctx;this._bindFbo(),t.setClearColor(1,1,1,1),t.clearSafe(L.COLOR_BUFFER_BIT|L.DEPTH_BUFFER_BIT)}_computeTextureSize(t,s,e){const i=Math.min(window.devicePixelRatio,s)/t.pixelRatio,a=Math.max(t.fullWidth,t.fullHeight)*i,r=e?this.settings.textureSizeModHighQuality:this.settings.textureSizeModLowQuality;return Math.floor(Math.min(this._maxTextureSize,R((1===this.numCascades?1:2)*a*r)))}_ensureDepthTexture(){if(this._fbo?.width===this._textureSize)return;const t=new G(this._textureSize);t.wrapMode=H.CLAMP_TO_EDGE,t.samplingMode=Q.NEAREST,this._fbo?.dispose(),this._fbo=new I(this._rctx,t,new P(V.DEPTH_COMPONENT16,this._textureSize))}_ensureSnapshot(t){let s=this._snapshots[t];if(null!=s&&s.descriptor.width===this._textureSize)return s;this._discardSnapshot(t);const e=new G;return e.wrapMode=H.CLAMP_TO_EDGE,e.samplingMode=Q.NEAREST,e.width=this._textureSize,e.height=this._textureSize,s=new B(this._rctx,e),this._snapshots[t]=s,s}_discardSnapshot(t){this._snapshots[t]=i(this._snapshots[t])}_discardAllSnapshots(){for(let t=0;t<this._snapshots.length;++t)this._discardSnapshot(t);this._snapshots.length=0}_bindFbo(){const t=this._rctx;t.unbindTexture(this.depthTexture),t.bindFramebuffer(this._fbo)}_constructCascade(t,s,e,i){const a=this._cascades[t],o=-this._cascadeDistances[t],c=-this._cascadeDistances[t+1],h=(s[10]*o+s[14])/Math.abs(s[11]*o+s[15]),u=(s[10]*c+s[14])/Math.abs(s[11]*c+s[15]);U(h<u);for(let r=0;r<8;++r){D(Y,r%4==0||r%4==3?-1:1,r%4==0||r%4==1?-1:1,r<4?h:u,1);const t=Z[r];v(t,Y,this._projectionViewInverse),t[0]/=t[3],t[1]/=t[3],t[2]/=t[3]}C(at,Z[0]),a.camera.viewMatrix=r(K,this._modelViewLight,at);for(let r=0;r<8;++r)T(Z[r],Z[r],a.camera.viewMatrix);let m=Z[0][2],_=Z[0][2];for(let r=1;r<8;++r)m=Math.min(m,Z[r][2]),_=Math.max(_,Z[r][2]);m-=200,_+=200,a.camera.near=-_,a.camera.far=-m,jt(e,i,m,_,a.camera),n(a.lightMat,a.camera.projectionMatrix,a.camera.viewMatrix);const l=this._textureSize/(1===this.numCascades?1:2);a.camera.viewport=[t%2==0?0:l,0===Math.floor(t/2)?0:l,l,l]}_setupMatrices(t,s){n(this._projectionView,t.projectionMatrix,t.viewMatrix),o(this._projectionViewInverse,this._projectionView);const e=this._viewingMode===E.Global?t.eye:j(at,0,0,1);c(this._modelViewLight,[0,0,0],[-s[0],-s[1],-s[2]],e)}_clampNearFar(t){let{near:s,far:e}=t;return s<2&&(s=2),e<2&&(e=2),s>=e&&(s=2,e=4),{near:s,far:e}}_computeCascadeDistances(t,e,i){const a=i?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(F(t/e,4)),a);const r=(t-e)/this._numCascades,n=(t/e)**(1/this._numCascades);let o=e,c=e;for(let h=0;h<this._numCascades+1;++h)this._cascadeDistances[h]=s(o,c,this.settings.splitSchemeLambda),o*=n,c+=r}get gpuMemoryUsage(){return this._snapshots.reduce(((t,s)=>t+(s?.gpuMemoryUsage??0)),this._fbo?.gpuMemoryUsage??0)}get test(){return{cascades:this._cascades,textureSize:this._textureSize}}}const K=h(),Y=z(),Z=[];for(let yt=0;yt<8;++yt)Z.push(z());const $=M(),tt=M(),st=M(),et=M(),it=M(),at=y(),rt=[],nt=h(),ot=new Array(64),ct=M(),ht=M(),ut=[M(),M(),M(),M()],mt=M(),_t=M(),lt=M(),dt=M(),pt=M(),ft=M(),xt=M();function gt(t,s,e,i,a,r,n,o){u(ct,0,0);for(let u=0;u<4;++u)m(ct,ct,t[u]);_(ct,ct,.25),u(ht,0,0);for(let u=4;u<8;++u)m(ht,ht,t[u]);_(ht,ht,.25),l(ut[0],t[4],t[5],.5),l(ut[1],t[5],t[6],.5),l(ut[2],t[6],t[7],.5),l(ut[3],t[7],t[4],.5);let c=0,h=d(ut[0],ct);for(let u=1;u<4;++u){const t=d(ut[u],ct);t<h&&(h=t,c=u)}p(mt,ut[c],t[c+4]);const M=mt[0];let b,S;mt[0]=-mt[1],mt[1]=M,p(_t,ht,ct),f(_t,mt)<0&&x(mt,mt),l(mt,mt,_t,e),g(mt,mt),b=S=f(p(lt,t[0],ct),mt);for(let u=1;u<8;++u){const s=f(p(lt,t[u],ct),mt);s<b?b=s:s>S&&(S=s)}w(i,ct),_(lt,mt,b-s),m(i,i,lt);let C=-1,T=1,j=0,y=0;for(let u=0;u<8;++u){p(dt,t[u],i),g(dt,dt);const s=mt[0]*dt[1]-mt[1]*dt[0];s>0?s>C&&(C=s,j=u):s<T&&(T=s,y=u)}N(C>0,"leftArea"),N(T<0,"rightArea"),_(pt,mt,b),m(pt,pt,ct),_(ft,mt,S),m(ft,ft,ct),xt[0]=-mt[1],xt[1]=mt[0];const D=k(i,t[y],ft,m(lt,ft,xt),1,a),v=k(i,t[j],ft,lt,1,r),z=k(i,t[j],pt,m(lt,pt,xt),1,n),E=k(i,t[y],pt,lt,1,o);N(D,"rayRay"),N(v,"rayRay"),N(z,"rayRay"),N(E,"rayRay")}function wt(t,s){return 3*s+t}const Mt=M();function bt(t,s){return u(Mt,t[s],t[s+3]),Mt}const St=M(),Ct=a();function Tt(t,s,e,i,a){p(St,e,i),_(St,St,.5),Ct[0]=St[0],Ct[1]=St[1],Ct[2]=0,Ct[3]=St[1],Ct[4]=-St[0],Ct[5]=0,Ct[6]=St[0]*St[0]+St[1]*St[1],Ct[7]=St[0]*St[1]-St[1]*St[0],Ct[8]=1,Ct[wt(0,2)]=-f(bt(Ct,0),t),Ct[wt(1,2)]=-f(bt(Ct,1),t);let r=f(bt(Ct,0),e)+Ct[wt(0,2)],n=f(bt(Ct,1),e)+Ct[wt(1,2)],o=f(bt(Ct,0),i)+Ct[wt(0,2)],c=f(bt(Ct,1),i)+Ct[wt(1,2)];r=-(r+o)/(n+c),Ct[wt(0,0)]+=Ct[wt(1,0)]*r,Ct[wt(0,1)]+=Ct[wt(1,1)]*r,Ct[wt(0,2)]+=Ct[wt(1,2)]*r,r=1/(f(bt(Ct,0),e)+Ct[wt(0,2)]),n=1/(f(bt(Ct,1),e)+Ct[wt(1,2)]),Ct[wt(0,0)]*=r,Ct[wt(0,1)]*=r,Ct[wt(0,2)]*=r,Ct[wt(1,0)]*=n,Ct[wt(1,1)]*=n,Ct[wt(1,2)]*=n,Ct[wt(2,0)]=Ct[wt(1,0)],Ct[wt(2,1)]=Ct[wt(1,1)],Ct[wt(2,2)]=Ct[wt(1,2)],Ct[wt(1,2)]+=1,r=f(bt(Ct,1),s)+Ct[wt(1,2)],n=f(bt(Ct,2),s)+Ct[wt(2,2)],o=f(bt(Ct,1),e)+Ct[wt(1,2)],c=f(bt(Ct,2),e)+Ct[wt(2,2)],r=-.5*(r/n+o/c),Ct[wt(1,0)]+=Ct[wt(2,0)]*r,Ct[wt(1,1)]+=Ct[wt(2,1)]*r,Ct[wt(1,2)]+=Ct[wt(2,2)]*r,r=f(bt(Ct,1),s)+Ct[wt(1,2)],n=f(bt(Ct,2),s)+Ct[wt(2,2)],o=-n/r,Ct[wt(1,0)]*=o,Ct[wt(1,1)]*=o,Ct[wt(1,2)]*=o,a[0]=Ct[0],a[1]=Ct[1],a[2]=0,a[3]=Ct[2],a[4]=Ct[3],a[5]=Ct[4],a[6]=0,a[7]=Ct[5],a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=Ct[6],a[13]=Ct[7],a[14]=0,a[15]=Ct[8]}function jt(t,s,i,a,r){const n=1/Z[0][3],o=1/Z[4][3];U(n<o);let c=n+Math.sqrt(n*o);const h=Math.sin(e(t[2]*s[0]+t[6]*s[1]+t[10]*s[2]));c/=h,gt(Z,c,h,$,tt,st,et,it),Tt($,tt,et,it,r.projectionMatrix),r.projectionMatrix[10]=2/(i-a),r.projectionMatrix[14]=-(i+a)/(i-a)}export{J as ShadowMap,X as SnapshotSlot};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{f as o}from"../../../../chunks/vec3f64.js";import{ViewingMode as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{f as o,c as t}from"../../../../chunks/vec3f64.js";import{ViewingMode as i}from"../../../ViewingMode.js";import{ShaderOutput as r}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as s}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as n}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as a}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{ReloadableShaderModule as l}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{parameter as c}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{blendingDefault as u,oitBlending as d,oitDepthTest as h,OITPolygonOffset as m}from"../lib/OrderIndependentTransparency.js";import{Program as v}from"../lib/Program.js";import{stencilWriteMaskOn as y,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{TransparencyPassType as b}from"../lib/TransparencyPassType.js";import{VertexAttribute as g}from"../lib/VertexAttribute.js";import{DefaultTechniqueConfiguration as O}from"./DefaultTechniqueConfiguration.js";import{P}from"../../../../chunks/Path.glsl.js";import{makePipelineState as T,frontFaceCullingParams as j,defaultDepthWriteParams as S,defaultColorWriteParams as R}from"../../../webgl/renderState.js";const N=new Map([[g.POSITION,0],[g.PROFILERIGHT,1],[g.PROFILEUP,2],[g.PROFILEVERTEXANDNORMAL,3],[g.FEATUREVALUE,4]]);class C extends s{constructor(){super(...arguments),this.ambient=o(.2,.2,.2),this.diffuse=o(.8,.8,.8),this.specular=o(0,0,0),this.opacity=1,this.origin=t(),this.modelTransformation=null}}class E extends p{initializeConfiguration(e,o){o.spherical=e.viewingMode===i.Global,o.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new v(e.rctx,E.shader.get().build(this.configuration),N)}initializePipeline(){const e=this.configuration.transparencyPassType,o=this.configuration,t=e===b.NONE,i=e===b.FrontFace;return T({blending:o.output!==r.Color&&o.output!==r.Alpha||!o.transparent?null:t?u:d(e),culling:o.hasSlicePlane&&!o.transparent&&o.doubleSidedMode!==n.None?j:null,depthTest:{func:h(e)},depthWrite:t||i?S:null,colorWrite:R,stencilWrite:o.hasOccludees?y:null,stencilTest:o.hasOccludees?f:null,polygonOffset:t||i?null:m})}}E.shader=new l(P,(()=>import("../shaders/Path.glsl.js")));class M extends O{constructor(){super(...arguments),this.output=r.Color,this.doubleSidedMode=n.None,this.transparencyPassType=b.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}}e([c({count:r.COUNT})],M.prototype,"output",void 0),e([c({count:n.COUNT})],M.prototype,"doubleSidedMode",void 0),e([c({count:b.COUNT})],M.prototype,"transparencyPassType",void 0),e([c()],M.prototype,"spherical",void 0),e([c()],M.prototype,"receiveShadows",void 0),e([c()],M.prototype,"receiveAmbientOcclusion",void 0),e([c()],M.prototype,"vvSize",void 0),e([c()],M.prototype,"vvColor",void 0),e([c()],M.prototype,"vvOpacity",void 0),e([c()],M.prototype,"hasSlicePlane",void 0),e([c()],M.prototype,"transparent",void 0),e([c()],M.prototype,"hasOccludees",void 0),e([c()],M.prototype,"hasMultipassTerrain",void 0),e([c()],M.prototype,"cullAboveGround",void 0),e([c()],M.prototype,"doublePrecisionRequiresObfuscation",void 0),e([c({constValue:a.Disabled})],M.prototype,"pbrMode",void 0),e([c({constValue:!0})],M.prototype,"hasVvInstancing",void 0),e([c({constValue:!1})],M.prototype,"useCustomDTRExponentForWater",void 0),e([c({constValue:!1})],M.prototype,"useFillLights",void 0);export{C as PathPassParameters,E as PathTechnique,M as PathTechniqueConfiguration,N as vertexAttributeLocations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{
|
|
5
|
+
import has from"../../../../core/has.js";import{secondsFromMilliseconds as e}from"../../../../core/time.js";import{f as t}from"../../../../chunks/vec2f64.js";import{c as r}from"../../../../chunks/vec3f64.js";import{f as a}from"../../../../chunks/vec4f64.js";import{ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{AnimationTimer as s}from"../lib/AnimationTimer.js";import{MaterialParameters as n}from"../lib/Material.js";import{OITPolygonOffsetLimit as o}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as h}from"../lib/RenderSlot.js";import{DefaultBufferWriter as c}from"./DefaultBufferWriter.js";import{PositionUVLayoutObjectAndLayerId as m,PositionUVLayout as p}from"./DefaultLayouts.js";import{TriangleMaterial as l}from"./TriangleMaterial.js";import{WaterGLMaterial as u}from"./WaterGLMaterial.js";import{WaterTechniqueConfiguration as f}from"./WaterTechnique.js";class d extends l{constructor(e){super(e,new A),this._configuration=new f,this.animation=new s}getConfiguration(e,t){return this._configuration.output=e,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections,this._configuration.isDraped=this.parameters.isDraped,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<o,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}update(t){const r=Math.min(t.camera.relativeElevation,t.camera.distance);this.animation.enabled=Math.sqrt(this.parameters.waveTextureRepeat/this.parameters.waveStrength)*r<T;const a=this.animation.advance(t);return this.setParameters({timeElapsed:e(this.animation.time)*this.parameters.animationSpeed},!1),this.animation.enabled&&a}requiresSlot(e,t){switch(t){case i.Normal:return e===h.DRAPED_WATER;case i.Color:if(this.parameters.isDraped)return e===h.DRAPED_MATERIAL;break;case i.Alpha:break;case i.Highlight:case i.ObjectAndLayerIdColor:return e===h.OPAQUE_MATERIAL||e===h.DRAPED_MATERIAL;default:return!1}let r=h.OPAQUE_MATERIAL;return this.parameters.transparent&&(r=this.parameters.writeDepth?h.TRANSPARENT_MATERIAL:h.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===r}createGLMaterial(e){return new u(e)}createBufferWriter(){return new c(has("enable-feature:objectAndLayerId-rendering")?m:p)}}class A extends n{constructor(){super(...arguments),this.waveStrength=.06,this.waveTextureRepeat=32,this.waveDirection=t(1,0),this.waveVelocity=.05,this.flowStrength=.015,this.flowOffset=-.5,this.animationSpeed=.35,this.timeElapsed=0,this.color=a(0,0,0,0),this.transparent=!0,this.writeDepth=!0,this.hasSlicePlane=!1,this.isDraped=!1,this.receiveShadows=!0,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.origin=r(),this.modelTransformation=null}}const T=35e3;export{d as WaterMaterial,A as WaterMaterialParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{k as e}from"../../../../chunks/vec3.js";import{Z as l}from"../../../../chunks/vec3f64.js";function u({normalTexture:u,metallicRoughnessTexture:n,metallicFactor:r,roughnessFactor:s,emissiveTexture:o,emissiveFactor:t,occlusionTexture:c}){return null==u&&null==n&&null==o&&(null==t||e(t,l))&&null==c&&(null==s||1===s)&&(null==r||1===r||0===r)}export{u as useSchematicPBR};
|
|
5
|
+
import{k as e}from"../../../../chunks/vec3.js";import{Z as l}from"../../../../chunks/vec3f64.js";function u({normalTexture:u,metallicRoughnessTexture:n,metallicFactor:r,roughnessFactor:s,emissiveTexture:o,emissiveFactor:t,occlusionTexture:c}){return null==u&&null==n&&null==o&&(null==t||e(t,l))&&null==c&&(null==s||1===s)&&(null==r||1===r||0===r)}const n=[1,1,.5],r=[0,.6,.2],s=[0,1,.2];export{n as defaultAdvancedMRRFactors,s as defaultEsriSymbologyMRRFactors,r as defaultSchematicMRRFactors,u as useSchematicPBR};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as i}from"../lib/DefaultVertexAttributeLocations.js";import{Program as o}from"../lib/Program.js";import{a as t}from"../../../../chunks/AtmosphereCompositing.glsl.js";import{BlendFactor as s,CompareFunction as n}from"../../../webgl/enums.js";import{makePipelineState as m,separateBlendingParams as a,defaultColorWriteParams as l,simpleBlendingParams as h}from"../../../webgl/renderState.js";class p extends r{initializeProgram(e){return new o(e.rctx,p.shader.get().build(this.configuration),i)}initializePipeline(){return this.configuration.haze?m({blending:a(s.ONE,s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ONE),depthTest:{func:n.ALWAYS},colorWrite:l}):m({blending:h(s.
|
|
5
|
+
import{ReloadableShaderModule as e}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as i}from"../lib/DefaultVertexAttributeLocations.js";import{Program as o}from"../lib/Program.js";import{a as t}from"../../../../chunks/AtmosphereCompositing.glsl.js";import{BlendFactor as s,CompareFunction as n}from"../../../webgl/enums.js";import{makePipelineState as m,separateBlendingParams as a,defaultColorWriteParams as l,simpleBlendingParams as h}from"../../../webgl/renderState.js";class p extends r{initializeProgram(e){return new o(e.rctx,p.shader.get().build(this.configuration),i)}initializePipeline(){return this.configuration.haze?m({blending:a(s.ONE,s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ONE),depthTest:{func:n.ALWAYS},colorWrite:l}):m({blending:h(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),depthTest:{func:n.ALWAYS},colorWrite:l})}}p.shader=new e(t,(()=>import("./AtmosphereCompositing.glsl.js")));export{p as AtmosphereCompositingTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{g as e,f as t,c as i}from"../../../../chunks/vec3f64.js";import{f as r}from"../../../../chunks/vec4f64.js";import{ViewingMode as s}from"../../../ViewingMode.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as a}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as l}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as n,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as c}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as u}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as p}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as m,DepthTestFunction as d,AlphaDiscardMode as f}from"../lib/basicInterfaces.js";import{Default3D as b}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as g}from"../lib/Material.js";import{blendingDefault as S,oitBlending as T,oitDepthTest as y,getOITPolygonOffset as j}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as x,stencilToolMaskBaseParams as v,stencilBaseAllZerosParams as O}from"../lib/StencilUtils.js";import{TransparencyPassType as A}from"../lib/TransparencyPassType.js";import{defaultAdvancedMRRFactors as C}from"../materials/pbrUtils.js";import{D as L}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as M}from"../../../webgl/enums.js";import{makePipelineState as D,cullingParams as w,defaultDepthWriteParams as F,defaultColorWriteParams as _}from"../../../webgl/renderState.js";class k extends n{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(C),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=m.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=t(0,0,0),this.instancedDoublePrecision=!1,this.normalType=a.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.externalColor=r(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=i(),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=d.Less,this.textureAlphaMode=f.Blend,this.textureAlphaCutoff=c,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=g.Occlude}}class N extends h{constructor(){super(...arguments),this.origin=i(),this.slicePlaneLocalOrigin=this.origin}}class q extends p{initializeConfiguration(e,t){t.spherical=e.viewingMode===s.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?l.Default:l.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,q.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),b)}_convertDepthTestFunction(e){return e===d.Lequal?M.LEQUAL:M.LESS}_makePipeline(e,t){const i=this.configuration,r=e===A.NONE,s=e===A.FrontFace;return D({blending:i.output!==o.Color&&i.output!==o.Alpha||!i.transparent?null:r?S:T(e),culling:z(i)?w(i.cullFace):null,depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||s)&&i.writeDepth?F:null,colorWrite:_,stencilWrite:i.hasOccludees?x:null,stencilTest:i.hasOccludees?t?v:O:null,polygonOffset:r||s?null:j(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function z(e){return e.cullFace!==m.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}q.shader=new u(L,(()=>import("./DefaultMaterial.glsl.js")));export{N as DefaultMaterialDrawParameters,k as DefaultMaterialPassParameters,q as DefaultMaterialTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as
|
|
5
|
+
import{f as r}from"../../../../chunks/vec4f64.js";import{ReadShadowMapPassParameters as e}from"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as t}from"../core/shaderTechnique/ShaderTechnique.js";import{Default3D as o}from"../lib/DefaultVertexAttributeLocations.js";import{Program as s}from"../lib/Program.js";import{ShadowConfiguration as a}from"./ShadowConfiguration.js";import{S as h}from"../../../../chunks/ShadowHighlight.glsl.js";import{BlendFactor as n,PrimitiveType as l}from"../../../webgl/enums.js";import{makePipelineState as d,separateBlendingParams as m,defaultColorWriteParams as c}from"../../../webgl/renderState.js";class p extends e{constructor(){super(...arguments),this.shadowColor=r(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}}class u extends t{constructor(r){super(r,new a,(()=>this.destroy()))}initializeProgram(r){return new s(r.rctx,u.shader.get().build(this.configuration),o)}initializePipeline(){return d({blending:m(n.SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA),colorWrite:c,depthTest:null,depthWrite:null})}get primitiveType(){return l.TRIANGLE_STRIP}}u.shader=new i(h,(()=>import("./ShadowHighlight.glsl.js")));export{p as ShadowHighlightPassParameters,u as ShadowHighlightTechnique};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as l}from"../../core/maybe.js";import{createLength as n,zeroMeters as a,zeroSquareMeters as s}from"../../core/quantityUtils.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as h}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getConvertedElevation as m}from"../../support/elevationInfoUtils.js";import{createSquare as g,createRectangle as f,createCircle as v,createEllipse as _,createPolygon as w,createPolyline as O,createMultipoint as T}from"./support/createUtils.js";import{getDrawHelpMessage as G}from"./support/helpMessageUtils.js";import{createViewAlignedCoordinateSystem as x}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as V}from"../interactive/InteractiveToolBase.js";import S from"../interactive/sketch/SketchLabelOptions.js";import b from"../interactive/sketch/SketchTooltipOptions.js";import{DrawPointTooltipInfo as I,DrawPolylineTooltipInfo as j,DrawPolygonTooltipInfo as M,DrawMeshTooltipInfo as U,DrawRectangleTooltipInfo as C,DrawCircleTooltipInfo as z}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as k}from"../interactive/tooltip/Tooltip.js";import{autoAreaByElevationMode as P}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as A,autoHorizontalDistanceByElevationModeBetweenPoints as R}from"../support/automaticLengthMeasurementUtils.js";class D{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let E=class extends(o(i.EventedMixin(V))){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new S,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new b}initialize(){this.internalGraphicsLayer=new y({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation(),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),p((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new k({view:this.view,info:this._tooltipInfo}):l(this.tooltip)}),c),p((()=>this._tooltipInfo),(e=>{null!=this.tooltip&&(this.tooltip.info=e)}),c)]),this.finishToolCreation()}destroy(){this.drawOperation=l(this.drawOperation),this.tooltip=l(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=l(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return n(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),null!=this._graphic&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.handles.remove(Z.outline),this.handles.remove(Z.regularVertices),this.handles.remove(Z.activeVertex),this.handles.remove(L)}_createOrUpdateGraphic(e){if(null!=this._graphic)return this._updateGraphicGeometry(this._graphic,e),this._graphic;const i=this._graphic=new t({...this.graphicProperties,symbol:this.graphicSymbol});return this._updateGraphicGeometry(i,e),this.internalGraphicsLayer.add(i),this.handles.add(this.initializeGraphic(i)),this.notifyChange("graphic"),this.handles.add(r((()=>{this.internalGraphicsLayer.remove(i),l(i),this._graphic===i&&(this._graphic=null)})),L),i}_updateGraphicGeometry(e,t){e.geometry=t}_getCreateOperationGeometry(e={operationComplete:!1}){const{drawOperation:t}=this;if(null==t||0===t.numVertices)return null;const{coordinateHelper:i,view:o}=t,r=t.stagedVertex,l=t.committedVertices,n=l.slice(),a=null!=r;a&&n.push(i.pointToArray(r));const s=a?i.pointToArray(r):l.splice(-1)[0],p=n.length,c=o.spatialReference,h="3d"===o.type&&"global"===o.viewingMode,u=new D;switch(this.geometryType){case"point":case"mesh":u.regularVertices=l,u.activeVertex=s,u.full=i.arrayToPoint(n[0]);break;case"multipoint":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=T(n,c));break;case"polyline":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=O([n],c,h));break;case"polygon":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=w([n],c,h,!0));break;case"circle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.circle=v([e,i],t,!0),u.full=null!=u.circle?u.circle.geometry:null}else 2===p&&(this.forceUniformSize?(u.circle=v(n,t,this.centered),u.full=null!=u.circle?u.circle.geometry:null):(u.rectangle=_(n,t,this.centered),u.full=u.rectangle.geometry))}break;case"rectangle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.rectangle=g([e,i],t,!0),u.full=u.rectangle.geometry}else 2===p&&(u.rectangle=this.forceUniformSize?g(n,t,this.centered):f(n,t,this.centered),u.full=u.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":case"polygon":p>1&&(u.outline=O([n],c,h));break;case"circle":case"rectangle":null!=u.full&&"polygon"===u.full.type&&(u.outline=w(u.full.rings,c,h))}return u}initializeGraphic(e){return null}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});null!=e&&(t=this._createOrUpdateGraphic(e.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,null!=e?(null!=e.outline?this.handles.add(this.onOutlineChanged(e.outline),Z.outline):this.handles.remove(Z.outline),null!=e.regularVertices?this.handles.add(this.onRegularVerticesChanged(e.regularVertices),Z.regularVertices):this.handles.remove(Z.regularVertices),null!=e.activeVertex?this.handles.add(this.onActiveVertexChanged(e.activeVertex),Z.activeVertex):this.handles.remove(Z.activeVertex),null!=e.full?this._createOrUpdateGraphic(e.full):this.handles.remove(L)):this._destroyAllVisualisations()}get _tooltipInfo(){const{drawOperation:e}=this;if(!e)return null;switch(this.geometryType){case"point":return this._drawPointTooltipInfo;case"polyline":return this._drawPolylineTooltipInfo;case"polygon":return this._drawPolygonTooltipInfo;case"rectangle":return this._drawRectangleTooltipInfo;case"circle":return this._drawCircleTooltipInfo;case"mesh":return this._drawMeshTooltipInfo;default:return null}}get _drawPointTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"point"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new I({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("point",i,e)})}get _drawPolylineTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polyline"!==t?.type)return null;const i=A(t,this._elevationMode),{view:o}=this;return new j({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,totalLength:i??a,viewType:o.type,helpMessage:G("polyline",t,o)})}get _drawPolygonTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polygon"!==t?.type)return null;const i=P(t,this._elevationMode),{view:o}=this;return new M({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,area:i??s,viewType:o.type,helpMessage:G("polygon",t,o)})}get _drawMeshTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"mesh"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new U({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("mesh",i,e)})}get _drawRectangleTooltipInfo(){return null==this.drawOperation?null:new C({tooltipOptions:this.tooltipOptions,xSize:this._xSize??a,ySize:this._ySize??a,area:this._fullGeometryArea??s})}get _drawCircleTooltipInfo(){if(null==this.drawOperation)return null;const e=this.forceUniformSize;return new z({tooltipOptions:this.tooltipOptions,radius:e?this._circleRadius??a:null,xSize:e?null:this._xSize??a,ySize:e?null:this._ySize??a,area:this._fullGeometryArea??s})}get _circleRadius(){const e=this._createOperationGeometry;return null!=e&&null!=e.circle&&null!=e.circle.center&&null!=e.circle.edge?R(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.left,t.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry,t=null!=e?e.full:null;return"polygon"!==t?.type?null:P(t,this._elevationMode)}get _elevationTooltipDetail(){return{mode:this.drawOperation.elevationInfo.mode,...this._vertexTooltipElevation}}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:i}=this;if(null==i)return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(null==o||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},l=(m(t,o,i.elevationInfo,r)??0)*h(o.spatialReference);return n(l,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}};e([u()],E.prototype,"_createOperationGeometry",void 0),e([u()],E.prototype,"_defaultElevation",null),e([u({value:!0})],E.prototype,"centered",null),e([u({nonNullable:!0})],E.prototype,"defaultZ",void 0),e([u()],E.prototype,"drawOperation",void 0),e([u({value:!0})],E.prototype,"enabled",null),e([u({value:!0})],E.prototype,"forceUniformSize",null),e([u({constructOnly:!0})],E.prototype,"geometryType",void 0),e([u()],E.prototype,"graphic",null),e([u({constructOnly:!0})],E.prototype,"graphicProperties",void 0),e([u()],E.prototype,"graphicSymbol",null),e([u({constructOnly:!0})],E.prototype,"hasZ",void 0),e([u({constructOnly:!0,type:S})],E.prototype,"labelOptions",void 0),e([u({constructOnly:!0})],E.prototype,"geometryToPlace",void 0),e([u({constructOnly:!0})],E.prototype,"mode",void 0),e([u()],E.prototype,"snappingManager",void 0),e([u()],E.prototype,"snapToScene",void 0),e([u()],E.prototype,"tooltip",void 0),e([u({constructOnly:!0,type:b})],E.prototype,"tooltipOptions",void 0),e([u({readOnly:!0})],E.prototype,"type",void 0),e([u({readOnly:!0})],E.prototype,"updating",null),e([u({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),e([u()],E.prototype,"_tooltipInfo",null),e([u()],E.prototype,"_drawPointTooltipInfo",null),e([u()],E.prototype,"_drawPolylineTooltipInfo",null),e([u()],E.prototype,"_drawPolygonTooltipInfo",null),e([u()],E.prototype,"_drawMeshTooltipInfo",null),e([u()],E.prototype,"_drawRectangleTooltipInfo",null),e([u()],E.prototype,"_drawCircleTooltipInfo",null),e([u()],E.prototype,"_circleRadius",null),e([u()],E.prototype,"_xSize",null),e([u()],E.prototype,"_ySize",null),e([u()],E.prototype,"_fullGeometryArea",null),e([u()],E.prototype,"_elevationTooltipDetail",null),e([u()],E.prototype,"_vertexTooltipElevation",null),e([u()],E.prototype,"_elevationMode",null),E=e([d("esri.views.draw.DrawGraphicTool")],E);const L="create-operation-graphic",Z={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function H(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const N=48;export{D as CreateOperationGeometry,E as DrawGraphicTool,H as geometryTypeToDrawOperationGeometryType};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as l}from"../../core/maybe.js";import{createLength as n,zeroMeters as a,zeroSquareMeters as s}from"../../core/quantityUtils.js";import{watch as p,syncAndInitial as c}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as h}from"../../core/unitUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/GraphicsLayer.js";import{getConvertedElevation as m}from"../../support/elevationInfoUtils.js";import{createSquare as g,createRectangle as f,createCircle as v,createEllipse as _,createPolygon as w,createPolyline as O,createMultipoint as T}from"./support/createUtils.js";import{getDrawHelpMessage as G}from"./support/helpMessageUtils.js";import{createViewAlignedCoordinateSystem as x}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as V}from"../interactive/InteractiveToolBase.js";import b from"../interactive/sketch/SketchLabelOptions.js";import S from"../interactive/sketch/SketchTooltipOptions.js";import{DrawPointTooltipInfo as I,DrawPolylineTooltipInfo as j,DrawPolygonTooltipInfo as M,DrawMeshTooltipInfo as U,DrawRectangleTooltipInfo as C,DrawCircleTooltipInfo as z}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as k}from"../interactive/tooltip/Tooltip.js";import{autoAreaByElevationMode as P}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as A,autoHorizontalDistanceByElevationModeBetweenPoints as R}from"../support/automaticLengthMeasurementUtils.js";class D{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let E=class extends(o(i.EventedMixin(V))){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new b,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new S}initialize(){this.internalGraphicsLayer=new y({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation(),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),p((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new k({view:this.view,info:this._tooltipInfo}):l(this.tooltip)}),c),p((()=>this._tooltipInfo),(e=>{null!=this.tooltip&&(this.tooltip.info=e)}),c)]),this.finishToolCreation()}destroy(){this.drawOperation=l(this.drawOperation),this.tooltip=l(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=l(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return n(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),null!=this._graphic&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.handles.remove(Z.outline),this.handles.remove(Z.regularVertices),this.handles.remove(Z.activeVertex),this.handles.remove(L)}_createOrUpdateGraphic(e){if(null!=this._graphic)return this._updateGraphicGeometry(this._graphic,e),this._graphic;const i=this._graphic=new t({...this.graphicProperties,symbol:this.graphicSymbol});return this._updateGraphicGeometry(i,e),this.internalGraphicsLayer.add(i),this.handles.add(this.initializeGraphic(i)),this.notifyChange("graphic"),this.handles.add(r((()=>{this.internalGraphicsLayer.remove(i),l(i),this._graphic===i&&(this._graphic=null)})),L),i}_updateGraphicGeometry(e,t){e.geometry=t}_getCreateOperationGeometry(e={operationComplete:!1}){const{drawOperation:t}=this;if(null==t||0===t.numVertices)return null;const{coordinateHelper:i,view:o}=t,r=t.stagedVertex,l=t.committedVertices,n=l.slice(),a=null!=r;a&&n.push(i.pointToArray(r));const s=a?i.pointToArray(r):l.splice(-1)[0],p=n.length,c=o.spatialReference,h="3d"===o.type&&"global"===o.viewingMode,u=new D;switch(this.geometryType){case"point":case"mesh":u.regularVertices=l,u.activeVertex=s,u.full=i.arrayToPoint(n[0]);break;case"multipoint":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=T(n,c));break;case"polyline":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=O([n],c,h));break;case"polygon":u.regularVertices=l,u.activeVertex=s,p>0&&(u.full=w([n],c,h,!0));break;case"circle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.circle=v([e,i],t,!0),u.full=null!=u.circle?u.circle.geometry:null}else 2===p&&(this.forceUniformSize?(u.circle=v(n,t,this.centered),u.full=null!=u.circle?u.circle.geometry:null):(u.rectangle=_(n,t,this.centered),u.full=u.rectangle.geometry))}break;case"rectangle":if(p>0){const t=x(o,n[0]);if(1===p&&e.operationComplete){const e=n[0],i=t.makeMapPoint(e[0]+N*o.resolution,e[1]);u.rectangle=g([e,i],t,!0),u.full=u.rectangle.geometry}else 2===p&&(u.rectangle=this.forceUniformSize?g(n,t,this.centered):f(n,t,this.centered),u.full=u.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":u.outline=p>1?O([n],c,h):null;break;case"polygon":u.outline=p>1?w([n],c,h):null;break;case"circle":case"rectangle":u.outline="polygon"===u.full?.type?w(u.full.rings,c,h):null}return u}initializeGraphic(e){return null}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});null!=e&&(t=this._createOrUpdateGraphic(e.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,null!=e?(null!=e.outline?this.handles.add(this.onOutlineChanged(e.outline),Z.outline):this.handles.remove(Z.outline),null!=e.regularVertices?this.handles.add(this.onRegularVerticesChanged(e.regularVertices),Z.regularVertices):this.handles.remove(Z.regularVertices),null!=e.activeVertex?this.handles.add(this.onActiveVertexChanged(e.activeVertex),Z.activeVertex):this.handles.remove(Z.activeVertex),null!=e.full?this._createOrUpdateGraphic(e.full):this.handles.remove(L)):this._destroyAllVisualisations()}get _tooltipInfo(){const{drawOperation:e}=this;if(!e)return null;switch(this.geometryType){case"point":return this._drawPointTooltipInfo;case"polyline":return this._drawPolylineTooltipInfo;case"polygon":return this._drawPolygonTooltipInfo;case"rectangle":return this._drawRectangleTooltipInfo;case"circle":return this._drawCircleTooltipInfo;case"mesh":return this._drawMeshTooltipInfo;default:return null}}get _drawPointTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"point"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new I({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("point",i,e)})}get _drawPolylineTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polyline"!==t?.type)return null;const i=A(t,this._elevationMode),{view:o}=this;return new j({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,totalLength:i??a,viewType:o.type,helpMessage:G("polyline",t,o)})}get _drawPolygonTooltipInfo(){const e=this._createOperationGeometry,t=null!=e?e.full:null;if("polygon"!==t?.type)return null;const i=P(t,this._elevationMode),{view:o}=this;return new M({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,area:i??s,viewType:o.type,helpMessage:G("polygon",t,o)})}get _drawMeshTooltipInfo(){const{view:e,graphic:t}=this,i=t?.geometry;return"mesh"!==i?.type||"2d"===e.type&&0===this.defaultZ?null:new U({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,viewType:e.type,helpMessage:G("mesh",i,e)})}get _drawRectangleTooltipInfo(){return null==this.drawOperation?null:new C({tooltipOptions:this.tooltipOptions,xSize:this._xSize??a,ySize:this._ySize??a,area:this._fullGeometryArea??s})}get _drawCircleTooltipInfo(){if(null==this.drawOperation)return null;const e=this.forceUniformSize;return new z({tooltipOptions:this.tooltipOptions,radius:e?this._circleRadius??a:null,xSize:e?null:this._xSize??a,ySize:e?null:this._ySize??a,area:this._fullGeometryArea??s})}get _circleRadius(){const e=this._createOperationGeometry;return null!=e&&null!=e.circle&&null!=e.circle.center&&null!=e.circle.edge?R(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.left,t.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry;if(null==e?.rectangle)return null;const{midpoints:t}=e.rectangle;return null!=t?R(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry,t=null!=e?e.full:null;return"polygon"!==t?.type?null:P(t,this._elevationMode)}get _elevationTooltipDetail(){return{mode:this.drawOperation.elevationInfo.mode,...this._vertexTooltipElevation}}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:i}=this;if(null==i)return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(null==o||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},l=(m(t,o,i.elevationInfo,r)??0)*h(o.spatialReference);return n(l,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}};e([u()],E.prototype,"_createOperationGeometry",void 0),e([u()],E.prototype,"_defaultElevation",null),e([u({value:!0})],E.prototype,"centered",null),e([u({nonNullable:!0})],E.prototype,"defaultZ",void 0),e([u()],E.prototype,"drawOperation",void 0),e([u({value:!0})],E.prototype,"enabled",null),e([u({value:!0})],E.prototype,"forceUniformSize",null),e([u({constructOnly:!0})],E.prototype,"geometryType",void 0),e([u()],E.prototype,"graphic",null),e([u({constructOnly:!0})],E.prototype,"graphicProperties",void 0),e([u()],E.prototype,"graphicSymbol",null),e([u({constructOnly:!0})],E.prototype,"hasZ",void 0),e([u({constructOnly:!0,type:b})],E.prototype,"labelOptions",void 0),e([u({constructOnly:!0})],E.prototype,"geometryToPlace",void 0),e([u({constructOnly:!0})],E.prototype,"mode",void 0),e([u()],E.prototype,"snappingManager",void 0),e([u()],E.prototype,"snapToScene",void 0),e([u()],E.prototype,"tooltip",void 0),e([u({constructOnly:!0,type:S})],E.prototype,"tooltipOptions",void 0),e([u({readOnly:!0})],E.prototype,"type",void 0),e([u({readOnly:!0})],E.prototype,"updating",null),e([u({constructOnly:!0,nonNullable:!0})],E.prototype,"view",void 0),e([u()],E.prototype,"_tooltipInfo",null),e([u()],E.prototype,"_drawPointTooltipInfo",null),e([u()],E.prototype,"_drawPolylineTooltipInfo",null),e([u()],E.prototype,"_drawPolygonTooltipInfo",null),e([u()],E.prototype,"_drawMeshTooltipInfo",null),e([u()],E.prototype,"_drawRectangleTooltipInfo",null),e([u()],E.prototype,"_drawCircleTooltipInfo",null),e([u()],E.prototype,"_circleRadius",null),e([u()],E.prototype,"_xSize",null),e([u()],E.prototype,"_ySize",null),e([u()],E.prototype,"_fullGeometryArea",null),e([u()],E.prototype,"_elevationTooltipDetail",null),e([u()],E.prototype,"_vertexTooltipElevation",null),e([u()],E.prototype,"_elevationMode",null),E=e([d("esri.views.draw.DrawGraphicTool")],E);const L="create-operation-graphic",Z={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function H(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const N=48;export{D as CreateOperationGeometry,E as DrawGraphicTool,H as geometryTypeToDrawOperationGeometryType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.handles.removeAll()
|
|
5
|
+
import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.handles.removeAll(),this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.handles.add([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(e?.visible?e:null)))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&("inherited"===this.layer?.visibilityMode?i():"exclusive"===this.layer?.visibilityMode&&e())}};i([a({cast:r})],h.prototype,"layerViews",null),i([a({readOnly:!0})],h.prototype,"updatingProgress",null),i([a()],h.prototype,"view",void 0),h=i([y("esri.views.layers.GroupLayerView")],h);const n=h;export{n as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../Viewpoint.js";import{geographicToWebMercator as t}from"../geometry/support/webMercatorUtils.js";import{project as r}from"../rest/geometryService/project.js";import o from"../rest/support/ProjectParameters.js";async function n(t,r,o){const n=t?.viewpoint?.targetGeometry;if(n)return null;const s=await i(t,r,o);if(!s)return null;return new e({targetGeometry:s})}async function i(e,n,i){const s=e?.spatialReference,a=n?.extent;if(!s||!a)return null;if(s.isWGS84)return a.clone();if(s.isWebMercator)return t(a);const{getGeometryServiceURL:c}=await import("../portal/support/geometryServiceUtils.js");try{const e=await c(n),t=new o;t.geometries=[a],t.outSpatialReference=s;return(await r(e,t))[0]}catch(p){i.error("Error projecting item's extent:",p)}return null}export{n as computeInitialViewpoint};
|