@arcgis/core 4.33.0-next.20250317 → 4.33.0-next.20250318
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{23aa7254fffe67e3f1bc.js → e26e8feabf863350af20.js} +233 -147
- package/chunks/ShadowCastAccumulate.glsl.js +5 -21
- package/chunks/ShadowHighlight.glsl.js +8 -30
- package/core/has.js +1 -1
- package/geometry/support/densifyUtils.js +1 -1
- package/interfaces.d.ts +18 -0
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/2d/layers/graphics/densificationConstants.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +4 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +125 -40
- package/views/3d/webgl-engine/shaders/ReadShadowMapConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print/TemplateOptions.js +1 -1
|
@@ -2,28 +2,12 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{invert as e,translate as a}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as
|
|
6
|
-
|
|
7
|
-
if (
|
|
5
|
+
import{invert as e,translate as a}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{ScreenSpacePass as r}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadShadowMapPass as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{glsl as t}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as i}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ReadShadowMapConfiguration as n}from"../views/3d/webgl-engine/shaders/ReadShadowMapConfiguration.js";import{ShaderBuilder as l}from"../views/webgl/ShaderBuilder.js";const m=255,p=1/m;function w(){const o=new l,{fragment:n}=o;return o.include(r),o.include(s,u),n.uniforms.add(new i("shadowMap",(e=>e.shadowMap.depthTexture)),new i("depthMap",(e=>e.depth?.attachment)),new d("inverseViewMatrix",(o=>e(h,a(h,o.camera.viewMatrix,o.camera.center))))),n.constants.add("sampleValue","float",p),o.outputs.add("sampleCount","float"),n.main.add(t`sampleCount = 0.0;
|
|
6
|
+
vec3 uvzShadow = calculateShadowmapUVZFromDepthMap(uv, shadowMap, depthMap);
|
|
7
|
+
if (uvzShadow.z < 0.0) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0);
|
|
12
|
-
vec4 worldSpacePos = inverseViewMatrix * currentPixelPos;
|
|
13
|
-
mat4 shadowMatrix;
|
|
14
|
-
float linearDepth = -currentPixelDepth;
|
|
15
|
-
int i = chooseCascade(linearDepth, shadowMatrix);
|
|
16
|
-
if (i >= numCascades) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix);
|
|
20
|
-
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
ivec2 texSize = textureSize(shadowMap, 0);
|
|
24
|
-
ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize));
|
|
25
|
-
float depthShadow = readShadowMapDepth(uvShadow, shadowMap);
|
|
26
|
-
bool shadow = depthShadow < lvpos.z;
|
|
10
|
+
bool shadow = posIsInShadowF(uvzShadow, shadowMap);
|
|
27
11
|
if (shadow) {
|
|
28
12
|
sampleCount = sampleValue;
|
|
29
|
-
}`),
|
|
13
|
+
}`),o}const h=o(),u=new n,c=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:m,build:w},Symbol.toStringTag,{value:"Module"}));export{m as S,c as a,w as b};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{invert as e,translate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as
|
|
5
|
+
import{invert as e,translate as i}from"../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as r,t}from"./vec32.js";import{create as a}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{NormalFromDepth as l}from"../views/3d/webgl-engine/core/shaderLibrary/NormalFromDepth.glsl.js";import{ScreenSpacePass as h}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadShadowMapPass as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{RgbaFloatEncoding as n}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{Float3BindUniform as g}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float4PassUniform as d}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as w}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{UintTexture2DPassUniform as p}from"../views/3d/webgl-engine/core/shaderModules/UintTexture2DPassUniform.js";import{SnapshotSlot as f}from"../views/3d/webgl-engine/lib/ShadowMap.js";import{ReadShadowMapConfiguration as v}from"../views/3d/webgl-engine/shaders/ReadShadowMapConfiguration.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";const x=.025;function M(){const o=new b;o.include(s,j),o.include(h),o.include(l);const a=o.fragment;return a.include(n),a.uniforms.add(new u("shadowMapExcludingHighlight",(e=>e.shadowMap.getSnapshot(f.ExcludeHighlight))),new u("shadowMapHighlight",(e=>e.shadowMap.getSnapshot(f.Highlight))),new u("depthMap",(e=>e.depth?.attachment)),new p("highlightTexture",(e=>e.highlightTexture)),new d("uColor",(e=>e.shadowColor)),new c("opacity",(e=>e.shadowOpacity)),new c("occludedOpacity",(e=>e.occludedShadowOpacity)),new c("terminationFactor",(e=>e.opacityElevation*e.dayNightTerminator)),new g("lightingMainDirectionView",(({lighting:e,camera:i})=>r(y,t(y,e.mainLight.direction,i.viewInverseTransposeMatrix)))),new m("inverseViewMatrix",(({camera:o})=>e(S,i(S,o.viewMatrix,o.center))))),a.main.add(w`
|
|
6
6
|
ivec2 highlightTextureSize = textureSize(highlightTexture, 0);
|
|
7
7
|
ivec2 highlightIUV = ivec2(uv * vec2(highlightTextureSize));
|
|
8
8
|
uvec2 highlightInfo = texelFetch(highlightTexture, highlightIUV, 0).rg;
|
|
@@ -17,44 +17,22 @@ import{invert as e,translate as i}from"../core/libs/gl-matrix-2/math/mat4.js";im
|
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (
|
|
20
|
+
vec4 currentPixelPos;
|
|
21
|
+
vec3 uvzShadow = calculateShadowmapUVZFromDepthMap_curretPixelPos(uv, shadowMapHighlight, depthMap, currentPixelPos);
|
|
22
|
+
if (uvzShadow.z < 0.0) {
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0);
|
|
28
|
-
vec4 worldSpacePos = inverseViewMatrix * currentPixelPos;
|
|
29
|
-
|
|
30
|
-
mat4 shadowMatrix;
|
|
31
|
-
float linearDepth = -currentPixelDepth;
|
|
32
|
-
int i = chooseCascade(linearDepth, shadowMatrix);
|
|
33
|
-
if (i >= numCascades) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// vertex completely outside? -> no shadow
|
|
38
|
-
vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix);
|
|
39
|
-
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
ivec2 texSize = textureSize(highlightDepthTex, 0);
|
|
44
|
-
ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize));
|
|
45
|
-
|
|
46
|
-
float depthHighlight = readShadowMapDepth(uvShadow, highlightDepthTex);
|
|
47
|
-
bool shadowHighlight = depthHighlight < lvpos.z;
|
|
26
|
+
bool shadowHighlight = posIsInShadowF(uvzShadow, shadowMapHighlight);
|
|
48
27
|
if (!shadowHighlight) {
|
|
49
28
|
return;
|
|
50
29
|
}
|
|
51
30
|
|
|
52
|
-
|
|
53
|
-
bool shadowDefault = depthDefault < lvpos.z;
|
|
31
|
+
bool shadowDefault = posIsInShadowF(uvzShadow, shadowMapExcludingHighlight);
|
|
54
32
|
|
|
55
33
|
vec3 normal = normalFromDepth(depthMap, currentPixelPos.xyz, gl_FragCoord.xy, uv);
|
|
56
|
-
bool shaded = dot(normal, lightingMainDirectionView) < ${
|
|
34
|
+
bool shaded = dot(normal, lightingMainDirectionView) < ${w.float(x)};
|
|
57
35
|
|
|
58
36
|
float fragOpacity = (shadowDefault || shaded) ? occludedOpacity : opacity;
|
|
59
37
|
fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor);
|
|
60
|
-
`),
|
|
38
|
+
`),o}const S=o(),y=a(),j=new v,F=Object.freeze(Object.defineProperty({__proto__:null,build:M},Symbol.toStringTag,{value:"Module"}));export{F as S,M as b};
|
package/core/has.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
let e;function has(a){return"function"==typeof e[a]?e[a]=e[a](globalThis):e[a]}e=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},has.add=(a,d,i,o)=>{(o||void 0===e[a])&&(e[a]=d),i&&has(a)},has.cache=e,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",e),has.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),has.add("dom",e),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,i=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?i:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",i=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,i),has.add("ios",i)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",i),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in globalThis),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,a=!1===globalThis.crossOriginIsolated;return e&&!a})),has.add("wasm-simd",(()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))})),has.add("esri-atomics","Atomics"in globalThis),has.add("esri-workers","Worker"in globalThis),has.add("web-feat:cache","caches"in globalThis),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-fast-triangulation-enabled",!0),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-point-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",4),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-
|
|
5
|
+
let e;function has(a){return"function"==typeof e[a]?e[a]=e[a](globalThis):e[a]}e=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},has.add=(a,d,i,o)=>{(o||void 0===e[a])&&(e[a]=d),i&&has(a)},has.cache=e,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",e),has.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),has.add("dom",e),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,i=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?i:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",i=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,i),has.add("ios",i)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",i),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in globalThis),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,a=!1===globalThis.crossOriginIsolated;return e&&!a})),has.add("wasm-simd",(()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))})),has.add("esri-atomics","Atomics"in globalThis),has.add("esri-workers","Worker"in globalThis),has.add("web-feat:cache","caches"in globalThis),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-fast-triangulation-enabled",!0),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-point-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",4),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has("host-webworker")||has("host-browser")&&(has.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),has.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{has.add("esri-image-decode",!0,!0,!0)})).catch((()=>{has.add("esri-image-decode",!1,!0,!0)}))}return!1})),has.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})();export{has 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{set as
|
|
5
|
+
import{floatEqualAbsolute as t}from"../../core/mathUtils.js";import{set as s,determinant as n}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{squaredDistance as r}from"../../core/libs/gl-matrix-2/math/vec2.js";import{isCurvedGeometry as a,getCurves as e,getEndpoint as h,isBezierCurve as c,isCircularArc as o,isEllipticArc as u,isEllipticArc4 as p,isCoordinate as m}from"./curveUtils.js";const S={maxSegmentLength:1/0,maxDeviation:1/0,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1},l=1e-6,d=i(),E=[0,0];function f(t,s){return r(t,s)}function M(t,s,n){const i=f(s,n);if(0===i)return f(s,t);const r=(s[0]-t[0])*(n[1]-t[1])-(s[1]-t[1])*(n[0]-t[0]);return r*r/i}function _(t,s){const n=Math.atan2(t,s);return n<0?n+2*Math.PI:n}class g{constructor(t,s){this.curveStart=t,this.curveEnd=s,this.tStart=0,this.tEnd=0,this.tEndStack=[],this.arcEndStack=[]}get stackSize(){return this.tEndStack.length}initialize(t,s){this.tStart=0,this.arcStart=t,this.tEndStack.push(1),this.arcEndStack.push(s)}splitAt(t){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(t),this.arcEndStack.push(this.interpolate(t))}splitInHalf(){return this.splitAt((this.tStart+this.tEnd)/2)}pop(){this.tEnd=this.tEndStack.pop(),this.arcEnd=this.arcEndStack.pop()}next(){this.tStart=this.tEnd,this.arcStart=this.arcEnd}densify(t,{maxDeviation:s,maxSegmentLength:n,maxSegmentsPerCurve:i,minSegmentsPerCurve:r}){const a=n*n,e=s*s,h=1/i,c=this.interpolate(0),o=this.interpolate(1);f(this.curveStart,c)>l&&t.push(c),this.initialize(c,o);const u=1/r;for(let p=r-1;p>0;p--){const t=p*u;this.pop(),this.splitAt(t)}for(;this.stackSize>0;)this.pop(),this.tStart===this.tEnd||this.tEnd-this.tStart<h||(0===a||!isFinite(a)||f(this.arcStart,this.arcEnd)<a)&&(0===e||!isFinite(e)||this.getDeviation2()<e)?(t.push(this.arcEnd),this.next()):this.splitInHalf();return f(this.curveEnd,o)>l&&t.push([...this.curveEnd]),t}}function P(t,s,n,i,r){const a=1-r,e=a*a,h=r*r,c=e*a,o=3*r*e,u=3*h*a,p=h*r;return[t[0]*c+s[0]*o+n[0]*u+i[0]*p,t[1]*c+s[1]*o+n[1]*u+i[1]*p]}function v(t,s,n,i){return t[0]=s[0]*(1-i)+n[0]*i,t[1]=s[1]*(1-i)+n[1]*i,t}class x extends g{constructor(t,s){const[n,i,r]=s.b;super(t,n),this._controlPointsStack=[],this._curveControlPoints=[i,r],this._arcControlPoints=[i,r],this._controlPointsStack.push(this._arcControlPoints)}splitAt(t){const{arcStart:s,arcEnd:n,tStart:i,tEnd:r}=this,[a,e]=this._arcControlPoints,h=(t-i)/(r-i),c=v([],s,a,h),o=v(E,a,e,h),u=v([],e,n,h),p=v([],c,o,h),m=v([],o,u,h),S=v([],p,m,h);this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this._controlPointsStack.push([m,u]),this.tEndStack.push(t),this.arcEndStack.push(S),this._arcControlPoints[0]=c,this._arcControlPoints[1]=p,this._controlPointsStack.push(this._arcControlPoints)}pop(){super.pop(),this._arcControlPoints=this._controlPointsStack.pop()}interpolate(t){const{curveStart:s,curveEnd:n}=this,[i,r]=this._curveControlPoints;return P(s,i,r,n,t)}getDeviation2(){const{arcStart:t,arcEnd:s}=this,[n,i]=this._arcControlPoints;return Math.max(M(n,t,s),M(i,t,s))}}function k(t,s,n,i){return new x(s,n).densify(t,i)}function C(t,i,r,a){const[e,h]=i,[c,o]=r,[u,p]=a,m=e*e+h*h,S=c*c+o*o,l=u*u+p*p;s(d,e,c,u,h,o,p,1,1,1);const E=n(d);if(0===E)return null;s(d,m,S,l,h,o,p,1,1,1);const f=n(d);s(d,m,S,l,e,c,u,1,1,1);const M=f/E*.5,_=n(d)/E*-.5;return t[0]=M,t[1]=_,t}function b(t,s,n,i,r,a,e,h,{maxDeviation:c,maxSegmentLength:o,maxSegmentsPerCurve:u,minSegmentsPerCurve:p}){const m=2*a,S=[i+a*Math.cos(e),r+a*Math.sin(e)],d=[i+a*Math.cos(h),r+a*Math.sin(h)];f(s,S)>l&&t.push(S);const E=Math.abs(h-e),M=o<m?2*Math.asin(o/m):E,_=c<=a?2*Math.acos(1-c/a):E,g=Math.min(M,_),P=Math.min(u,Math.max(p,Math.ceil(Math.abs(E/g)))),v=1/P;for(let l=1;l<P;l++){const s=l*v,n=e*(1-s)+h*s;t.push([i+a*Math.cos(n),r+a*Math.sin(n)])}return t.push(d),f(n,d)>l&&t.push([...n]),t}function D(t,s,n,i){const[r,a]=n.c,e=C([],s,a,r);if(null==e)return t.push([...r]),t;const[h,c]=s,[o,u]=a,[p,m]=r,[S,l]=e,d=h-S,E=c-l,f=Math.sqrt(d*d+E*E),M=_(c-l,h-S),g=_(u-l,o-S);let P=_(m-l,p-S);return(g-M)*(P-g)<0&&(P+=2*Math.sign(M-P)*Math.PI),b(t,s,r,S,l,f,M,P,i)}function I(s,n,i){const[r,a,e,h]=i.a,c=Math.abs(s-n),o=c>Math.PI,u=c<Math.PI,p=t(c,Math.PI);return(!p&&(o&&e||u&&!e)||p&&(s>n&&h||s<n&&!h))&&(s+=2*(Math.sign(n-s)||1)*Math.PI),s}function R(t,s,n,i){const[r,a]=n.a,[e,h]=s,[c,o]=r,[u,p]=a,m=e-u,S=h-p,l=Math.sqrt(m*m+S*S),d=_(h-p,e-u);return b(t,s,r,u,p,l,d,I(_(o-p,c-u),d,n),i)}class L extends g{constructor(t,s){const[n,i,r,a,e,h,c]=s.a;super(t,n);const[o,u]=t,[p,m]=n,[S,l]=i,d=h*c,E=Math.cos(e),f=Math.sin(e),M=_(1/d*(u-l)*E-1/d*(o-S)*f,1/h*(u-l)*f+1/h*(o-S)*E),g=I(_(1/d*(m-l)*E-1/d*(p-S)*f,1/h*(m-l)*f+1/h*(p-S)*E),M,s);this._a=h,this._b=d,this._cosR=E,this._sinR=f,this._cx=S,this._cy=l,this._t1=M,this._t2=g}pop(){super.pop(),this._tMid=(this.tStart+this.tEnd)/2,this._arcMid=this.interpolate(this._tMid)}splitInHalf(){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(this._tMid),this.arcEndStack.push(this._arcMid)}interpolate(t){const{_a:s,_b:n,_cosR:i,_sinR:r,_cx:a,_cy:e,_t1:h,_t2:c}=this,o=h*(1-t)+c*t,u=Math.cos(o),p=Math.sin(o);return[s*u*i-n*p*r+a,s*u*r+n*p*i+e]}getDeviation2(){return M(this._arcMid,this.arcStart,this.arcEnd)}}function j(t,s,n,i){return new L(s,n).densify(t,i)}function y(t,s,n,i){return c(n)?k(t,s,n,i):o(n)?D(t,s,n,i):u(n)?p(n)?R(t,s,n,i):j(t,s,n,i):m(n)?(t.push([...n]),t):t}function z(t,s){if(!a(t))return t;const n=e(t),i=[];for(const r of n){const t=[];for(let n=0,i=1;i<r.length;n=i++){const a=h(r[n]);0===n&&t.push(a);y(t,a,r[i],{maxSegmentLength:s.maxSegmentLength??S.maxSegmentLength,maxDeviation:s.maxDeviation??S.maxDeviation,maxSegmentsPerCurve:s.maxSegmentsPerCurve??S.maxSegmentsPerCurve,minSegmentsPerCurve:Math.max(s.minSegmentsPerCurve??S.minSegmentsPerCurve,1)})}i.push(t)}return"curvePaths"in t?{paths:i,spatialReference:t.spatialReference}:{rings:i,spatialReference:t.spatialReference}}export{z as densifyCurvedGeometry};
|
package/interfaces.d.ts
CHANGED
|
@@ -132918,6 +132918,16 @@ declare namespace __esri {
|
|
|
132918
132918
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#positionFilterFunction Read more...}
|
|
132919
132919
|
*/
|
|
132920
132920
|
positionFilterFunction: Function | nullish;
|
|
132921
|
+
/**
|
|
132922
|
+
* Indicates whether the component will automatically rotate to the device heading based on
|
|
132923
|
+
* the Geolocation APIs [`GeolocationCoordinates.heading`](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates/heading)
|
|
132924
|
+
* property.
|
|
132925
|
+
*
|
|
132926
|
+
* @default true
|
|
132927
|
+
*
|
|
132928
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#rotationEnabled Read more...}
|
|
132929
|
+
*/
|
|
132930
|
+
rotationEnabled: boolean;
|
|
132921
132931
|
/**
|
|
132922
132932
|
* Indicates the scale to set on the view when navigating to the position of the geolocated
|
|
132923
132933
|
* result, after a location is returned from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#event-track track} event.
|
|
@@ -133039,6 +133049,14 @@ declare namespace __esri {
|
|
|
133039
133049
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#positionFilterFunction Read more...}
|
|
133040
133050
|
*/
|
|
133041
133051
|
positionFilterFunction?: Function | nullish;
|
|
133052
|
+
/**
|
|
133053
|
+
* Indicates whether the component will automatically rotate to the device heading based on
|
|
133054
|
+
* the Geolocation APIs [`GeolocationCoordinates.heading`](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates/heading)
|
|
133055
|
+
* property.
|
|
133056
|
+
*
|
|
133057
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#rotationEnabled Read more...}
|
|
133058
|
+
*/
|
|
133059
|
+
rotationEnabled?: boolean;
|
|
133042
133060
|
/**
|
|
133043
133061
|
* Indicates the scale to set on the view when navigating to the position of the geolocated
|
|
133044
133062
|
* result, after a location is returned from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Track-TrackViewModel.html#event-track track} event.
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const c="
|
|
5
|
+
const c="20250318",e="ef4c9f46abb255c3d3294d88be1c85d1e8676aa2";export{c as buildDate,e as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import has from"../../../../../../../core/has.js";import{location as i,uniform as o,UniformGroup as s,input as r}from"../../GraphShaderModule.js";import{ifElse as n,greaterThan as a,Float as
|
|
5
|
+
import{_ as t,a as e}from"../../../../../../../chunks/tslib.es6.js";import has from"../../../../../../../core/has.js";import{location as i,uniform as o,UniformGroup as s,input as r}from"../../GraphShaderModule.js";import{ifElse as n,greaterThan as a,Float as l,dot as d,min as p,length as m,mix as c,Vec2 as u,clamp as h,texture2D as y,step as g,Vec4 as v}from"../../graph/glsl.js";import{bitset as f}from"../line/gradientStrokeConstants.js";import{BaseHittestVertexInput as w}from"./AFeatureShader.js";import{LineVertexInput as b,LineFragmentInput as x,LineShader as S,getLineVertexData as j,getLineAntialiasing as L}from"./LineShader.js";import{MosaicInfo as A}from"./MosaicInfo.js";import{getBit as D,getBitBool as z,oneMinus as F}from"./utils.js";function C(t){return g(new l(0),t).multiply(2).subtract(1)}class G extends b{}t([i(9,l)],G.prototype,"accumulatedDistance",void 0),t([i(10,l)],G.prototype,"totalLength",void 0),t([i(11,l)],G.prototype,"gradientSize",void 0),t([i(12,u)],G.prototype,"segmentDirection",void 0),t([i(13,v)],G.prototype,"tlbr",void 0);class I extends x{}class P extends s{}t([o(l)],P.prototype,"isColorPass",void 0);class k extends S{constructor(){super(...arguments),this.type="GradientStrokeShader"}vertex(t,e){const{totalLength:i,gradientSize:o,segmentDirection:s,tlbr:r}=t,p=j(this,t),m=D(t.bitset,f.isAlongLine),c=i.divide(this.view.displayZoomFactor),u=n(z(t.bitset,f.isAbsoluteSize),(()=>{const t=n(a(m,new l(.5)),c,p.halfWidth);return o.divide(t)}),o),h=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(d(s,p.scaledOffset)).divide(c),y=r.divide(this.mosaicInfo.size.xyxy);return{...p,tlbr:y,relativePositionAlongLine:h,relativeGradientSize:u,isAlongLine:D(t.bitset,f.isAlongLine),isDiscrete:D(t.bitset,f.isDiscrete),...this.maybeRunHittest(t,e,p.halfWidth)}}fragment(t){const{isAlongLine:e,isDiscrete:i,relativePositionAlongLine:o,relativeGradientSize:s,normal:r,tlbr:d}=t,v=L(t,this.antialiasingControls.blur),f=C(r.y).multiply(p(m(r),new l(1))),w=new l(.5).multiply(f).add(new l(.5)),b=n(a(e,new l(.5)),o,w),x=n(a(i,new l(.5)),s.subtract(1),new l(0)),S=F(b.add(x).divide(s)),j=c(d.xy,d.zw,new u(h(S,new l(0),new l(1)),.5)),A=y(this.mosaicInfo.texture,j),D=t.opacity.multiply(v),z=this.getFragmentOutput(A.multiply(D),t),G=g(new l(.5),this.technique.isColorPass).multiply(has("gradient-depth-epsilon")),I=g(new l(0),r.y).multiply(new l(has("gradient-depth-bias")).subtract(G));return z.glFragDepth=h(m(r).add(I),new l(0),new l(1)),z}}t([o(A)],k.prototype,"mosaicInfo",void 0),t([o(P)],k.prototype,"technique",void 0),t([e(0,r(G)),e(1,r(w))],k.prototype,"vertex",null);export{I as GradientStrokeFragmentInput,k as GradientStrokeShader,G as GradientStrokeVertexInput};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{estimateAttributesMemory as t}from"../../../../core/memoryEstimations.js";import{empty as e,width as i,height as s}from"../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../geometry/support/boundsUtils.js";import{closeRingsAndFixWinding as o}from"../../../../geometry/support/coordsUtils.js";import{isCurvedGeometry as n}from"../../../../geometry/support/curveUtils.js";import{densifyCurvedGeometry as m}from"../../../../geometry/support/densifyUtils.js";import{isExtent as a}from"../../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridianForDisplay as h}from"../../../../geometry/support/normalizeUtilsSync.js";import{estimateGeometryMemory as
|
|
5
|
+
import{estimateAttributesMemory as t}from"../../../../core/memoryEstimations.js";import{empty as e,width as i,height as s}from"../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../geometry/support/boundsUtils.js";import{closeRingsAndFixWinding as o}from"../../../../geometry/support/coordsUtils.js";import{isCurvedGeometry as n}from"../../../../geometry/support/curveUtils.js";import{densifyCurvedGeometry as m}from"../../../../geometry/support/densifyUtils.js";import{isExtent as a}from"../../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridianForDisplay as h}from"../../../../geometry/support/normalizeUtilsSync.js";import{estimateGeometryMemory as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{checkProjectionSupport as y,project as c}from"../../../../layers/graphics/data/projectionSupport.js";import{getCoarseSegmentsPerCurve as p,getMinSegmentsPerCurve as l,getMaxDeviationInPixels as d,getApproximateMaxDensificationSegments as f}from"./densificationConstants.js";import{polygonFromExtent as g}from"./graphicsUtils.js";class v{static fromGraphic(t,e,i,s){return new v(t.geometry,e,t.attributes,t.visible,t.uid,t.version,i,s)}constructor(t,i,s,r,o,n,m,a){this.geometry=t,this.symbol=i,this.attributes=s,this.visible=r,this.objectId=o,this._version=n,this.zOrder=m,this.displayId=a,this.symbolBounds=e(),this.prevSymbolBounds=e(),this.size=[0,0,0,0],this.geometryBounds=e(),this._isDensificationDirty=!1,this._densificationDeviation=1/0}get projectedGeometry(){return this._projectedGeometry}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get usedMemory(){return 128+t(this.attributes)+u(this.geometry)}get hasAnimations(){const{linearCIM:t}=this;return!!t&&t.some((t=>"animationParams"in t&&!!t.animationParams))}get hasCurvedGeoemtry(){return null!=this.geometry&&"mesh"!==this.geometry.type&&n(this.geometry)}update(t,i,s){return(this._version!==t.version||this.zOrder!==s||this.symbol!==i)&&(this.prevSymbolBounds=this.symbolBounds,this.symbolBounds=e(),this.zOrder=s,this.geometry=t.geometry,this.attributes=t.attributes,this.symbol=i,this.visible=t.visible,this._version=t.version,this.symbolResource=null,this._projectedGeometry=null,e(this.geometryBounds),this._minDensificationDeviation=null,this._isDensificationDirty=!0,!0)}updateDensificationResolution(t){if(!this.hasCurvedGeoemtry)return!1;const e=Math.max(D(t),this._minDensificationDeviation??0);return e!==this._densificationDeviation&&(this._densificationDeviation=e,this._isDensificationDirty=!0,!0)}async projectAndNormalize(t){let e,o=this.geometry;if(o&&o.spatialReference&&"mesh"!==o.type&&("extent"===o.type&&(o=g(o)),e=n(o)?m(o,{maxSegmentLength:1/0,minSegmentsPerCurve:p()}):o.toJSON(),this._projectedGeometry=await j(e,o.spatialReference,t),r(this.geometryBounds,this._projectedGeometry),this.hasCurvedGeoemtry&&null!=this._projectedGeometry)){const t=i(this.geometryBounds),e=s(this.geometryBounds);this._minDensificationDeviation=b(t,e)}}async densifyCurvedGeometryForDisplay(t){if(!this.hasCurvedGeoemtry||!this._isDensificationDirty)return;this._isDensificationDirty=!1;const e=this.geometry;if(!e||!e.spatialReference||"mesh"===e.type)return;const i=t.metersPerUnit/e.spatialReference.metersPerUnit,s=this._densificationDeviation*i,r=m(e,{maxDeviation:s,minSegmentsPerCurve:l()});this._projectedGeometry=await j(r,e.spatialReference,t)}}async function j(t,e,i){await y(t.spatialReference,i);const s=h(t);if(!s)return;const r=c(s,e,i);return r&&o(r),a(r)?g(r):r}function D(t){return 2**Math.round(Math.log2(t))*d()}function b(t,e){if(t>0&&e>0){const i=Math.min(t,e)/2,s=2*Math.PI/f();return i*(1-Math.cos(s/2))}return null}export{v as GraphicStoreItem};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../../../core/has.js";function
|
|
5
|
+
import has from"../../../../core/has.js";function n(){return has("curve-densification-coarse-segments")}function e(){return has("curve-densification-max-segments")}function i(){return has("curve-densification-min-segments")}function t(){return has("curve-densification-pixel-deviation")}export{e as getApproximateMaxDensificationSegments,n as getCoarseSegmentsPerCurve,t as getMaxDeviationInPixels,i as getMinSegmentsPerCurve};
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ShaderOutput as t}from"../ShaderOutput.js";import{Rgba4FloatEncoding as a}from"../util/RgbaFloat16Encoding.glsl.js";import{glsl as
|
|
5
|
+
import{ShaderOutput as t}from"../ShaderOutput.js";import{Rgba4FloatEncoding as a}from"../util/RgbaFloat16Encoding.glsl.js";import{glsl as e}from"../../shaderModules/glsl.js";function o(o,d){switch(d.output){case t.Shadow:case t.ShadowHighlight:case t.ShadowExcludeHighlight:case t.ViewshedShadow:o.outputs.add("oFragDepth","vec4",0),o.fragment.include(a),o.fragment.code.add(e`float _calculateFragDepth(const in float depth) {
|
|
6
6
|
const float SLOPE_SCALE = 2.0;
|
|
7
7
|
const float BIAS = 20.0 * .000015259;
|
|
8
8
|
float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
|
|
9
9
|
return depth + SLOPE_SCALE * m + BIAS;
|
|
10
10
|
}
|
|
11
11
|
void outputDepth(float _linearDepth) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
float fragDepth = _calculateFragDepth(_linearDepth);
|
|
13
|
+
oFragDepth = floatToRgba4(fragDepth);
|
|
14
|
+
}`)}}export{o as OutputDepth};
|
|
@@ -2,43 +2,128 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{IDENTITY as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
float
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
ivec2
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
5
|
+
import{IDENTITY as a}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ReadDepth as o}from"../output/ReadDepth.glsl.js";import{CameraSpace as t}from"../util/CameraSpace.glsl.js";import{Rgba4FloatEncoding as s}from"../util/RgbaFloat16Encoding.glsl.js";import{Float4BindUniform as r}from"../../shaderModules/Float4BindUniform.js";import{glsl as i}from"../../shaderModules/glsl.js";import{IntegerBindUniform as d}from"../../shaderModules/IntegerBindUniform.js";import{Matrix4sDrawUniform as c}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as p}from"../../shaderModules/Matrix4sPassUniform.js";import{Texture2DBindUniform as h}from"../../shaderModules/Texture2DBindUniform.js";import{NoParameters as l}from"../../../../../webgl/NoParameters.js";class n extends l{constructor(){super(...arguments),this.origin=e()}}class v extends n{}class u extends l{constructor(){super(...arguments),this.modelTransformation=a}}class w extends u{constructor(){super(...arguments),this.origin=e()}}function m(a,e){e.receiveShadows&&(a.fragment.uniforms.add(new p("shadowMapMatrix",((a,e)=>e.shadowMap.getShadowMapMatrices(a.origin)),4)),M(a,e))}function x(a,e){e.receiveShadows&&(a.fragment.uniforms.add(new c("shadowMapMatrix",((a,e)=>e.shadowMap.getShadowMapMatrices(a.origin)),4)),M(a,e))}function M(a,e){const{fragment:c}=a;c.include(s);const{worldPositionFromDepthMap:p}=e;p&&(c.include(o),a.include(t)),c.uniforms.add(new h("shadowMap",(a=>a.shadowMap.depthTexture)),new d("numCascades",(a=>a.shadowMap.numCascades)),new r("cascadeDistances",(a=>a.shadowMap.cascadeDistances))),c.code.add(i`
|
|
6
|
+
// Private
|
|
7
|
+
|
|
8
|
+
int chooseCascade(float depth, out mat4 mat) {
|
|
9
|
+
// choose correct cascade
|
|
10
|
+
vec4 distance = cascadeDistances;
|
|
11
|
+
int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
|
|
12
|
+
|
|
13
|
+
mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
|
|
14
|
+
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
|
|
19
|
+
vec4 lv = mat * vec4(_vpos, 1.0);
|
|
20
|
+
lv.xy /= lv.w;
|
|
21
|
+
return 0.5 * lv.xyz + vec3(0.5);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
|
|
25
|
+
float xScale = float(textureSize.y) / float(textureSize.x);
|
|
26
|
+
return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
float readShadowMapDepth(ivec2 uv, sampler2D _shadowMap) {
|
|
30
|
+
return rgba4ToFloat(texelFetch(_shadowMap, uv, 0));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
float posIsInShadow(ivec2 uv, float lvposZ, sampler2D _shadowMap) {
|
|
34
|
+
return readShadowMapDepth(uv, _shadowMap) < lvposZ ? 1.0 : 0.0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
float filterShadow(vec3 uvzShadow, sampler2D _shadowMap) {
|
|
38
|
+
ivec2 texSize = textureSize(_shadowMap, 0);
|
|
39
|
+
vec2 uv = uvzShadow.xy;
|
|
40
|
+
vec2 st = fract(uv * vec2(texSize) + vec2(0.5));
|
|
41
|
+
ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5));
|
|
42
|
+
|
|
43
|
+
float s00 = posIsInShadow(ivec2(base.x, base.y ), uvzShadow.z, _shadowMap);
|
|
44
|
+
float s10 = posIsInShadow(ivec2(base.x + 1, base.y ), uvzShadow.z, _shadowMap);
|
|
45
|
+
float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), uvzShadow.z, _shadowMap);
|
|
46
|
+
float s01 = posIsInShadow(ivec2(base.x, base.y + 1), uvzShadow.z, _shadowMap);
|
|
47
|
+
|
|
48
|
+
return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Public
|
|
52
|
+
|
|
53
|
+
bool posIsInShadowF(vec3 uvzShadow, sampler2D _shadowMap) {
|
|
54
|
+
ivec2 texSize = textureSize(_shadowMap, 0);
|
|
55
|
+
ivec2 iuvShadow = ivec2(uvzShadow.xy * vec2(texSize));
|
|
56
|
+
|
|
57
|
+
float depthShadow = readShadowMapDepth(iuvShadow, _shadowMap);
|
|
58
|
+
return depthShadow < uvzShadow.z;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const vec3 invalidShadowmapUVZ = vec3(0.0,0.0,-1.0);
|
|
62
|
+
|
|
63
|
+
// Returns a uvzShadow: uv in shadowMap texture and z in lvpos
|
|
64
|
+
vec3 calculateShadowmapUVZ(
|
|
65
|
+
in vec3 _worldPos,
|
|
66
|
+
in float _linearDepth,
|
|
67
|
+
in sampler2D _shadowMap
|
|
68
|
+
)
|
|
69
|
+
{
|
|
70
|
+
mat4 shadowMatrix;
|
|
71
|
+
int i = chooseCascade(_linearDepth, shadowMatrix);
|
|
72
|
+
if (i >= numCascades) {
|
|
73
|
+
return invalidShadowmapUVZ;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
vec3 lvpos = lightSpacePosition(_worldPos, shadowMatrix);
|
|
77
|
+
|
|
78
|
+
// vertex completely outside? -> no shadow
|
|
79
|
+
if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) {
|
|
80
|
+
return invalidShadowmapUVZ;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// calc coord in cascade texture
|
|
84
|
+
ivec2 texSize = textureSize(_shadowMap, 0);
|
|
85
|
+
vec2 uvShadow = cascadeCoordinates(i, texSize, lvpos);
|
|
86
|
+
return vec3(uvShadow, lvpos.z);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
${p?i`
|
|
90
|
+
vec3 calculateShadowmapUVZFromDepthMap_curretPixelPos(
|
|
91
|
+
in vec2 _uv,
|
|
92
|
+
in sampler2D _shadowMap,
|
|
93
|
+
in sampler2D _depthMap,
|
|
94
|
+
out vec4 currentPixelPos
|
|
95
|
+
) {
|
|
96
|
+
// 1.0 is the clear value of depthMap, which means nothing has been drawn there and we should discard
|
|
97
|
+
float depth = depthFromTexture(_depthMap, _uv);
|
|
98
|
+
if (depth >= 1.0 || depth <= 0.0) {
|
|
99
|
+
return invalidShadowmapUVZ;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
float currentPixelDepth = linearizeDepth(depth);
|
|
103
|
+
currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0);
|
|
104
|
+
vec4 worldSpacePos = inverseViewMatrix * currentPixelPos;
|
|
105
|
+
|
|
106
|
+
float linearDepth = -currentPixelDepth;
|
|
107
|
+
|
|
108
|
+
return calculateShadowmapUVZ(worldSpacePos.xyz, linearDepth, _shadowMap);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
vec3 calculateShadowmapUVZFromDepthMap(
|
|
112
|
+
in vec2 _uv,
|
|
113
|
+
in sampler2D _shadowMap,
|
|
114
|
+
in sampler2D _depthMap
|
|
115
|
+
) {
|
|
116
|
+
vec4 currentPixelPos;
|
|
117
|
+
return calculateShadowmapUVZFromDepthMap_curretPixelPos(_uv, _shadowMap, _depthMap, currentPixelPos);
|
|
118
|
+
}
|
|
119
|
+
`:""}
|
|
120
|
+
|
|
121
|
+
float readShadowMap(const in vec3 _worldPos, float _linearDepth) {
|
|
122
|
+
vec3 uvzShadow = calculateShadowmapUVZ(_worldPos, _linearDepth, shadowMap);
|
|
123
|
+
if (uvzShadow.z < 0.0) {
|
|
124
|
+
return 0.0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return filterShadow(uvzShadow, shadowMap);
|
|
128
|
+
}
|
|
129
|
+
`)}export{x as ReadShadowMapDraw,v as ReadShadowMapDrawParameters,u as ReadShadowMapParameters,m as ReadShadowMapPass,w as ReadShadowMapPassParameters};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as e,parameter as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends e{constructor(){super(...arguments),this.receiveShadows=!0,this.worldPositionFromDepthMap=!0}}o([r()],s.prototype,"receiveShadows",void 0),o([r()],s.prototype,"worldPositionFromDepthMap",void 0);export{s as ReadShadowMapConfiguration};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Texture2DBindUniform.js";import"./ReadShadowMapConfiguration.js";import"../../../webgl/ShaderBuilder.js";export{S as ShadowCastMaxSamples,b as build}from"../../../../chunks/ShadowCastAccumulate.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Widget.js";import{css as a}from"./css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as n}from"../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as p}from"../support/jsxFactory.js";import{substitute as d}from"../../intl/substitute.js";const m=r.clone();let u=class extends s{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})}render(){const{flowItems:e}=this,t=e?.toArray();return l(p,null,t?.map(((
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{stripHTML as t}from"../../core/string.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import s from"../Widget.js";import{css as a}from"./css.js";import{zoomToFeature as r}from"../Popup/actions.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import"../support/widgetUtils.js";import{messageBundle as n}from"../support/decorators/messageBundle.js";import{tsx as l,tsxFragment as p}from"../support/jsxFactory.js";import{substitute as d}from"../../intl/substitute.js";const m=r.clone();let u=class extends s{constructor(e,t){super(e,t),this.flowItems=null,this.messages=null,this.closed=!1,this.closable=!0,this.selectLastFlowItem=!0,this._handleOpenFeature=e=>{this.emit("open-feature",{feature:e})},this._handleZoomToFeature=e=>{this.emit("zoom-to-feature",{featureWidget:e})}}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item")})}render(){const{flowItems:e}=this,t=e?.toArray();return l(p,null,t?.map(((e,i)=>this._renderFlowItem(e,this.selectLastFlowItem&&i===t.length-1))))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const{flowItems:e}=this,t=e?.pop();t&&("activeCategory"in t.viewModel?(t.viewModel.activeCategory=null,e?.length||(t.viewModel.showAllEnabled=!1)):"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t&&(t.viewModel=null,t.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e,i){const{messages:o,closable:s,closed:r}=this,c="graphic"in e&&!e.isTable,n="feature-association"===e.flowType,p=this._getExitMessage(e),d=o.selectFeature;return l("calcite-flow-item",{bind:this,closable:s,closed:r,description:t(this._getDrillInFlowItemDescription(e)??""),heading:t(e.title??""),key:`flow-item-${e.viewModel.uid}`,selected:i,onCalciteFlowItemBack:e=>{e.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},l("calcite-action",{appearance:"transparent",bind:this,class:a.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:p,title:p}),c?l("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,n?l("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},l("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,l("div",{class:a.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(m);return l("calcite-action",{active:m.active,appearance:"solid",bind:this,"data-action-uid":m.uid,disabled:m.disabled,icon:m.icon??"question",indicator:m.indicator,key:`action-${m.uid}`,loading:m.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return"zoom-to-feature"===i?d(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.allItemsDescription;case"feature-utility-network-association-type":return e.description??""}}};e([i()],u.prototype,"flowItems",void 0),e([i(),n("esri/widgets/Features/t9n/Features")],u.prototype,"messages",void 0),e([i()],u.prototype,"closed",void 0),e([i()],u.prototype,"closable",void 0),e([i()],u.prototype,"selectLastFlowItem",void 0),u=e([o("esri.widgets.Features.FeaturesDrillIn")],u);const h=u;export{h as default};
|