@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.
@@ -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 r}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as i}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{ReadShadowMapPass as t}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{CameraSpace as s}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{RgbaFloatEncoding as d}from"../views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as n}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as p}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{ReadShadowMapConfiguration as c}from"../views/3d/webgl-engine/shaders/ReadShadowMapConfiguration.js";import{ShaderBuilder as h}from"../views/webgl/ShaderBuilder.js";const m=255,w=1/m;function u(){const r=new h,c=r.fragment;return c.include(d),c.include(i),r.include(s),r.include(o),r.include(t,v),c.uniforms.add(new p("shadowMap",(e=>e.shadowMap.depthTexture)),new p("depthMap",(e=>e.depth?.attachment)),new n("inverseViewMatrix",(r=>e(g,a(g,r.camera.viewMatrix,r.camera.center))))),c.constants.add("sampleValue","float",w),r.outputs.add("sampleCount","float"),c.main.add(l`sampleCount = 0.0;
6
- float depth = depthFromTexture(depthMap, uv);
7
- if (depth >= 1.0 || depth <= 0.0) {
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
- float currentPixelDepth = linearizeDepth(depth);
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
- }`),r}const g=r(),v=new c,f=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:m,build:u},Symbol.toStringTag,{value:"Module"}));export{m as S,f as a,u as b};
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 t}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{n as o,t as r}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 d}from"../views/3d/webgl-engine/core/shaderModules/Float3BindUniform.js";import{Float4PassUniform as g}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 p}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{Matrix4BindUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Texture2DBindUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{UintTexture2DPassUniform as m}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 x}from"../views/webgl/ShaderBuilder.js";const b=.025;function M(){const t=new x;t.include(s,D),t.include(h),t.include(l);const a=t.fragment;return a.include(n),a.uniforms.add(new w("defaultDepthTex",(e=>e.shadowMap.getSnapshot(f.ExcludeHighlight))),new w("highlightDepthTex",(e=>e.shadowMap.getSnapshot(f.Highlight))),new w("depthMap",(e=>e.depth?.attachment)),new m("highlightTexture",(e=>e.highlightTexture)),new g("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 d("lightingMainDirectionView",(({lighting:e,camera:i})=>o(y,r(y,e.mainLight.direction,i.viewInverseTransposeMatrix)))),new u("inverseViewMatrix",(({camera:t})=>e(S,i(S,t.viewMatrix,t.center))))).main.add(p`
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
- // 1.0 is the clear value of depthMap, which means nothing has been drawn there and we should discard
21
- float depth = depthFromTexture(depthMap, uv);
22
- if (depth >= 1.0 || depth <= 0.0) {
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
- float currentPixelDepth = linearizeDepth(depth);
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
- float depthDefault = readShadowMapDepth(uvShadow, defaultDepthTex);
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) < ${p.float(b)};
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
- `),t}const S=t(),y=a(),D=new v,j=Object.freeze(Object.defineProperty({__proto__:null,build:M},Symbol.toStringTag,{value:"Module"}));export{j as S,M as b};
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-pixels-per-segment",16),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};
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 e,determinant as n}from"../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{squaredDistance as s}from"../../core/libs/gl-matrix-2/math/vec2.js";import{isCurvedGeometry as a,getCurves as o,getEndpoint as u,isBezierCurve as c,isCircularArc as h,isEllipticArc as m,isEllipticArc4 as i,isCoordinate as f}from"./curveUtils.js";const g={maxSegmentLength:1/0,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1},p=1e-6,M=r();function l(t,e){return s(t,e)}function P(t,e){const n=Math.atan2(t,e);return n<0?n+2*Math.PI:n}function x(t,e,n,{maxSegmentLength:r,maxSegmentsPerCurve:s,minSegmentsPerCurve:a},o){const u=r*r,c=1/s,h=o(0),m=o(1);l(e,h)>p&&t.push(h);const i=[1],f=[m],g=1/a;for(let p=a-1;p>0;p--){const t=p*g;i.push(t),f.push(o(t))}let M=0,P=h;for(;i.length>0;){const e=i.pop(),n=f.pop();if(l(P,n)<u||M===e||e-M<c)t.push(n),M=e,P=n;else{i.push(e),f.push(n);const t=(M+e)/2;i.push(t),f.push(o(t))}}return l(n,m)>p&&t.push([...n]),t}function S(t,e,n,r,s){const a=1-s,o=a*a,u=s*s,c=o*a,h=3*s*o,m=3*u*a,i=u*s;return[t[0]*c+e[0]*h+n[0]*m+r[0]*i,t[1]*c+e[1]*h+n[1]*m+r[1]*i]}function v(t,e,n,r){const[s,a,o]=n.b;return x(t,e,s,r,(t=>S(e,a,o,s,t)))}function C(t,r,s,a){const[o,u]=r,[c,h]=s,[m,i]=a,f=o*o+u*u,g=c*c+h*h,p=m*m+i*i;e(M,o,c,m,u,h,i,1,1,1);const l=n(M);if(0===l)return null;e(M,f,g,p,u,h,i,1,1,1);const P=n(M);e(M,f,g,p,o,c,m,1,1,1);const x=P/l*.5,S=n(M)/l*-.5;return t[0]=x,t[1]=S,t}function b(t,e,n,r,s,a,o,u,{maxSegmentLength:c,maxSegmentsPerCurve:h,minSegmentsPerCurve:m}){const i=2*a,f=[r+a*Math.cos(o),s+a*Math.sin(o)],g=[r+a*Math.cos(u),s+a*Math.sin(u)];l(e,f)>p&&t.push(f);const M=u-o,P=c<i?2*Math.asin(c/i):M,x=Math.min(h,Math.max(m,Math.ceil(Math.abs(M/P)))),S=1/x;for(let p=1;p<x;p++){const e=p*S,n=o*(1-e)+u*e;t.push([r+a*Math.cos(n),s+a*Math.sin(n)])}return t.push(g),l(n,g)>p&&t.push([...n]),t}function I(t,e,n,r){const[s,a]=n.c,o=C([],e,a,s);if(null==o)return t.push([...s]),t;const[u,c]=e,[h,m]=a,[i,f]=s,[g,p]=o,M=u-g,l=c-p,x=Math.sqrt(M*M+l*l),S=P(c-p,u-g),v=P(m-p,h-g);let I=P(f-p,i-g);return(v-S)*(I-v)<0&&(I+=2*Math.sign(S-I)*Math.PI),b(t,e,s,g,p,x,S,I,r)}function L(e,n,r){const[s,a,o,u]=r.a,c=Math.abs(e-n),h=c>Math.PI,m=c<Math.PI,i=t(c,Math.PI);return(!i&&(h&&o||m&&!o)||i&&(e>n&&u||e<n&&!u))&&(e+=2*(Math.sign(n-e)||1)*Math.PI),e}function j(t,e,n,r){const[s,a]=n.a,[o,u]=e,[c,h]=s,[m,i]=a,f=o-m,g=u-i,p=Math.sqrt(f*f+g*g),M=P(u-i,o-m);return b(t,e,s,m,i,p,M,L(P(h-i,c-m),M,n),r)}function R(t,e,n,r){const[s,a,o,u,c,h,m]=n.a,[i,f]=e,[g,p]=s,[M,l]=a,S=h*m,v=Math.cos(c),C=Math.sin(c),b=P(1/S*(f-l)*v-1/S*(i-M)*C,1/h*(f-l)*C+1/h*(i-M)*v),I=L(P(1/S*(p-l)*v-1/S*(g-M)*C,1/h*(p-l)*C+1/h*(g-M)*v),b,n);return x(t,e,s,r,(t=>{const e=b*(1-t)+I*t,n=Math.cos(e),r=Math.sin(e);return[h*n*v-S*r*C+M,h*n*C+S*r*v+l]}))}function q(t,e,n,r){return c(n)?v(t,e,n,r):h(n)?I(t,e,n,r):m(n)?i(n)?j(t,e,n,r):R(t,e,n,r):f(n)?(t.push([...n]),t):t}function U(t,e){if(!a(t))return t;const n=o(t),r=[];for(const s of n){const t=[];for(let n=0,r=1;r<s.length;n=r++){const a=u(s[n]);0===n&&t.push(a);q(t,a,s[r],{maxSegmentLength:e.maxSegmentLength??g.maxSegmentLength,maxSegmentsPerCurve:e.maxSegmentsPerCurve??g.maxSegmentsPerCurve,minSegmentsPerCurve:Math.max(e.minSegmentsPerCurve??g.minSegmentsPerCurve,1)})}r.push(t)}return"curvePaths"in t?{paths:r,spatialReference:t.spatialReference}:{rings:r,spatialReference:t.spatialReference}}export{U as densifyCurvedGeometry};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250317",
3
+ "version": "4.33.0-next.20250318",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -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="20250317",e="454c37fdaff0c4e315edd72b710c71449c26fe50";export{c as buildDate,e as commitHash};
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 d,dot as l,mix as p,Vec2 as m,clamp as c,texture2D as h,step as u,length as y,Vec4 as g}from"../../graph/glsl.js";import{bitset as v}from"../line/gradientStrokeConstants.js";import{BaseHittestVertexInput as f}from"./AFeatureShader.js";import{LineVertexInput as w,LineFragmentInput as b,LineShader as x,getLineVertexData as S,getLineAntialiasing as j}from"./LineShader.js";import{MosaicInfo as L}from"./MosaicInfo.js";import{getBit as A,getBitBool as D,oneMinus as z}from"./utils.js";class F extends w{}t([i(9,d)],F.prototype,"accumulatedDistance",void 0),t([i(10,d)],F.prototype,"totalLength",void 0),t([i(11,d)],F.prototype,"gradientSize",void 0),t([i(12,m)],F.prototype,"segmentDirection",void 0),t([i(13,g)],F.prototype,"tlbr",void 0);class C extends b{}class G extends s{}t([o(d)],G.prototype,"isColorPass",void 0);class I extends x{constructor(){super(...arguments),this.type="GradientStrokeShader"}vertex(t,e){const{totalLength:i,gradientSize:o,segmentDirection:s,tlbr:r}=t,p=S(this,t),m=A(t.bitset,v.isAlongLine),c=i.divide(this.view.displayZoomFactor),h=n(D(t.bitset,v.isAbsoluteSize),(()=>{const t=n(a(m,new d(.5)),c,p.halfWidth);return o.divide(t)}),o),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(l(s,p.scaledOffset)).divide(c),y=r.divide(this.mosaicInfo.size.xyxy);return{...p,tlbr:y,relativePositionAlongLine:u,relativeGradientSize:h,isAlongLine:A(t.bitset,v.isAlongLine),isDiscrete:A(t.bitset,v.isDiscrete),...this.maybeRunHittest(t,e,p.halfWidth)}}fragment(t){const{isAlongLine:e,isDiscrete:i,relativePositionAlongLine:o,relativeGradientSize:s,normal:r,tlbr:l}=t,g=j(t,this.antialiasingControls.blur),v=new d(.5).multiply(r.y).add(new d(.5)),f=n(a(e,new d(.5)),o,v),w=n(a(i,new d(.5)),s.subtract(1),new d(0)),b=z(f.add(w).divide(s)),x=p(l.xy,l.zw,new m(c(b,new d(0),new d(1)),.5)),S=h(this.mosaicInfo.texture,x),L=t.opacity.multiply(g),A=this.getFragmentOutput(S.multiply(L),t),D=u(new d(.5),this.technique.isColorPass).multiply(has("gradient-depth-epsilon")),F=u(new d(0),r.y).multiply(new d(has("gradient-depth-bias")).subtract(D));return A.glFragDepth=c(y(r).add(F),new d(0),new d(1)),A}}t([o(L)],I.prototype,"mosaicInfo",void 0),t([o(G)],I.prototype,"technique",void 0),t([e(0,r(F)),e(1,r(f))],I.prototype,"vertex",null);export{C as GradientStrokeFragmentInput,I as GradientStrokeShader,F as GradientStrokeVertexInput};
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 y}from"../../../../layers/graphics/dehydratedFeatures.js";import{checkProjectionSupport as u,project as p}from"../../../../layers/graphics/data/projectionSupport.js";import{getCoarseDensificationSegments as c,getApproximateMaxDensificationSegments as g,getMinDensificationSegments as l,getPixelsPerSegment as d}from"./densificationConstants.js";import{polygonFromExtent as f}from"./graphicsUtils.js";class j{static fromGraphic(t,e,i,s){return new j(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._densificationSegmentLength=1/0}get projectedGeometry(){return this._projectedGeometry}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get usedMemory(){return 128+t(this.attributes)+y(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._minDensificationSegmentLength=null,!0)}updateDensificationResolution(t){if(!this.hasCurvedGeoemtry)return!1;const e=Math.max(v(t),this._minDensificationSegmentLength??0);return e!==this._densificationSegmentLength&&(this._densificationSegmentLength=e,this._isDensificationDirty=!0,!0)}async projectAndNormalize(t){let e,o=this.geometry;if(o&&o.spatialReference&&"mesh"!==o.type&&("extent"===o.type&&(o=f(o)),e=n(o)?m(o,{maxSegmentLength:1/0,minSegmentsPerCurve:c()}):o.toJSON(),this._projectedGeometry=await b(e,o.spatialReference,t),r(this.geometryBounds,this._projectedGeometry),this.hasCurvedGeoemtry&&null!=this._projectedGeometry)){const t=i(this.geometryBounds),e=s(this.geometryBounds);(t||e)&&(this._minDensificationSegmentLength=Math.max(t,e)/g())}}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._densificationSegmentLength*i,r=m(e,{maxSegmentLength:s,minSegmentsPerCurve:l()});this._projectedGeometry=await b(r,e.spatialReference,t)}}async function b(t,e,i){await u(t.spatialReference,i);const s=h(t);if(!s)return;const r=p(s,e,i);return r&&o(r),a(r)?f(r):r}function v(t){return 2**Math.round(Math.log2(t))*d()}export{j as GraphicStoreItem};
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 e(){return has("curve-densification-coarse-segments")}function n(){return has("curve-densification-max-segments")}function i(){return has("curve-densification-min-segments")}function r(){return has("curve-densification-pixels-per-segment")}export{n as getApproximateMaxDensificationSegments,e as getCoarseDensificationSegments,i as getMinDensificationSegments,r as getPixelsPerSegment};
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 o}from"../../shaderModules/glsl.js";function e(e,l){switch(l.output){case t.Shadow:case t.ShadowHighlight:case t.ShadowExcludeHighlight:case t.ViewshedShadow:e.fragment.include(a),e.fragment.code.add(o`float _calculateFragDepth(const in float depth) {
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
- fragColor = floatToRgba4(_calculateFragDepth(_linearDepth));
13
- }`)}}export{e as OutputDepth};
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 e}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Rgba4FloatEncoding as a}from"../util/RgbaFloat16Encoding.glsl.js";import{Float4BindUniform as t}from"../../shaderModules/Float4BindUniform.js";import{glsl as o}from"../../shaderModules/glsl.js";import{IntegerBindUniform as i}from"../../shaderModules/IntegerBindUniform.js";import{Matrix4sDrawUniform as r}from"../../shaderModules/Matrix4sDrawUniform.js";import{Matrix4sPassUniform as d}from"../../shaderModules/Matrix4sPassUniform.js";import{Texture2DBindUniform as c}from"../../shaderModules/Texture2DBindUniform.js";import{NoParameters as p}from"../../../../../webgl/NoParameters.js";class n extends p{constructor(){super(...arguments),this.origin=s()}}class l extends n{}class v extends p{constructor(){super(...arguments),this.modelTransformation=e}}class h extends v{constructor(){super(...arguments),this.origin=s()}}function m(e,s){s.receiveShadows&&(e.fragment.uniforms.add(new d("shadowMapMatrix",((e,s)=>s.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function x(e,s){s.receiveShadows&&(e.fragment.uniforms.add(new r("shadowMapMatrix",((e,s)=>s.shadowMap.getShadowMapMatrices(e.origin)),4)),f(e))}function f(e){const s=e.fragment;s.include(a),s.uniforms.add(new c("shadowMap",(e=>e.shadowMap.depthTexture)),new i("numCascades",(e=>e.shadowMap.numCascades)),new t("cascadeDistances",(e=>e.shadowMap.cascadeDistances))).code.add(o`int chooseCascade(float depth, out mat4 mat) {
6
- vec4 distance = cascadeDistances;
7
- int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
8
- mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
9
- return i;
10
- }
11
- vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
12
- vec4 lv = mat * vec4(_vpos, 1.0);
13
- lv.xy /= lv.w;
14
- return 0.5 * lv.xyz + vec3(0.5);
15
- }
16
- vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) {
17
- float xScale = float(textureSize.y) / float(textureSize.x);
18
- return vec2((float(i) + lvpos.x) * xScale, lvpos.y);
19
- }
20
- float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) {
21
- return rgba4ToFloat(texelFetch(_depthTex, uv, 0));
22
- }
23
- float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) {
24
- return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
25
- }
26
- float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) {
27
- vec2 st = fract(uv * vec2(texSize) + vec2(0.5));
28
- ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5));
29
- float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex);
30
- float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex);
31
- float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex);
32
- float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex);
33
- return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
34
- }
35
- float readShadowMap(const in vec3 _vpos, float _linearDepth) {
36
- mat4 mat;
37
- int i = chooseCascade(_linearDepth, mat);
38
- if (i >= numCascades) { return 0.0; }
39
- vec3 lvpos = lightSpacePosition(_vpos, mat);
40
- if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
41
- ivec2 size = textureSize(shadowMap, 0);
42
- vec2 uv = cascadeCoordinates(i, size, lvpos);
43
- return filterShadow(uv, lvpos, size, shadowMap);
44
- }`)}export{x as ReadShadowMapDraw,l as ReadShadowMapDrawParameters,v as ReadShadowMapParameters,m as ReadShadowMapPass,h as ReadShadowMapPassParameters};
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 e}from"../../../../chunks/tslib.es6.js";import{ShaderTechniqueConfiguration as o,parameter as r}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";class s extends o{constructor(){super(...arguments),this.receiveShadows=!0}}e([r()],s.prototype,"receiveShadows",void 0);export{s as ReadShadowMapConfiguration};
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/output/ReadDepth.glsl.js";import"../core/shaderLibrary/shading/ReadShadowMap.glsl.js";import"../core/shaderLibrary/util/CameraSpace.glsl.js";import"../core/shaderLibrary/util/RgbaFloatEncoding.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";
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(((t,i)=>this._renderFlowItem(t,i===e.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),u=e([o("esri.widgets.Features.FeaturesDrillIn")],u);const h=u;export{h as default};
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};