@arcgis/core 4.33.0-next.20250403 → 4.33.0-next.20250404

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.
Files changed (73) hide show
  1. package/WebScene.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0669220e7acacd9c652a.js +1 -0
  4. package/assets/esri/core/workers/chunks/{30a047bd66f333bb7d2d.js → 1364744b15b327abd5a1.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{628395830c78b95b46dc.js → 290aed587aa647226b46.js} +1 -1
  6. package/assets/esri/core/workers/chunks/358a3a9326615d5e6d3b.js +1 -0
  7. package/assets/esri/core/workers/chunks/35ab75010817f1525e54.js +1 -0
  8. package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +1 -0
  9. package/assets/esri/core/workers/chunks/61737e442b1f8e86164e.js +1 -0
  10. package/assets/esri/core/workers/chunks/69e606267dc5842ebf9d.js +1 -0
  11. package/assets/esri/core/workers/chunks/7099564a8853b81ba181.js +1 -0
  12. package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +1 -0
  13. package/assets/esri/core/workers/chunks/b06e3ba73f353592c81d.js +1 -0
  14. package/assets/esri/core/workers/chunks/{5beb525b4adde1d98532.js → baab3f0bdf78b6165fd6.js} +84 -84
  15. package/assets/esri/core/workers/chunks/c20ec58c7bc7d5893049.js +1 -0
  16. package/assets/esri/core/workers/chunks/c2d0fc13f4b746318a38.js +1 -0
  17. package/assets/esri/core/workers/chunks/eaead9e927ebadcf2cc3.js +1 -0
  18. package/assets/esri/core/workers/chunks/ed517687b3728fd2eb64.js +1 -0
  19. package/geometry/support/HalfFloatArray.js +1 -1
  20. package/geometry/support/buffer/BufferView.js +1 -1
  21. package/geometry/support/float16.js +5 -0
  22. package/interfaces.d.ts +568 -5
  23. package/layers/BuildingSceneLayer.js +1 -1
  24. package/layers/ParquetLayer.d.ts +4 -0
  25. package/layers/SceneLayer.js +1 -1
  26. package/package.json +2 -2
  27. package/portal/schemas/definitions.js +1 -1
  28. package/support/revision.js +1 -1
  29. package/views/2d/engine/Stage.js +1 -1
  30. package/views/2d/engine/webgl/Painter.js +1 -1
  31. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  32. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  33. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  34. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  35. package/views/3d/webgl/formats.js +1 -1
  36. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  37. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +15 -15
  38. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +5 -5
  39. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  40. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  41. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  42. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  43. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  44. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  45. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  46. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  47. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  48. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  49. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  50. package/views/SceneView.js +1 -1
  51. package/views/layers/ParquetLayerView.d.ts +4 -0
  52. package/views/support/TextureCompressionWorker.js +1 -1
  53. package/views/webgl/FramebufferObject.js +1 -1
  54. package/views/webgl/Texture.js +1 -1
  55. package/views/webgl/Util.js +1 -1
  56. package/views/webgl/checkWebGLError.js +1 -1
  57. package/views/webgl/enums.js +1 -1
  58. package/views/webgl/textureUtils.js +1 -1
  59. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  60. package/widgets/support/UtilityNetworkAssociations/utils/getFeatureTitle.js +1 -1
  61. package/assets/esri/core/workers/chunks/1d322685016263f86cf5.js +0 -1
  62. package/assets/esri/core/workers/chunks/2219d970ece5676ca6ee.js +0 -1
  63. package/assets/esri/core/workers/chunks/401ff3c83789c72e9ac9.js +0 -1
  64. package/assets/esri/core/workers/chunks/555c95b149e3a82a4460.js +0 -1
  65. package/assets/esri/core/workers/chunks/6828e4936db0121a9638.js +0 -1
  66. package/assets/esri/core/workers/chunks/6b0a6469673417563616.js +0 -1
  67. package/assets/esri/core/workers/chunks/6e679703b5d6fc1b91a5.js +0 -1
  68. package/assets/esri/core/workers/chunks/6f3731f19497cbc6ea74.js +0 -1
  69. package/assets/esri/core/workers/chunks/7649d59b0b7d53818a29.js +0 -1
  70. package/assets/esri/core/workers/chunks/c977a47cabc419610277.js +0 -1
  71. package/assets/esri/core/workers/chunks/e8312c999b3f0c9ef09e.js +0 -1
  72. package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +0 -1
  73. package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +0 -1
@@ -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="20250403",f="378291f9d13234dc2483cf348050c8f6de4c332f";export{c as buildDate,f as commitHash};
5
+ const e="20250404",c="a268f9e6eb093d93047cef2720eb748d4de546c4";export{e as buildDate,c 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 e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,RenderbufferFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH_STENCIL,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
5
+ import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",(t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)}))),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,(()=>this._renderChildren(this.children,e)));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some((e=>e.hasHighlight))){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some((e=>e.hasLabels))){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH24_STENCIL8,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
@@ -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/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import h from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,FramebufferBit as w,CompareFunction as M,BlendFactor as P,RenderbufferFormat as C,BlendOperation as B,Face as N}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class F{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new h(t),this.textureUploadManager=new l(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new T(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new O(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(M.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||x(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(w.STENCIL)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||x(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const h=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,h,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new T(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new A(C.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new O(this.context,s,this._stencilBuf),effect0:new O(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),h=this._programCache.getProgram(s,o,r,i??{},n??{});return h.setUniforms(r),h.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),h.cleanupTemporaryTextures(),{vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,h=this._programCache.getProgram(i,{},n,a??{},o??{});if(h.setUniforms(n),h.bind(e),this.updatePipelineState(e),r)for(const l of r)s.bind(e,t.shader.locationInfo,l),s.draw(e);else for(let l=0;l<s.parts.length;l++)s.bind(e,t.shader.locationInfo,l),s.draw(e);s.unbind(e),h.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(P.ONE,P.ONE,P.ONE,P.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(N.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,r,i)}}}}}function x(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{F as default};
5
+ import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import h from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,FramebufferBit as w,CompareFunction as M,BlendFactor as P,SizedDepthStencilFormat as C,BlendOperation as B,Face as N}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class F{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new h(t),this.textureUploadManager=new l(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new T(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new O(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(M.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||x(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(w.STENCIL)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||x(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const h=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,h,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new T(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new A(C.DEPTH24_STENCIL8,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new O(this.context,s,this._stencilBuf),effect0:new O(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),h=this._programCache.getProgram(s,o,r,i??{},n??{});return h.setUniforms(r),h.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),h.cleanupTemporaryTextures(),{vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,h=this._programCache.getProgram(i,{},n,a??{},o??{});if(h.setUniforms(n),h.bind(e),this.updatePipelineState(e),r)for(const l of r)s.bind(e,t.shader.locationInfo,l),s.draw(e);else for(let l=0;l<s.parts.length;l++)s.bind(e,t.shader.locationInfo,l),s.draw(e);s.unbind(e),h.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(P.ONE,P.ONE,P.ONE,P.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(N.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,r,i)}}}}}function x(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{F 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{TextureWrapMode as r,RenderbufferFormat as e}from"../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as t}from"../../../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as o}from"../../../../../webgl/TextureDescriptor.js";function i(i,h,u){const l=new o(h,u);return l.wrapMode=r.CLAMP_TO_EDGE,new s(i,l,new t(e.STENCIL_INDEX8,h,u))}class h{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,s){this._width=e,this._height=s;const t=i(r,e,s),o=i(r,e,s);this._resources={sharedBlur1Fbo:t,sharedBlur2Fbo:o}}setup(r,e,s){!this._resources||this._width===e&&this._height===s||this.dispose(),this._resources||this._initialize(r,e,s)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}}export{h as default};
5
+ import{TextureWrapMode as r,SizedStencilFormat as e}from"../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as t}from"../../../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as o}from"../../../../../webgl/TextureDescriptor.js";function i(i,h,u){const l=new o(h,u);return l.wrapMode=r.CLAMP_TO_EDGE,new s(i,l,new t(e.STENCIL_INDEX8,h,u))}class h{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,s){this._width=e,this._height=s;const t=i(r,e,s),o=i(r,e,s);this._resources={sharedBlur1Fbo:t,sharedBlur2Fbo:o}}setup(r,e,s){!this._resources||this._width===e&&this._height===s||this.dispose(),this._resources||this._initialize(r,e,s)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}}export{h 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 t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,RenderbufferFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH_STENCIL,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
5
+ import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,SizedDepthStencilFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH24_STENCIL8,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
@@ -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 e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,RenderbufferFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH_STENCIL,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r),this._prevGradientHash=null}return this._prevGradientHash!==r&&(this._resolveGradientTexture.resize(t.length/4,1),this._resolveGradientTexture.setData(t),this._prevGradientHash=r),this._resolveGradientTexture}}export{f as HeatmapResources};
5
+ import e from"../../../../../../../core/Logger.js";import{disposeMaybe as r}from"../../../../../../../core/maybe.js";import{PixelType as t,TextureWrapMode as a,SizedDepthStencilFormat as i}from"../../../../../../webgl/enums.js";import{FramebufferObject as s}from"../../../../../../webgl/FramebufferObject.js";import{loadHeatmapTextureConfiguration as u}from"../../../../../../webgl/heatmapTextureUtils.js";import{RenderbufferDescriptor as l}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as o}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as n}from"../../../../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");class f{destroy(){this._accumulateFramebuffer=r(this._accumulateFramebuffer),this._resolveGradientTexture=r(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return null!=this._accumulateFramebuffer&&null!=this._resolveGradientTexture}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(null==this._qualityProfile){const r=u(e,m());this._qualityProfile={...r,defines:{usesHalfFloatPrecision:r.dataType!==t.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,r,t){if(null==this._accumulateFramebuffer){const{dataType:u,samplingMode:o,pixelFormat:m,internalFormat:f}=this.loadQualityProfile(e),h=new n(r,t);h.pixelFormat=m,h.internalFormat=f,h.dataType=u,h.samplingMode=o,h.wrapMode=a.CLAMP_TO_EDGE;const c=new l(i.DEPTH24_STENCIL8,r,t);this._accumulateFramebuffer=new s(e,h,c)}else{const{width:e,height:a}=this._accumulateFramebuffer;e===r&&a===t||this._accumulateFramebuffer.resize(r,t)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,r,t){if(null==this._resolveGradientTexture){const r=new n;r.wrapMode=a.CLAMP_TO_EDGE,this._resolveGradientTexture=new o(e,r),this._prevGradientHash=null}return this._prevGradientHash!==r&&(this._resolveGradientTexture.resize(t.length/4,1),this._resolveGradientTexture.setData(t),this._prevGradientHash=r),this._resolveGradientTexture}}export{f as HeatmapResources};
@@ -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{RenderbufferFormat as e}from"../../../webgl/enums.js";import{FramebufferObject as t}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach((e=>e.dispose())),this._fbos.clear()}_getPool(o){const i=this._fbos.get(o);if(i)return i;const f=new t(this._rctx,new s(o),new r(e.DEPTH24_STENCIL8,o));return this._fbos.set(o,f),f}}export{o as MultiSizeFramebuffer};
5
+ import{SizedDepthStencilFormat as e}from"../../../webgl/enums.js";import{FramebufferObject as t}from"../../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as r}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as s}from"../../../webgl/TextureDescriptor.js";class o{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach((e=>e.dispose())),this._fbos.clear()}_getPool(o){const i=this._fbos.get(o);if(i)return i;const f=new t(this._rctx,new s(o),new r(e.DEPTH24_STENCIL8,o));return this._fbos.set(o,f),f}}export{o as MultiSizeFramebuffer};
@@ -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{RenderbufferFormat as R}from"../../webgl/enums.js";var G;!function(R){R[R.R8=33321]="R8",R[R.R8UI=33330]="R8UI",R[R.RG8=33323]="RG8",R[R.RG8UI=33336]="RG8UI",R[R.RGBA4=32854]="RGBA4",R[R.RGBA8=32856]="RGBA8",R[R.RGBA8_MIPMAP=42843]="RGBA8_MIPMAP",R[R.R16F=33325]="R16F",R[R.RGBA16F=34842]="RGBA16F"}(G||(G={}));const A=R.DEPTH_COMPONENT16;export{G as ColorFormat,A as DepthRenderbuffer16f};
5
+ import{SizedDepthFormat as R}from"../../webgl/enums.js";var G;!function(R){R[R.R8=33321]="R8",R[R.R8UI=33330]="R8UI",R[R.RG8=33323]="RG8",R[R.RG8UI=33336]="RG8UI",R[R.RGBA4=32854]="RGBA4",R[R.RGBA8=32856]="RGBA8",R[R.RGBA8_MIPMAP=42843]="RGBA8_MIPMAP",R[R.R16F=33325]="R16F",R[R.RGBA16F=34842]="RGBA16F"}(G||(G={}));const A=R.DEPTH_COMPONENT16;export{G as ColorFormat,A as DepthRenderbuffer16f};
@@ -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 e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,DepthStencilAttachment as _,RenderbufferFormat as p,ColorAttachment0 as u}from"../../../webgl/enums.js";import{FramebufferObject as f}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as w}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as E}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as C}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";class A{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=T(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([u]),!h.fbo)throw new e("renderer","attempt to use a not existing framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new f(this.rctx,{...P[i],width:r,height:a}),(e=>{e??=_;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([u],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=T(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===_?new C(this.rctx,{...j[e],width:t,height:r}):new w(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=T(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new C(this.rctx,{...P[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const M=new n("default","default",null,(()=>M),(()=>M),(()=>{}));function T(e,t,r){return`${e}x${t}x${r}`}M.release=()=>!1;const R=new b;R.pixelFormat=h.RED,R.internalFormat=s.R8,R.wrapMode=m.CLAMP_TO_EDGE;const g=new b;g.pixelFormat=h.RED_INTEGER,g.internalFormat=s.R8UI,g.wrapMode=m.CLAMP_TO_EDGE,g.samplingMode=l.NEAREST;const F=new b;F.pixelFormat=h.RG,F.internalFormat=s.RG8,F.wrapMode=m.CLAMP_TO_EDGE;const x=new b;x.pixelFormat=h.RG_INTEGER,x.internalFormat=s.RG8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const D=new b;D.internalFormat=s.RGBA4,D.dataType=d.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.CLAMP_TO_EDGE;const G=new b;G.wrapMode=m.CLAMP_TO_EDGE;const O=new b;O.wrapMode=m.CLAMP_TO_EDGE,O.samplingMode=l.LINEAR_MIPMAP_LINEAR,O.hasMipmap=!0,O.maxAnisotropy=8;const N=new b;N.pixelFormat=h.RED,N.dataType=d.HALF_FLOAT,N.internalFormat=s.R16F,N.samplingMode=l.NEAREST;const y=new b;y.dataType=d.HALF_FLOAT,y.internalFormat=s.RGBA16F,y.samplingMode=l.NEAREST;const P={[t.R8]:R,[t.R8UI]:g,[t.RG8]:F,[t.RG8UI]:x,[t.RGBA4]:D,[t.RGBA8]:G,[t.RGBA8_MIPMAP]:O,[t.R16F]:N,[t.RGBA16F]:y},L=new b;L.pixelFormat=h.DEPTH_STENCIL,L.dataType=d.UNSIGNED_INT_24_8,L.samplingMode=l.NEAREST,L.wrapMode=m.CLAMP_TO_EDGE,L.internalFormat=h.DEPTH24_STENCIL8;const j={[_]:L,[r]:new E(p.DEPTH_COMPONENT16,4)};export{A as FBOCache,M as defaultWebGLFBO};
5
+ import e from"../../../../core/Error.js";import{ColorFormat as t,DepthRenderbuffer16f as r}from"../../webgl/formats.js";import{ManagedColorAttachment as a}from"../../webgl/ManagedColorAttachment.js";import{ManagedDepthAttachment as o}from"../../webgl/ManagedDepthAttachment.js";import n from"../../webgl/ManagedFBO.js";import{AttachmentType as i}from"../../webgl/ManagedFBOResource.js";import{FBOPool as c}from"./FBOPool.js";import{PixelFormat as h,SizedPixelFormat as s,TextureWrapMode as m,TextureSamplingMode as l,PixelType as d,UnsizedDepthFormat as _,SizedDepthStencilFormat as p,DepthStencilAttachment as u,SizedDepthFormat as f,ColorAttachment0 as w}from"../../../webgl/enums.js";import{FramebufferObject as E}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as C}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as b}from"../../../webgl/RenderbufferDescriptor.js";import{Texture as A}from"../../../webgl/Texture.js";import{TextureDescriptor as M}from"../../../webgl/TextureDescriptor.js";class T{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new c(e.newCache,"FBOCache"),this._depthCache=new c(e.newCache,"DepthAttachmentCache"),this._colorCache=new c(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frameStart(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame(),this.debugCallback?.()}frameEnd(){const e=this.debugCallback;e&&this._acquired.forEach((t=>t.type===i.FBO&&e(t.name,t.fbo,t.numberOfColorAttachments)))}get usedMemory(){return Array.from(this._acquired.values()).reduce(((e,t)=>e+("getTexture"in t?t.getTexture()?.usedMemory??0:t.cachedMemory)),this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(r,a,o,i=t.RGBA8){const c=g(i,r,a);let h=this._cache.pop(c);if(h){h.retain(),h.setName(o);const t=this.rctx.getBoundFramebufferObject();if(this.rctx.bindFramebuffer(h.fbo),this.rctx.setDrawBuffers([w]),!h.fbo)throw new e("renderer","attempt to use a not existing framebuffer");this.rctx.unbindTexture(h.fbo.colorTexture),this.rctx.bindFramebuffer(t)}else h=new n(c,o,new E(this.rctx,{...j[i],width:r,height:a}),(e=>{e??=u;const t=this._acquireDepth(e,h.fbo.width,h.fbo.height,`${h.name} depth`);return h.attachDepth(t),t.release(),h}),((e,o,n)=>{o??=t.RGBA8;const i=this._acquireColor(o,r,a,n??`${h.name} color ${e}`);return this.rctx.unbindTexture(i.attachment),h.attachColor(i,e),i.release(),h}),(()=>{this.debugCallback?.(h.name,h.fbo,h.numberOfColorAttachments),h.fbo?.invalidateAttachments([w],!0),this._acquired.delete(h),h.detachAll(),this._cache.put(h)}));return this._trackHandle(h)}acquireDepth(e,t,r,a){return this._acquireDepth(e,t,r,a)}_acquireDepth(e,t,r,a){const n=g(e,t,r),i=this._depthCache.pop(n);if(i)return i.retain(),i.name=a,this._trackHandle(i);const c=new o(n,e===u?new A(this.rctx,{...I[e],width:t,height:r}):new C(this.rctx,{...I[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._depthCache.put(c)}));return c.name=a,this._trackHandle(c)}_acquireColor(e,t,r,o){const n=g(e,t,r),i=this._colorCache.pop(n);if(i)return i.retain(),i.name=o,this._trackHandle(i);const c=new a(n,new A(this.rctx,{...j[e],width:t,height:r}),(()=>{this._acquired.delete(c),this._colorCache.put(c)}));return c.name=o,this._trackHandle(c)}_trackHandle(e){return this._acquired.add(e),e}}const R=new n("default","default",null,(()=>R),(()=>R),(()=>{}));function g(e,t,r){return`${e}x${t}x${r}`}R.release=()=>!1;const F=new M;F.pixelFormat=h.RED,F.internalFormat=s.R8,F.wrapMode=m.CLAMP_TO_EDGE;const x=new M;x.pixelFormat=h.RED_INTEGER,x.internalFormat=s.R8UI,x.wrapMode=m.CLAMP_TO_EDGE,x.samplingMode=l.NEAREST;const D=new M;D.pixelFormat=h.RG,D.internalFormat=s.RG8,D.wrapMode=m.CLAMP_TO_EDGE;const G=new M;G.pixelFormat=h.RG_INTEGER,G.internalFormat=s.RG8UI,G.wrapMode=m.CLAMP_TO_EDGE,G.samplingMode=l.NEAREST;const O=new M;O.internalFormat=s.RGBA4,O.dataType=d.UNSIGNED_SHORT_4_4_4_4,O.wrapMode=m.CLAMP_TO_EDGE;const N=new M;N.wrapMode=m.CLAMP_TO_EDGE;const y=new M;y.wrapMode=m.CLAMP_TO_EDGE,y.samplingMode=l.LINEAR_MIPMAP_LINEAR,y.hasMipmap=!0,y.maxAnisotropy=8;const P=new M;P.pixelFormat=h.RED,P.dataType=d.HALF_FLOAT,P.internalFormat=s.R16F,P.samplingMode=l.NEAREST;const L=new M;L.dataType=d.HALF_FLOAT,L.internalFormat=s.RGBA16F,L.samplingMode=l.NEAREST;const j={[t.R8]:F,[t.R8UI]:x,[t.RG8]:D,[t.RG8UI]:G,[t.RGBA4]:O,[t.RGBA8]:N,[t.RGBA8_MIPMAP]:y,[t.R16F]:P,[t.RGBA16F]:L},B=new M;B.pixelFormat=_.DEPTH_STENCIL,B.dataType=d.UNSIGNED_INT_24_8,B.samplingMode=l.NEAREST,B.wrapMode=m.CLAMP_TO_EDGE,B.internalFormat=p.DEPTH24_STENCIL8;const I={[u]:B,[r]:new b(f.DEPTH_COMPONENT16,4)};export{T as FBOCache,R as defaultWebGLFBO};
@@ -2,18 +2,18 @@
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{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as r}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const f=8;function n(e,p){e.attributes.add(s.POSITION,"vec3"),e.attributes.add(s.FEATUREVALUE,"vec3"),e.attributes.add(s.PROFILEVERTEXANDNORMAL,"vec4"),e.attributes.add(s.PROFILEAUXDATA,"vec3"),e.attributes.add(s.PROFILERIGHT,"vec2"),e.attributes.add(s.PROFILEUP,"vec2");const n=e.vertex;n.code.add(l`bool isCapVertex() {
5
+ import{fromValues as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2PassUniform as o}from"../../shaderModules/Float2PassUniform.js";import{Float3PassUniform as a}from"../../shaderModules/Float3PassUniform.js";import{Float4PassUniform as i}from"../../shaderModules/Float4PassUniform.js";import{Float4sPassUniform as r}from"../../shaderModules/Float4sPassUniform.js";import{FloatPassUniform as t}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../shaderModules/FloatsPassUniform.js";import{glsl as l}from"../../shaderModules/glsl.js";import{VertexAttribute as s}from"../../../lib/VertexAttribute.js";import{vvColorNumber as c,VisualVariablePassParameters as p}from"../../../materials/VisualVariablePassParameters.js";const n=8;function f(e,p){const{attributes:f,vertex:d}=e;f.add(s.POSITION,"vec3"),f.add(s.PROFILEVERTEXANDNORMAL,"vec4"),f.add(s.PROFILEAUXDATA,"vec3"),f.add(s.PROFILERIGHT,"vec2"),f.add(s.PROFILEUP,"vec2"),d.code.add(l`bool isCapVertex() {
6
6
  return profileAuxData.z == 1.0;
7
- }`),n.uniforms.add(new o("size",(e=>e.size))),p.vvSize?(n.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),n.code.add(l`vec2 getSize() {
8
- float value = featureValue.x;
7
+ }`),d.uniforms.add(new o("size",(e=>e.size)));const{vvSize:u,vvColor:m,vvOpacity:x}=p;u?(f.add(s.SIZEFEATUREATTRIBUTE,"float"),d.uniforms.add(new a("vvSizeMinSize",(e=>e.vvSize.minSize)),new a("vvSizeMaxSize",(e=>e.vvSize.maxSize)),new a("vvSizeOffset",(e=>e.vvSize.offset)),new a("vvSizeFactor",(e=>e.vvSize.factor)),new a("vvSizeFallback",(e=>e.vvSize.fallback))),d.code.add(l`vec2 getSize() {
8
+ float value = sizeFeatureAttribute;
9
9
  if (isnan(value)) {
10
10
  return vvSizeFallback.xz;
11
11
  }
12
12
  return size * clamp(vvSizeOffset + value * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz;
13
- }`)):n.code.add(l`vec2 getSize(){
13
+ }`)):d.code.add(l`vec2 getSize(){
14
14
  return size;
15
- }`),p.vvOpacity?(n.constants.add("vvOpacityNumber","int",f),n.uniforms.add(new v("vvOpacityValues",(e=>e.vvOpacity.values),f),new v("vvOpacityOpacities",(e=>e.vvOpacity.opacityValues),f),new t("vvOpacityFallback",(e=>e.vvOpacity.fallback))),n.code.add(l`vec4 applyOpacity(vec4 color) {
16
- float value = featureValue.z;
15
+ }`),x?(f.add(s.OPACITYFEATUREATTRIBUTE,"float"),d.constants.add("vvOpacityNumber","int",n),d.uniforms.add(new v("vvOpacityValues",(e=>e.vvOpacity.values),n),new v("vvOpacityOpacities",(e=>e.vvOpacity.opacityValues),n),new t("vvOpacityFallback",(e=>e.vvOpacity.fallback))),d.code.add(l`vec4 applyOpacity(vec4 color) {
16
+ float value = opacityFeatureAttribute;
17
17
  if (isnan(value)) {
18
18
  return vec4(color.rgb, vvOpacityFallback);
19
19
  }
@@ -27,10 +27,10 @@ return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f));
27
27
  }
28
28
  }
29
29
  return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]);
30
- }`)):n.code.add(l`vec4 applyOpacity(vec4 color){
30
+ }`)):d.code.add(l`vec4 applyOpacity(vec4 color){
31
31
  return color;
32
- }`),p.vvColor?(n.constants.add("vvColorNumber","int",c),n.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new r("vvColorColors",(e=>e.vvColor.colors),c),new i("vvColorFallback",(e=>e.vvColor.fallback))),n.code.add(l`vec4 getColor() {
33
- float value = featureValue.y;
32
+ }`),m?(f.add(s.COLORFEATUREATTRIBUTE,"float"),d.constants.add("vvColorNumber","int",c),d.uniforms.add(new v("vvColorValues",(e=>e.vvColor.values),c),new r("vvColorColors",(e=>e.vvColor.colors),c),new i("vvColorFallback",(e=>e.vvColor.fallback))),d.code.add(l`vec4 getColor() {
33
+ float value = colorFeatureAttribute;
34
34
  if (isnan(value)) {
35
35
  return applyOpacity(vvColorFallback);
36
36
  }
@@ -44,9 +44,9 @@ return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f));
44
44
  }
45
45
  }
46
46
  return applyOpacity(vvColorColors[vvColorNumber - 1]);
47
- }`)):n.code.add(l`vec4 getColor(){
47
+ }`)):d.code.add(l`vec4 getColor(){
48
48
  return applyOpacity(vec4(1, 1, 1, 1));
49
- }`),n.code.add(l`vec3 decompressAxis(vec2 axis) {
49
+ }`),d.code.add(l`vec3 decompressAxis(vec2 axis) {
50
50
  float z = 1.0 - abs(axis.x) - abs(axis.y);
51
51
  return normalize(vec3(axis + sign(axis) * min(z, 0.0), z));
52
52
  }
@@ -55,14 +55,14 @@ vec2 size = getSize();
55
55
  vec3 origin = position;
56
56
  vec3 right = decompressAxis(profileRight);
57
57
  vec3 up = decompressAxis(profileUp);
58
- vec2 profileVertex = profileVertexAndNormal.xy * size;`),n.code.add(l`if(isCapVertex()) {
58
+ vec2 profileVertex = profileVertexAndNormal.xy * size;`),d.code.add(l`if(isCapVertex()) {
59
59
  float positionOffsetAlongProfilePlaneNormal = profileAuxData.x * size[0];
60
60
  vec3 forward = cross(up, right);
61
61
  vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal;
62
62
  return origin + offset;
63
63
  }
64
64
  vec2 rotationRight = vec2(profileAuxData.x, profileAuxData.y);
65
- float maxDistance = length(rotationRight);`),n.code.add(l`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
65
+ float maxDistance = length(rotationRight);`),d.code.add(l`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0);
66
66
  float rx = dot(profileVertex, rotationRight);
67
67
  if (abs(rx) > maxDistance) {
68
68
  vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x);
@@ -71,7 +71,7 @@ profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry;
71
71
  }
72
72
  vec3 offset = right * profileVertex.x + up * profileVertex.y;
73
73
  return origin + offset;
74
- }`),n.code.add(l`vec3 localNormal() {
74
+ }`),d.code.add(l`vec3 localNormal() {
75
75
  vec3 right = decompressAxis(profileRight);
76
76
  vec3 up = decompressAxis(profileUp);
77
77
  vec3 normal = right * profileVertexAndNormal.z + up * profileVertexAndNormal.w;
@@ -80,4 +80,4 @@ vec3 forward = cross(up, right);
80
80
  normal += forward * profileAuxData.y;
81
81
  }
82
82
  return normal;
83
- }`)}class u extends p{constructor(){super(...arguments),this.size=e(1,1)}}export{n as PathVertexPosition,u as PathVertexPositionPassParameters};
83
+ }`)}class d extends p{constructor(){super(...arguments),this.size=e(1,1)}}export{f as PathVertexPosition,d as PathVertexPositionPassParameters};
@@ -2,14 +2,14 @@
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{VisualVariables as i}from"../shading/VisualVariables.glsl.js";import{Float3PassUniform as t}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as e}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as a}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{VertexAttribute as r}from"../../../lib/VertexAttribute.js";const o=8;function c(c,l){const s=c.vertex;s.uniforms.add(new e("intrinsicWidth",(i=>i.width))),l.vvSize?(c.attributes.add(r.SIZEFEATUREATTRIBUTE,"float"),s.uniforms.add(new t("vvSizeMinSize",(i=>i.vvSize.minSize)),new t("vvSizeMaxSize",(i=>i.vvSize.maxSize)),new t("vvSizeOffset",(i=>i.vvSize.offset)),new t("vvSizeFactor",(i=>i.vvSize.factor)),new t("vvSizeFallback",(i=>i.vvSize.fallback))),s.code.add(v`float getSize() {
5
+ import{VisualVariables as i}from"../shading/VisualVariables.glsl.js";import{Float3PassUniform as e}from"../../shaderModules/Float3PassUniform.js";import{FloatPassUniform as a}from"../../shaderModules/FloatPassUniform.js";import{FloatsPassUniform as t}from"../../shaderModules/FloatsPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{VertexAttribute as r}from"../../../lib/VertexAttribute.js";const o=8;function c(c,l){const{vertex:s,attributes:n}=c;s.uniforms.add(new a("intrinsicWidth",(i=>i.width))),l.vvSize?(n.add(r.SIZEFEATUREATTRIBUTE,"float"),s.uniforms.add(new e("vvSizeMinSize",(i=>i.vvSize.minSize)),new e("vvSizeMaxSize",(i=>i.vvSize.maxSize)),new e("vvSizeOffset",(i=>i.vvSize.offset)),new e("vvSizeFactor",(i=>i.vvSize.factor)),new e("vvSizeFallback",(i=>i.vvSize.fallback))),s.code.add(v`float getSize() {
6
6
  if (isnan(sizeFeatureAttribute)) {
7
7
  return vvSizeFallback.x;
8
8
  }
9
9
  return intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x;
10
- }`)):(c.attributes.add(r.SIZE,"float"),s.code.add(v`float getSize(){
10
+ }`)):(n.add(r.SIZE,"float"),s.code.add(v`float getSize(){
11
11
  return intrinsicWidth * size;
12
- }`)),l.vvOpacity?(c.attributes.add(r.OPACITYFEATUREATTRIBUTE,"float"),s.constants.add("vvOpacityNumber","int",8),s.uniforms.add(new a("vvOpacityValues",(i=>i.vvOpacity.values),o),new a("vvOpacityOpacities",(i=>i.vvOpacity.opacityValues),o),new e("vvOpacityFallback",(i=>i.vvOpacity.fallback))),s.code.add(v`float interpolateOpacity(float value){
12
+ }`)),l.vvOpacity?(n.add(r.OPACITYFEATUREATTRIBUTE,"float"),s.constants.add("vvOpacityNumber","int",8),s.uniforms.add(new t("vvOpacityValues",(i=>i.vvOpacity.values),o),new t("vvOpacityOpacities",(i=>i.vvOpacity.opacityValues),o),new a("vvOpacityFallback",(i=>i.vvOpacity.fallback))),s.code.add(v`float interpolateOpacity(float value){
13
13
  if (isnan(value)) {
14
14
  return vvOpacityFallback;
15
15
  }
@@ -28,8 +28,8 @@ vec4 applyOpacity( vec4 color ){
28
28
  return vec4(color.xyz, interpolateOpacity(opacityFeatureAttribute));
29
29
  }`)):s.code.add(v`vec4 applyOpacity( vec4 color ){
30
30
  return color;
31
- }`),l.vvColor?(c.include(i,l),c.attributes.add(r.COLORFEATUREATTRIBUTE,"float"),s.code.add(v`vec4 getColor(){
31
+ }`),l.vvColor?(c.include(i,l),n.add(r.COLORFEATUREATTRIBUTE,"float"),s.code.add(v`vec4 getColor(){
32
32
  return applyOpacity(interpolateVVColor(colorFeatureAttribute));
33
- }`)):(c.attributes.add(r.COLOR,"vec4"),s.code.add(v`vec4 getColor(){
33
+ }`)):(n.add(r.COLOR,"vec4"),s.code.add(v`vec4 getColor(){
34
34
  return applyOpacity(color);
35
35
  }`))}export{c as RibbonVertexPosition};
@@ -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{isFloat16Array as r,Float16Array as t}from"@petamoriken/float16";import{nativeArrayMaxSize as o,isUint16Array as a}from"../../../../core/typedArrayUtil.js";function e(e){if(e.length<o)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return r(e)?t.from(e):a(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
5
+ import{nativeArrayMaxSize as r,isFloat16Array as t,isUint16Array as o}from"../../../../core/typedArrayUtil.js";import{getFloat16ArrayConstructor as a}from"../../../../geometry/support/float16.js";function e(e){if(e.length<r)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return t(e)?a().from(e):o(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}export{e as cloneAttributeData};
@@ -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{copy as t,set as e,length as s,normalize as i,dot as o,scale as r,add as a}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as h,i as l}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as m}from"../../../../geometry/support/FloatArray.js";import{getZeroIndexArray as u}from"../../../../geometry/support/Indices.js";import{Attribute as f,Vertices as d}from"./Attribute.js";import{decompressNormal as b,compressNormal as A}from"./Normals.js";import{intersectTriangles as g}from"./RayIntersections.js";import{VertexAttribute as v}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class I extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=n(),this.positions=m(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(n){t(this._size,n);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:d,profileAuxData:g}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const v=V;let x=0,I=0;const O=b(w,u,t),E=b(j,f,t),T=4*t,C=e(P,d[T]*n[0],d[T+1]*n[1]),N=3*t;if(1===g[N+2])h(v,E,O),x=g[N]*n[0],I=g[N+1];else{const t=D,n=R;e(t,g[N],g[N+1]);const h=s(t);i(t,t);const c=o(C,t);if(Math.abs(c)>h){e(n,-t[1],t[0]);const s=o(C,n);r(t,t,h*Math.sign(c)),r(n,n,s),a(C,t,n)}l(v,0,0,0)}const _=O[0]*C[0]+E[0]*C[1],y=O[1]*C[0]+E[1]*C[1],L=O[2]*C[0]+E[2]*C[1];this.positions[N]=m[c]+_+v[0]*x,this.positions[N+1]=m[c+1]+y+v[1]*x,this.positions[N+2]=m[c+2]+L+v[2]*x;const z=d[T+2],F=d[T+3];A(this.normals,t,O[0]*z+E[0]*F+v[0]*I,O[1]*z+E[1]*F+v[1]*I,O[2]*z+E[2]*F+v[2]*I)}}createGeometryData(){const t=this.builder.vertexIndices;return[[v.POSITION,new f(this.positions,t,3,!0)],[v.NORMALCOMPRESSED,new f(this.normals,t,2,!0)],[v.COLOR,new f(this.color,u(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const o=this.builder.vertexIndices,r=new d(this.positions,3),a=o.length/3;g(t,e,0,a,o,r,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class O extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.baked=new I(t),this._vvData=m(3*this.builder.path.vertices.length);for(let o=0;o<this._vvData.length;o+=3)this._vvData[o]=e,this._vvData[o+1]=s,this._vvData[o+2]=i}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[v.POSITION,new f(t.positions,e,3,!0)],[v.FEATUREVALUE,new f(this._vvData,e,3,!0)],[v.PROFILEVERTEXANDNORMAL,new f(t.profileVertexAndNormals,s,4,!0)],[v.PROFILEAUXDATA,new f(t.profileAuxData,s,3,!0)],[v.PROFILERIGHT,new f(t.profileRightAxes,s,2,!0)],[v.PROFILEUP,new f(t.profileUpAxes,s,2,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(v.POSITION);e&&(e.data=this.builder.positions)}}const P=n(),D=n(),R=n(),V=c(),w=c(),j=c();export{O as FastUpdatePathGeometry,x as PathGeometryData,I as StaticPathGeometry};
5
+ import{copy as t,set as e,length as s,normalize as i,dot as r,scale as o,add as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{e as l,i as h}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newFloatArray as m}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as u}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as f}from"../../../../geometry/support/Indices.js";import{Attribute as d,Vertices as A}from"./Attribute.js";import{decompressNormal as b,compressNormal as g}from"./Normals.js";import{intersectTriangles as v}from"./RayIntersections.js";import{VertexAttribute as I}from"./VertexAttribute.js";class x{constructor(t){this.builder=t}onPathChanged(t){this.builder.onPathChanged()}}class T extends x{constructor(t){super(t),this.color=p(255,255,255,255),this._size=a(),this.positions=m(3*this.builder.numVerticesTotal),this.normals=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(t){this.color[0]=255*t[0],this.color[1]=255*t[1],this.color[2]=255*t[2],this.color[3]=255*(t.length>3?t[3]:1)}bake(a){t(this._size,a);const{numVerticesTotal:c,pathVertexData:p,positions:m,profileRightAxes:u,profileUpAxes:f,profileVertexAndNormals:d,profileAuxData:A}=this.builder;for(let t=0;t<c;++t){let c=p[t];c*=3;const v=w;let I=0,x=0;const T=b(C,u,t),O=b(V,f,t),j=4*t,y=e(R,d[j]*a[0],d[j+1]*a[1]),U=3*t;if(1===A[U+2])l(v,O,T),I=A[U]*a[0],x=A[U+1];else{const t=E,a=P;e(t,A[U],A[U+1]);const l=s(t);i(t,t);const c=r(y,t);if(Math.abs(c)>l){e(a,-t[1],t[0]);const s=r(y,a);o(t,t,l*Math.sign(c)),o(a,a,s),n(y,t,a)}h(v,0,0,0)}const F=T[0]*y[0]+O[0]*y[1],N=T[1]*y[0]+O[1]*y[1],_=T[2]*y[0]+O[2]*y[1];this.positions[U]=m[c]+F+v[0]*I,this.positions[U+1]=m[c+1]+N+v[1]*I,this.positions[U+2]=m[c+2]+_+v[2]*I;const z=d[j+2],D=d[j+3];g(this.normals,t,T[0]*z+O[0]*D+v[0]*x,T[1]*z+O[1]*D+v[1]*x,T[2]*z+O[2]*D+v[2]*x)}}createGeometryData(){const t=this.builder.vertexIndices;return[[I.POSITION,new d(this.positions,t,3,!0)],[I.NORMALCOMPRESSED,new d(this.normals,t,2,!0)],[I.COLOR,new d(this.color,f(t.length),4,!0)]]}onPathChanged(t){super.onPathChanged(t),this.bake(this.size)}intersect(t,e,s,i){const r=this.builder.vertexIndices,o=new A(this.positions,3),n=r.length/3;v(t,e,0,n,r,o,void 0,s,((t,e,s)=>i(t,s,e,!1)))}get size(){return this._size}}class O extends x{constructor(t,e,s,i){super(t),this.sizeAttributeValue=e,this.colorAttributeValue=s,this.opacityAttributeValue=i,this.baked=new T(t),this._vvSize=m(this.builder.path.vertices.length).fill(e),this._vvColor=u(this.builder.path.vertices.length).fill(s),this._vvOpacity=u(this.builder.path.vertices.length).fill(i)}createGeometryData(){const t=this.builder,{pathVertexIndices:e,vertexIndices:s}=t;return[[I.POSITION,new d(t.positions,e,3,!0)],[I.PROFILEVERTEXANDNORMAL,new d(t.profileVertexAndNormals,s,4,!0)],[I.PROFILEAUXDATA,new d(t.profileAuxData,s,3,!0)],[I.PROFILERIGHT,new d(t.profileRightAxes,s,2,!0)],[I.PROFILEUP,new d(t.profileUpAxes,s,2,!0)],[I.SIZEFEATUREATTRIBUTE,new d(this._vvSize,e,1,!0)],[I.COLORFEATUREATTRIBUTE,new d(this._vvColor,e,1,!0)],[I.OPACITYFEATUREATTRIBUTE,new d(this._vvOpacity,e,1,!0)]]}onPathChanged(t){super.onPathChanged(t);const e=t.getMutableAttribute(I.POSITION);e&&(e.data=this.builder.positions)}}const R=a(),E=a(),P=a(),w=c(),C=c(),V=c();export{O as FastUpdatePathGeometry,x as PathGeometryData,T as StaticPathGeometry};
@@ -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
- var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.NEXTDELTA="nextDelta",e.PREVIOUSDELTA="previousDelta",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.FEATUREVALUE="featureValue",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
5
+ var e;function E(E){return E===e.POSITION}!function(e){e.POSITION="position",e.NORMAL="normal",e.NORMALCOMPRESSED="normalCompressed",e.UV0="uv0",e.UVI="uvi",e.COLOR="color",e.SYMBOLCOLOR="symbolColor",e.SIZE="size",e.ROTATION="rotation",e.TANGENT="tangent",e.OFFSET="offset",e.PERSPECTIVEDIVIDE="perspectiveDivide",e.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",e.LENGTH="length",e.NEXTDELTA="nextDelta",e.PREVIOUSDELTA="previousDelta",e.U0="u0",e.LINEPARAMETERS="lineParameters",e.COLORFEATUREATTRIBUTE="colorFeatureAttribute",e.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",e.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",e.DISTANCETOSTART="distanceToStart",e.UVMAPSPACE="uvMapSpace",e.BOUNDINGRECT="boundingRect",e.UVREGION="uvRegion",e.PROFILERIGHT="profileRight",e.PROFILEUP="profileUp",e.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",e.PROFILEAUXDATA="profileAuxData",e.INSTANCEMODELORIGINHI="instanceModelOriginHi",e.INSTANCEMODELORIGINLO="instanceModelOriginLo",e.INSTANCEMODEL="instanceModel",e.INSTANCEMODELNORMAL="instanceModelNormal",e.INSTANCECOLOR="instanceColor",e.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",e.LOCALTRANSFORM="localTransform",e.GLOBALTRANSFORM="globalTransform",e.BOUNDINGSPHERE="boundingSphere",e.MODELORIGIN="modelOrigin",e.MODELSCALEFACTORS="modelScaleFactors",e.FEATUREATTRIBUTE="featureAttribute",e.STATE="state",e.LODLEVEL="lodLevel",e.POSITION0="position0",e.POSITION1="position1",e.NORMAL2COMPRESSED="normal2Compressed",e.COMPONENTINDEX="componentIndex",e.VARIANTOFFSET="variantOffset",e.VARIANTSTROKE="variantStroke",e.VARIANTEXTENSION="variantExtension",e.SIDENESS="sideness",e.START="start",e.END="end",e.UP="up",e.START_UP="startUp",e.END_UP="endUp",e.EXTRUDE="extrude",e.OLIDCOLOR="objectAndLayerIdColor",e.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(e||(e={}));export{e as VertexAttribute,E as affectsGeometry};
@@ -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{Float16Array as e}from"@petamoriken/float16";import{Default3D as o}from"./DefaultVertexAttributeLocations.js";import{Pos2 as r,Pos2Tex as t}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as s}from"./VertexArrayObject.js";import{BufferObject as n}from"../../../webgl/BufferObject.js";import{Usage as f,TextureSamplingMode as m}from"../../../webgl/enums.js";import{Texture as a}from"../../../webgl/Texture.js";import{TextureDescriptor as i}from"../../../webgl/TextureDescriptor.js";function u(r,t=w.Pos2,m=o,a=-1,i=1){const u=t===w.Pos2?new Float32Array([a,a,i,a,a,i,i,i]):new Float32Array([a,a,0,i,a,0,a,i,0,i,i,0]);if(t===w.Pos2Tex){const o=new e(u.buffer);o[10]=o[17]=o[22]=o[23]=1}return new s(r,m,new Map([["geometry",x.get(t)]]),new Map([["geometry",n.createVertex(r,f.STATIC_DRAW,u)]]))}const p=4;function c(e){const o=new i(p);return o.samplingMode=m.NEAREST,new a(e,o)}var w;!function(e){e[e.Pos2=0]="Pos2",e[e.Pos2Tex=1]="Pos2Tex"}(w||(w={}));const x=new Map([[w.Pos2,r],[w.Pos2Tex,t]]);export{w as Layout,c as createEmptyTexture,u as createQuadVAO};
5
+ import{makeFloat16Array as e}from"../../../../geometry/support/float16.js";import{Default3D as o}from"./DefaultVertexAttributeLocations.js";import{Pos2 as r,Pos2Tex as t}from"./DefaultVertexBufferLayouts.js";import{VertexArrayObject as s}from"./VertexArrayObject.js";import{BufferObject as n}from"../../../webgl/BufferObject.js";import{Usage as f,TextureSamplingMode as m}from"../../../webgl/enums.js";import{Texture as a}from"../../../webgl/Texture.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";function i(r,t=w.Pos2,m=o,a=-1,u=1){const i=t===w.Pos2?new Float32Array([a,a,u,a,a,u,u,u]):new Float32Array([a,a,0,u,a,0,a,u,0,u,u,0]);if(t===w.Pos2Tex){const o=e(i.buffer);o[10]=o[17]=o[22]=o[23]=1}return new s(r,m,new Map([["geometry",x.get(t)]]),new Map([["geometry",n.createVertex(r,f.STATIC_DRAW,i)]]))}const p=4;function c(e){const o=new u(p);return o.samplingMode=m.NEAREST,new a(e,o)}var w;!function(e){e[e.Pos2=0]="Pos2",e[e.Pos2Tex=1]="Pos2Tex"}(w||(w={}));const x=new Map([[w.Pos2,r],[w.Pos2Tex,t]]);export{w as Layout,c as createEmptyTexture,i as createQuadVAO};
@@ -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{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmissionOrOID as e,isDepth as s,is2DGeometryOutput as i,isColorOrColorEmission as a,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as l}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as _}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as g}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as O}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class A extends m{constructor(t){super(t,P),this._configuration=new O,this.supportsEdges=!0,this.produces=new Map([[u.OPAQUE_MATERIAL,t=>this._isOpaqueMaterialPass(t)],[u.OPAQUE_MATERIAL_WITHOUT_NORMALS,t=>this._isOpaqueNoSSAODepthPass(t)],[u.TRANSPARENT_MATERIAL,t=>e(t)&&this._transparent&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,t=>s(t)&&this._transparent&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,t=>e(t)&&this._transparent&&!this.parameters.writeDepth],[u.DRAPED_MATERIAL,t=>i(t)]])}getConfiguration(t,r){return super.getConfiguration(t,r,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._transparent,this._configuration.discardInvisibleFragments=this._transparent&&!this._isOpaquePass(t)&&this.parameters.discardInvisibleFragments,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=r.hasOccludees,this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<l,this._configuration.terrainDepthTest=r.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration}get visible(){return this.parameters.color[3]>=T}get _transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}_isOpaquePass(t){return this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return t===o.Highlight||e(t)&&!this._transparent}_isOpaqueNoSSAODepthPass(t){return s(t)&&this.parameters.writeDepth&&!this._transparent}createGLMaterial(t){return new d(t)}createBufferWriter(){const t=r().vec3f(c.POSITION);return n()&&t.vec4u8(c.OLIDCOLOR),this.parameters.vvColor?t.f32(c.COLORFEATUREATTRIBUTE):t.vec4u8(c.COLOR),new f(t)}}class d extends p{beginSlot(t){return this.getTechnique(g,t)}}class P extends _{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=h.None,this.draped=!1,this.discardInvisibleFragments=!1}}export{A as ColorMaterial,P as Parameters};
5
+ import{ZEROS as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{newLayout as r}from"../../support/buffer/InterleavedLayout.js";import{isColorOrColorEmissionOrOID as e,isDepth as s,is2DGeometryOutput as i,isColorOrColorEmission as a,ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as n}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as h}from"../lib/basicInterfaces.js";import p from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as l}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as u}from"../lib/RenderSlot.js";import{VertexAttribute as c}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{TriangleMaterial as m}from"./TriangleMaterial.js";import{VisualVariablePassParameters as _}from"./VisualVariablePassParameters.js";import{ColorMaterialTechnique as g}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as O}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as T}from"../../../../webscene/support/AlphaCutoff.js";class A extends m{constructor(t){super(t,P),this._configuration=new O,this.supportsEdges=!0,this.produces=new Map([[u.OPAQUE_MATERIAL,t=>this._isOpaqueMaterialPass(t)],[u.OPAQUE_MATERIAL_WITHOUT_NORMALS,t=>this._isOpaqueNoSSAODepthPass(t)],[u.TRANSPARENT_MATERIAL,t=>e(t)&&this._transparent&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,t=>s(t)&&this._transparent&&this.parameters.writeDepth],[u.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,t=>e(t)&&this._transparent&&!this.parameters.writeDepth],[u.DRAPED_MATERIAL,t=>i(t)]])}getConfiguration(t,r){return super.getConfiguration(t,r,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._transparent,this._configuration.discardInvisibleFragments=this._transparent&&!this._isOpaquePass(t)&&this.parameters.discardInvisibleFragments,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=r.hasOccludees,this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation<l,this._configuration.terrainDepthTest=r.terrainDepthTest&&a(t),this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration}get visible(){return this.parameters.color[3]>=T}get _transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}_isOpaquePass(t){return this._isOpaqueMaterialPass(t)||this._isOpaqueNoSSAODepthPass(t)}_isOpaqueMaterialPass(t){return t===o.Highlight||e(t)&&!this._transparent}_isOpaqueNoSSAODepthPass(t){return s(t)&&this.parameters.writeDepth&&!this._transparent}createGLMaterial(t){return new d(t)}createBufferWriter(){const t=r().vec3f(c.POSITION);return n()&&t.vec4u8(c.OLIDCOLOR),this.parameters.vvColor?t.f16(c.COLORFEATUREATTRIBUTE):t.vec4u8(c.COLOR),new f(t)}}class d extends p{beginSlot(t){return this.getTechnique(g,t)}}class P extends _{constructor(){super(...arguments),this.color=t,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=h.None,this.draped=!1,this.discardInvisibleFragments=!1}}export{A as ColorMaterial,P as Parameters};
@@ -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{Float16Array as e}from"@petamoriken/float16";import{i as t,H as r,t as i}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as n,isColor as o,isDepth as h,isColorHighlightOrDepth as c,isColorOrColorEmission as p}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as m,RenderOccludedFlag as u}from"../lib/Material.js";import{RenderSlot as T}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as A}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as v,LineMarkerTechnique as _}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as E,LineMarkerSpace as g,LineMarkerAnchor as O}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as S}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class I extends m{constructor(e){super(e,C),this._configuration=new E,this.vertexAttributeLocations=v,this.produces=new Map([[T.OPAQUE_MATERIAL,e=>e===n.Highlight||o(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>h(e)],[T.OCCLUDER_MATERIAL,e=>c(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_OCCLUDER_MATERIAL,e=>c(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_MATERIAL,e=>o(e)&&this.parameters.writeDepth],[T.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>o(e)&&!this.parameters.writeDepth],[T.DRAPED_MATERIAL,e=>p(e)||e===n.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.space=t.slot===T.DRAPED_MATERIAL?g.Draped:this.parameters.worldSpace?g.World:g.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==S.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===u.OccludeAndTransparentStencil,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&p(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(){}createLayout(){const e=s().vec3f(f.POSITION).vec4f16(f.PREVIOUSDELTA).vec2f16(f.UV0);return this.parameters.worldSpace&&e.vec3f16(f.NORMAL),this.parameters.vvSize?e.f16(f.SIZEFEATUREATTRIBUTE):e.f16(f.SIZE),this.parameters.vvColor?e.f16(f.COLORFEATUREATTRIBUTE):e.vec4u8(f.COLOR,{glNormalized:!0}),this.parameters.vvOpacity&&e.f16(f.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new P(this._layout,this.parameters)}createGLMaterial(e){return new L(e)}}class L extends l{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(_,e)}}class C extends d{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=S.BUTT,this.anchor=O.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class P{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(a,s,n,o,h,c){const p=n.get(f.POSITION).data,l=p.length/3;let m=[1,0,0];const u=n.get(f.NORMAL);this._parameters.worldSpace&&null!=u&&(m=u.data);let T=1,d=0;this._parameters.vvSize?d=n.get(f.SIZEFEATUREATTRIBUTE).data[0]:n.has(f.SIZE)&&(T=n.get(f.SIZE).data[0]);let v=[1,1,1,1],_=0;this._parameters.vvColor?_=n.get(f.COLORFEATUREATTRIBUTE).data[0]:n.has(f.COLOR)&&(v=n.get(f.COLOR).data);let E=0;this._parameters.vvOpacity&&(E=n.get(f.OPACITYFEATUREATTRIBUTE).data[0]);const g=new Float32Array(h.buffer),O=new e(h.buffer),S=new Uint8Array(h.buffer);let R=c*(this.vertexBufferLayout.stride/4);const I=(e,t,r,i)=>{g[R++]=e[0],g[R++]=e[1],g[R++]=e[2],A(t,e,O,2*R),R+=2;let a=2*R;if(O[a++]=r[0],O[a++]=r[1],this._parameters.worldSpace&&(O[a++]=m[0],O[a++]=m[1],O[a++]=m[2]),this._parameters.vvSize?O[a++]=d:O[a++]=T,this._parameters.vvColor)O[a++]=_;else{const e=Math.min(4*i,v.length-4),t=2*a;a+=2,S[t]=255*v[e],S[t+1]=255*v[e+1],S[t+2]=255*v[e+2],S[t+3]=255*v[e+3]}this._parameters.vvOpacity&&(O[a++]=E),R=Math.ceil(.5*a)};let L;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(L||(L={}));const C=(e,s)=>{const n=t(b,p[3*e],p[3*e+1],p[3*e+2]),o=D;let h=e+s;do{t(o,p[3*h],p[3*h+1],p[3*h+2]),h+=s}while(r(n,o)&&h>=0&&h<l);a&&(i(n,n,a),i(o,o,a)),I(n,o,[-1,-1],e),I(n,o,[1,-1],e),I(n,o,[1,1],e),I(n,o,[-1,-1],e),I(n,o,[1,1],e),I(n,o,[-1,1],e)},P=this._parameters.placement;return"begin"!==P&&"begin-end"!==P||C(0,L.ASCENDING),"end"!==P&&"begin-end"!==P||C(l-1,L.DESCENDING),null}}const b=a(),D=a();export{I as LineMarkerMaterial,C as Parameters};
5
+ import{i as e,H as t,t as r}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as a}from"../../../../geometry/support/float16.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{ShaderOutput as n,isColor as o,isDepth as h,isColorHighlightOrDepth as c,isColorOrColorEmission as p}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as m,RenderOccludedFlag as u}from"../lib/Material.js";import{RenderSlot as T}from"../lib/RenderSlot.js";import{VertexAttribute as f}from"../lib/VertexAttribute.js";import{VisualVariablePassParameters as d}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as A}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocations as v,LineMarkerTechnique as _}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as E,LineMarkerSpace as g,LineMarkerAnchor as O}from"../shaders/LineMarkerTechniqueConfiguration.js";import{CapType as S}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class I extends m{constructor(e){super(e,C),this._configuration=new E,this.vertexAttributeLocations=v,this.produces=new Map([[T.OPAQUE_MATERIAL,e=>e===n.Highlight||o(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.OPAQUE_MATERIAL_WITHOUT_NORMALS,e=>h(e)],[T.OCCLUDER_MATERIAL,e=>c(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_OCCLUDER_MATERIAL,e=>c(e)&&this.parameters.renderOccluded===u.OccludeAndTransparentStencil],[T.TRANSPARENT_MATERIAL,e=>o(e)&&this.parameters.writeDepth],[T.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>o(e)&&!this.parameters.writeDepth],[T.DRAPED_MATERIAL,e=>p(e)||e===n.Highlight]]),this._layout=this.createLayout()}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.space=t.slot===T.DRAPED_MATERIAL?g.Draped:this.parameters.worldSpace?g.World:g.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==S.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=t.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===u.OccludeAndTransparentStencil,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&p(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=R}intersect(){}createLayout(){const e=s().vec3f(f.POSITION).vec4f16(f.PREVIOUSDELTA).vec2f16(f.UV0);return this.parameters.worldSpace&&e.vec3f16(f.NORMAL),this.parameters.vvSize?e.f16(f.SIZEFEATUREATTRIBUTE):e.f16(f.SIZE),this.parameters.vvColor?e.f16(f.COLORFEATUREATTRIBUTE):e.vec4u8(f.COLOR,{glNormalized:!0}),this.parameters.vvOpacity&&e.f16(f.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new P(this._layout,this.parameters)}createGLMaterial(e){return new L(e)}}class L extends l{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextures.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(_,e)}}class C extends d{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=S.BUTT,this.anchor=O.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.markerTexture=null}}class P{constructor(e,t){this.vertexBufferLayout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,s,n,o,h,c){const p=n.get(f.POSITION).data,l=p.length/3;let m=[1,0,0];const u=n.get(f.NORMAL);this._parameters.worldSpace&&null!=u&&(m=u.data);let T=1,d=0;this._parameters.vvSize?d=n.get(f.SIZEFEATUREATTRIBUTE).data[0]:n.has(f.SIZE)&&(T=n.get(f.SIZE).data[0]);let v=[1,1,1,1],_=0;this._parameters.vvColor?_=n.get(f.COLORFEATUREATTRIBUTE).data[0]:n.has(f.COLOR)&&(v=n.get(f.COLOR).data);let E=0;this._parameters.vvOpacity&&(E=n.get(f.OPACITYFEATUREATTRIBUTE).data[0]);const g=new Float32Array(h.buffer),O=a(h.buffer),S=new Uint8Array(h.buffer);let R=c*(this.vertexBufferLayout.stride/4);const I=(e,t,r,i)=>{g[R++]=e[0],g[R++]=e[1],g[R++]=e[2],A(t,e,O,2*R),R+=2;let a=2*R;if(O[a++]=r[0],O[a++]=r[1],this._parameters.worldSpace&&(O[a++]=m[0],O[a++]=m[1],O[a++]=m[2]),this._parameters.vvSize?O[a++]=d:O[a++]=T,this._parameters.vvColor)O[a++]=_;else{const e=Math.min(4*i,v.length-4),t=2*a;a+=2,S[t]=255*v[e],S[t+1]=255*v[e+1],S[t+2]=255*v[e+2],S[t+3]=255*v[e+3]}this._parameters.vvOpacity&&(O[a++]=E),R=Math.ceil(.5*a)};let L;!function(e){e[e.ASCENDING=1]="ASCENDING",e[e.DESCENDING=-1]="DESCENDING"}(L||(L={}));const C=(a,s)=>{const n=e(b,p[3*a],p[3*a+1],p[3*a+2]),o=D;let h=a+s;do{e(o,p[3*h],p[3*h+1],p[3*h+2]),h+=s}while(t(n,o)&&h>=0&&h<l);i&&(r(n,n,i),r(o,o,i)),I(n,o,[-1,-1],a),I(n,o,[1,-1],a),I(n,o,[1,1],a),I(n,o,[-1,-1],a),I(n,o,[1,1],a),I(n,o,[-1,1],a)},P=this._parameters.placement;return"begin"!==P&&"begin-end"!==P||C(0,L.ASCENDING),"end"!==P&&"begin-end"!==P||C(l-1,L.DESCENDING),null}}const b=i(),D=i();export{I as LineMarkerMaterial,C as Parameters};
@@ -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{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as n,isColorOrColorEmission as c,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as m}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as l}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as _}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as y}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as A,PathTechnique as O,PathPassParameters as j}from"./PathTechnique.js";import{PathTechniqueConfiguration as P}from"./PathTechniqueConfiguration.js";import{alphaCutoff as L}from"../../../../webscene/support/AlphaCutoff.js";class R extends d{constructor(e,t){super(e,x),this._vertexBufferLayout=T(),this.vertexAttributeLocations=A,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&!this.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&this.transparent]]),this._configuration=new P(t.spherical)}get hasEmissions(){return!i(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,c(e)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?m.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?m.WindingOrder:m.None,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?l.Schematic:l.Disabled,this._configuration.emissionSource=this.parameters.usePBR?u.Value:u.None,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=L}intersect(i,r,a,o,n,c){const h=i;if(!b(h))return;const u=h.path,m=t(this.parameters.size);if(this.parameters.vvSize){const{offset:t,factor:i,minSize:r,maxSize:s,fallback:a}=this.parameters.vvSize,o=u.sizeAttributeValue;Number.isNaN(o)?(m[0]*=a[0],m[1]*=a[2]):(m[0]*=e(t[0]+o*i[0],r[0],s[0]),m[1]*=e(t[2]+o*i[2],r[2],s[2]))}const l=new g(!1,a.options.normalRequired),p=Math.max(m[0],m[1]),f=i.boundingInfo;if(null==f)return void M(u,m,o,n,l,c);const d=s(f.bbMin[0]-p,f.bbMin[1]-p,f.bbMin[2]-p,f.bbMax[0]+p,f.bbMax[1]+p,f.bbMax[2]+p),S=[n[0]-o[0],n[1]-o[1],n[2]-o[2]],_=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),y=[_/S[0],_/S[1],_/S[2]];v(d,o,y,a.tolerance)&&M(u,m,o,n,l,c)}createBufferWriter(){return new y(this._vertexBufferLayout)}createGLMaterial(e){return new w(e)}get transparent(){const{parameters:e}=this;return e.drivenOpacity||e.opacity<1}}function T(){const e=a().vec3f(_.POSITION).vec3f(_.FEATUREVALUE).vec4f16(_.PROFILEVERTEXANDNORMAL).vec3f16(_.PROFILEAUXDATA).vec2i16(_.PROFILERIGHT,{glNormalized:!0}).vec2i16(_.PROFILEUP,{glNormalized:!0});return p()&&e.vec4u8(_.OLIDCOLOR),e}class w extends f{beginSlot(e){return this.getTechnique(O,e)}}function M(e,t,i,r,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,r,s,a)}class x extends j{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{x as Parameters,R as PathMaterial};
5
+ import{clamp as e}from"../../../../core/mathUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{p as i}from"../../../../chunks/vec32.js";import{ZEROS as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isShadowRelatedOutput as o,is3DGeometryOutputMRT as n,isColorOrColorEmission as c,ShaderOutput as h}from"../core/shaderLibrary/ShaderOutput.js";import{EmissionSource as u}from"../core/shaderLibrary/output/Emissions.glsl.js";import{NormalsDoubleSidedMode as m}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as p}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{olidEnabled as l}from"../effects/geometry/olidUtils.js";import f from"../lib/GLMaterial.js";import{Material as d}from"../lib/Material.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as g,intersectAabbInvDir as v}from"../lib/RayIntersections.js";import{RenderSlot as S}from"../lib/RenderSlot.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as A}from"./DefaultBufferWriter.js";import{vertexAttributeLocations as O,PathTechnique as R,PathPassParameters as E}from"./PathTechnique.js";import{PathTechniqueConfiguration as y}from"./PathTechniqueConfiguration.js";import{alphaCutoff as _}from"../../../../webscene/support/AlphaCutoff.js";class P extends d{constructor(e,t){super(e,I),this.vertexAttributeLocations=O,this.supportsEdges=!0,this.produces=new Map([[S.OPAQUE_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&!this.transparent],[S.TRANSPARENT_MATERIAL,e=>(this.parameters.castShadows&&o(e)||n(e))&&this.transparent]]),this._configuration=new y(t.spherical)}get hasEmissions(){return!i(this.parameters.emissiveFactor,r)}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,c(e)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?m.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?m.WindingOrder:m.None,this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?p.Schematic:p.Disabled,this._configuration.emissionSource=this.parameters.usePBR?u.Value:u.None,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}isVisibleForOutput(e){return e!==h.Shadow&&e!==h.ShadowExcludeHighlight&&e!==h.ShadowHighlight||this.parameters.castShadows}get visible(){return this.parameters.opacity>=_}intersect(i,r,a,o,n,c){const h=i;if(!b(h))return;const u=h.path,m=t(this.parameters.size);if(this.parameters.vvSize){const{offset:t,factor:i,minSize:r,maxSize:s,fallback:a}=this.parameters.vvSize,o=u.sizeAttributeValue;Number.isNaN(o)?(m[0]*=a[0],m[1]*=a[2]):(m[0]*=e(t[0]+o*i[0],r[0],s[0]),m[1]*=e(t[2]+o*i[2],r[2],s[2]))}const p=new g(!1,a.options.normalRequired),l=Math.max(m[0],m[1]),f=i.boundingInfo;if(null==f)return void w(u,m,o,n,p,c);const d=s(f.bbMin[0]-l,f.bbMin[1]-l,f.bbMin[2]-l,f.bbMax[0]+l,f.bbMax[1]+l,f.bbMax[2]+l),S=[n[0]-o[0],n[1]-o[1],n[2]-o[2]],T=Math.sqrt(S[0]*S[0]+S[1]*S[1]+S[2]*S[2]),A=[T/S[0],T/S[1],T/S[2]];v(d,o,A,a.tolerance)&&w(u,m,o,n,p,c)}createBufferWriter(){return new A(this._layout)}get _layout(){const e=a().vec3f(T.POSITION).vec4f16(T.PROFILEVERTEXANDNORMAL).vec3f16(T.PROFILEAUXDATA).vec2i16(T.PROFILERIGHT,{glNormalized:!0}).vec2i16(T.PROFILEUP,{glNormalized:!0});return this.parameters.vvSize&&e.f32(T.SIZEFEATUREATTRIBUTE),this.parameters.vvColor&&e.f16(T.COLORFEATUREATTRIBUTE),this.parameters.vvOpacity&&e.f16(T.OPACITYFEATUREATTRIBUTE),l()&&e.vec4u8(T.OLIDCOLOR),e}createGLMaterial(e){return new j(e)}get transparent(){const{parameters:e}=this;return e.drivenOpacity||e.opacity<1}}class j extends f{beginSlot(e){return this.getTechnique(R,e)}}function w(e,t,i,r,s,a){e.baked.size&&e.baked.size[0]===t[0]&&e.baked.size[1]===t[1]||e.baked.bake(t),e.baked.intersect(i,r,s,a)}class I extends E{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{I as Parameters,P as PathMaterial};
@@ -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{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as b}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as P}from"../../../webgl/enums.js";import{makePipelineState as T,frontFaceCullingParams as g,defaultDepthWrite as E,defaultColorWrite as L}from"../../../webgl/renderState.js";class I extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.specular=r(0,0,0),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=s}}class R extends a{constructor(r,e){super(r,e,new n(j,(()=>import("../shaders/Path.glsl.js"))),F)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:o,doubleSidedMode:n,hasOccludees:a,oitPass:b}=r,O=b===m.NONE,j=b===m.FrontFace;return T({blending:t(e)&&s?c(b):null,culling:o&&!s&&n!==l.None?g:null,depthTest:{func:p(b)},depthWrite:O||j?E:null,drawBuffers:e===i.Depth?{buffers:[P.NONE]}:u(b,e),colorWrite:L,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||j?null:h})}}const F=new Map([[b.POSITION,0],[b.FEATUREVALUE,1],[b.PROFILEVERTEXANDNORMAL,2],[b.PROFILEAUXDATA,3],[b.PROFILERIGHT,4],[b.PROFILEUP,5],[b.OLIDCOLOR,6]]);export{I as PathPassParameters,R as PathTechnique,F as vertexAttributeLocations};
5
+ import{freeze as r,create as e,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isColorOrColorEmission as t,ShaderOutput as i}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as o}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{NormalsDoubleSidedMode as l}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as n}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as m}from"../lib/OITPass.js";import{blending as c,oitDepthTest as p,getDrawBuffers as u,OITPolygonOffset as h}from"../lib/OrderIndependentTransparency.js";import{stencilWriteMaskOn as d,stencilBaseAllZerosParams as f}from"../lib/StencilUtils.js";import{VertexAttribute as T}from"../lib/VertexAttribute.js";import{advancedMRRFactors as O}from"./pbrUtils.js";import{P as b}from"../../../../chunks/Path.glsl.js";import{SpecialDrawBuffers as E}from"../../../webgl/enums.js";import{makePipelineState as P,frontFaceCullingParams as R,defaultDepthWrite as j,defaultColorWrite as I}from"../../../webgl/renderState.js";class A extends o{constructor(){super(...arguments),this.ambient=r(.2,.2,.2),this.diffuse=r(.8,.8,.8),this.specular=r(0,0,0),this.opacity=1,this.origin=e(),this.modelTransformation=null,this.mrrFactors=O,this.emissiveFactor=s}}class g extends a{constructor(r,e){super(r,e,new n(b,(()=>import("../shaders/Path.glsl.js"))),F)}initializePipeline(r){const{output:e,transparent:s,hasSlicePlane:o,doubleSidedMode:n,hasOccludees:a,oitPass:T}=r,O=T===m.NONE,b=T===m.FrontFace;return P({blending:t(e)&&s?c(T):null,culling:o&&!s&&n!==l.None?R:null,depthTest:{func:p(T)},depthWrite:O||b?j:null,drawBuffers:e===i.Depth?{buffers:[E.NONE]}:u(T,e),colorWrite:I,stencilWrite:a?d:null,stencilTest:a?f:null,polygonOffset:O||b?null:h})}}const F=new Map([[T.POSITION,0],[T.PROFILEVERTEXANDNORMAL,1],[T.PROFILEAUXDATA,2],[T.PROFILERIGHT,3],[T.PROFILEUP,4],[T.SIZEFEATUREATTRIBUTE,5],[T.COLORFEATUREATTRIBUTE,6],[T.OPACITYFEATUREATTRIBUTE,7],[T.OLIDCOLOR,8]]);export{A as PathPassParameters,g as PathTechnique,F as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as h}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as d}from"./DefaultBufferWriter.js";import{Style as g}from"./PatternStyle.js";import{TriangleMaterial as A}from"./TriangleMaterial.js";import{VisualVariablePassParameters as T}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as v}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as O,vertexAttributeLocations as _,PatternTechnique as j}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as C}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as P}from"../../../../webscene/support/AlphaCutoff.js";class R extends A{constructor(e){super(e,I),this._configuration=new C,this.vertexAttributeLocations=f()?O:_,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>i(e)],[p.TRANSPARENT_MATERIAL,e=>o(e)],[p.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,e=>a(e)],[p.DRAPED_MATERIAL,e=>this.parameters.draped&&n(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.terrainDepthTest=t.terrainDepthTest&&o(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=P}createGLMaterial(e){return new y(e)}createBufferWriter(){const e=s().vec3f(m.POSITION).vec4f(m.UVMAPSPACE);return this.parameters.draped||e.mat3f(m.BOUNDINGRECT),this.parameters.vvColor?e.f32(m.COLORFEATUREATTRIBUTE):e.vec4u8(m.COLOR),f()&&e.vec4u8(m.OLIDCOLOR),new E(e)}}class y extends l{beginSlot(e){return this.getTechnique(j,e)}}class E extends d{write(e,s,i,o,a,n){const f=b(i,o,this.vertexBufferLayout,e,s,a,n);for(const c of this.vertexBufferLayout.fields.keys()){const s=i.get(c),o=s?.indices;if(s&&o)switch(c){case m.UVMAPSPACE:{h(4===s.size);const e=a.getField(c,r);e&&v(s,e,n);break}case m.BOUNDINGRECT:{h(9===s.size);const r=a.getField(c,t);r&&L(s,e,r,n);break}}}return f}}function L(e,t,r,s){const{data:i,indices:o}=e,a=t,n=r.typedBuffer,f=r.typedBufferStride,c=o.length;s*=f;for(let l=0;l<c;++l){const e=9*o[l],t=i[e],r=i[e+1],c=i[e+2];n[s]=a[0]*t+a[4]*r+a[8]*c+a[12],n[s+1]=a[1]*t+a[5]*r+a[9]*c+a[13],n[s+2]=a[2]*t+a[6]*r+a[10]*c+a[14];for(let o=3;o<9;++o)n[s+o]=i[e+o];s+=f}}class I extends T{constructor(){super(...arguments),this.color=e(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=g.Cross,this.draped=!0}}export{I as Parameters,R as PatternMaterial};
5
+ import{fromValues as e}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{BufferViewMat3f as t,BufferViewVec4f as r}from"../../../../geometry/support/buffer/BufferView.js";import{newLayout as s}from"../../support/buffer/InterleavedLayout.js";import{isHighlightOrOID as i,isColorOrColorEmission as o,isDepth as a,isColorEmissionHighlightOrOID as n}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as f}from"../effects/geometry/olidUtils.js";import{CullFaceOptions as c}from"../lib/basicInterfaces.js";import l from"../lib/GLMaterial.js";import{OITPolygonOffsetLimit as u}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{assert as h}from"../lib/Util.js";import{VertexAttribute as m}from"../lib/VertexAttribute.js";import{DefaultBufferWriter as d}from"./DefaultBufferWriter.js";import{Style as g}from"./PatternStyle.js";import{TriangleMaterial as A}from"./TriangleMaterial.js";import{VisualVariablePassParameters as T}from"./VisualVariablePassParameters.js";import{writeDefaultAttributes as b,writeBufferVec4 as v}from"./internal/bufferWriterUtils.js";import{vertexAttributeLocationsOID as O,vertexAttributeLocations as _,PatternTechnique as j}from"../shaders/PatternTechnique.js";import{PatternTechniqueConfiguration as C}from"../shaders/PatternTechniqueConfiguration.js";import{alphaCutoff as P}from"../../../../webscene/support/AlphaCutoff.js";class R extends A{constructor(e){super(e,I),this._configuration=new C,this.vertexAttributeLocations=f()?O:_,this.supportsEdges=!0,this.produces=new Map([[p.OPAQUE_MATERIAL,e=>i(e)],[p.TRANSPARENT_MATERIAL,e=>o(e)],[p.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,e=>a(e)],[p.DRAPED_MATERIAL,e=>this.parameters.draped&&n(e)]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.style=this.parameters.style,this._configuration.draped=this.parameters.draped,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<u,this._configuration.terrainDepthTest=t.terrainDepthTest&&o(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration}get visible(){return this.parameters.color[3]>=P}createGLMaterial(e){return new y(e)}createBufferWriter(){const e=s().vec3f(m.POSITION).vec4f(m.UVMAPSPACE);return this.parameters.draped||e.mat3f(m.BOUNDINGRECT),this.parameters.vvColor?e.f16(m.COLORFEATUREATTRIBUTE):e.vec4u8(m.COLOR),f()&&e.vec4u8(m.OLIDCOLOR),new E(e)}}class y extends l{beginSlot(e){return this.getTechnique(j,e)}}class E extends d{write(e,s,i,o,a,n){const f=b(i,o,this.vertexBufferLayout,e,s,a,n);for(const c of this.vertexBufferLayout.fields.keys()){const s=i.get(c),o=s?.indices;if(s&&o)switch(c){case m.UVMAPSPACE:{h(4===s.size);const e=a.getField(c,r);e&&v(s,e,n);break}case m.BOUNDINGRECT:{h(9===s.size);const r=a.getField(c,t);r&&L(s,e,r,n);break}}}return f}}function L(e,t,r,s){const{data:i,indices:o}=e,a=t,n=r.typedBuffer,f=r.typedBufferStride,c=o.length;s*=f;for(let l=0;l<c;++l){const e=9*o[l],t=i[e],r=i[e+1],c=i[e+2];n[s]=a[0]*t+a[4]*r+a[8]*c+a[12],n[s+1]=a[1]*t+a[5]*r+a[9]*c+a[13],n[s+2]=a[2]*t+a[6]*r+a[10]*c+a[14];for(let o=3;o<9;++o)n[s+o]=i[e+o];s+=f}}class I extends T{constructor(){super(...arguments),this.color=e(1,1,1,1),this.hasVertexColors=!1,this.polygonOffset=!1,this.hasSlicePlane=!1,this.cullFace=c.None,this.hasOccludees=!1,this.style=g.Cross,this.draped=!0}}export{I as Parameters,R as PatternMaterial};