@arcgis/core 4.33.0-next.20250410 → 4.33.0-next.20250412
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{1364744b15b327abd5a1.js → 37716880cef8155259f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{ccb289911e7445b17763.js → 3a84ee5d0434362286a6.js} +10 -10
- package/assets/esri/core/workers/chunks/4deeeceb784e4390441d.js +1 -0
- package/assets/esri/core/workers/chunks/5a991c8e0febb0cf9be1.js +1 -0
- package/assets/esri/core/workers/chunks/7f86c9ec45f4fae1fb49.js +1 -0
- package/assets/esri/core/workers/chunks/{b06e3ba73f353592c81d.js → b6361cec92003997bfe5.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bbe6160eda3fb5d58ec.js → d88544ac332be633e3fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{35ab75010817f1525e54.js → e6a97f9b6f7be8076f85.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fa5bfc70512994f5ec1.js → e7cb4003c45e42b48ea6.js} +1 -1
- package/assets/esri/core/workers/chunks/{b308bef7ff08e0e635b5.js → fe1ad9ed0d32f557e5a3.js} +23 -23
- package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +0 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/BloomBlur.glsl.js +4 -6
- package/chunks/BloomComposition.glsl.js +12 -12
- package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
- package/interfaces.d.ts +47 -2
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CurveHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
- package/symbols/cim/placements/PlacementOnLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl/formats.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RendererBase.js +5 -0
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoCache.js +1 -1
- package/views/FocusAreas.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/views/webgl/enums.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Search.js +1 -1
- package/assets/esri/core/workers/chunks/386ea90e87254b0282ec.js +0 -1
- package/assets/esri/core/workers/chunks/4046ec636723c20d3e28.js +0 -1
- package/assets/esri/core/workers/chunks/ec83af4fb3bf59df7759.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
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as _}from"../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as p,initial as u,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/interfaces.js";import"../../../../core/accessorSupport/tracking/Flags.js";import"../../../../core/Warning.js";import"../../../../core/Error.js";import{equals as b,invert as A,multiply as T}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as E,create as P}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as R}from"../../../../chunks/vec42.js";import{ZEROS as S}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as I,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as w}from"../../../../geometry/support/Indices.js";import{RenderCategory as O,InternalRenderCategory as N}from"../../webgl.js";import{debugFlags as D}from"../../support/debugFlags.js";import{ColorFormat as y,DepthRenderbuffer16f as x}from"../../webgl/formats.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as L}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as F,isColorOrColorEmission as U}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as v}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as G}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as q}from"../effects/RenderNodes.js";import{RenderPluginManager as V}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as Q}from"../effects/highlight/Highlight.js";import{OITBlend as W}from"../effects/transparency/OITBlend.js";import{AnimationTimer as k}from"./AnimationTimer.js";import{AnimationTimeStep as z}from"./AnimationTimeStep.js";import{RenderRequestType as Y}from"./basicInterfaces.js";import{BoundingInfo as X}from"./BoundingInfo.js";import{DepthRange as K}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as Z}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as $}from"./MainFramebuffer.js";import{RenderOccludedFlag as ee}from"./Material.js";import{OITPass as te}from"./OITPass.js";import{RenderContext as re,defaultRenderOccludedMask as ie}from"./RenderContext.js";import{splitRenderGeometryChangeSetByMaterial as se,RendererTarget as ae}from"./rendererUtils.js";import{setupFeatureDefaults as ne,RenderFeature as he}from"./RenderFeature.js";import{RenderPluginInput as oe}from"./RenderPluginInput.js";import{RenderSlot as de}from"./RenderSlot.js";import{ShadowAccumulator as _e}from"./ShadowAccumulator.js";import{ShadowMap as le,SnapshotSlot as pe}from"./ShadowMap.js";import ue from"./SliceHelper.js";import{Transparency as me}from"./edgeRendering/interfaces.js";import{MergedRenderer as ce}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ge}from"../parts/renderUtils.js";import{RendererPerformanceInfo as fe,PerformanceCategory as be}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Ae}from"../../../support/RenderState.js";import{DepthStencilAttachment as Te,PixelFormat as Ee,PixelType as Pe,FramebufferBit as Re,ColorAttachment1 as Se,ColorAttachment2 as Ie}from"../../../webgl/enums.js";class Ce{constructor(e,t,r,s,a,n){this._stage=e,this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this._renderers=new Map,this.renderPassManager=new L,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=I(0,0,0,1),this._sliceHelper=new ue,this._blit=null,this._oitblend=null,this._state=c(Ae.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new z,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new oe,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new H(s),this._renderStateFeatures=c(ne(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new $(this.fboCache),this.performanceInfo=new fe(this._rctx),this._shadowMap=new le(this.fboCache,e.viewingMode),this._shadowAccumulator=new _e(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((e,t,r)=>{const i=this._stage.view.qualitySettings.maximumPixelRatio;e.shadowMap.start(e.camera,t,r,!0,i),this._renderShadowCascades(F.Shadow,e.shadowMap),e.shadowMap.finish(),e.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(e.camera,e.contentCamera)}),n),this._renderContext=new re(this._rctx,this._shadowMap,r),this._nodes=new q(this._renderContext),this._plugins=new V({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this._handles=[l((()=>this._stage.view.state.camera),(()=>n()),p),l((()=>D.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(me.TRANSPARENT):()=>{},n()}),u),l((()=>this._stage.view.environment.background?.color),(e=>{const t=e?i(e):C;R(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),p),l((()=>this._stage.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=G),p),l((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),m),l((()=>this._bindParameters.clouds.data?.state),(()=>n()),m),l((()=>this._stage.view.state.highlights),(e=>{this._bindParameters.highlights=e,this._updateHighlights(),n()}),u)]}destroy(){this._handles.forEach((e=>e.remove())),this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._renderers.clear(),this._blit=null,this._oitblend=null,X.prune(),ce.prune(),w()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=ne(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(he.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(he.WaterReflection))}get _hasHighlights(){return this._plugins.produces(F.Highlight,de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL,de.DRAPED_MATERIAL,de.HUD_MATERIAL,de.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(F.Highlight,de.HUD_MATERIAL,de.LABEL_MATERIAL)}get hasSSAO(){return(this._stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(he.SSAO))&&!this._inGlobeView}get hasSMAA(){return this._stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(he.Antialiasing)}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(he.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");_(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:ve(this._stage.view.resourceController)});return this._handles.push(l((()=>r.updating),(()=>this._requestRender()),m)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&b(this._bindParameters.ssr.reprojectionMatrix,E)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}getMaterialRenderer(e){return this._renderers.get(e)}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:i,updates:s}=e;if(0===r.length&&0===i.length&&0===s.length)return;se(e).forEach(((e,r)=>{if(t.done)return;let i=this._renderers.get(r);null==i&&e.adds.length>0&&(i=new ce({material:r,highlightOrderMap:this._stage.view.state.highlightOrderMap}),i.initializeRenderContext(this._plugins.context),this._plugins.add(i),this._renderers.set(r,i)),i?(i.modify(e,t),i.updateHighlights(this._stage.view.state.highlightOrderMap),0===i.numGeometries&&(this._renderers.delete(i.material),this._plugins.remove(i),i.destroy())):(e.clear(),t.madeProgress())})),this.updateHasFlags()}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(F.Color,...He),has.water=this._plugins.produces(F.Normal,de.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new k(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=ae.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new ge(this._pluginInput.get(O.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:_}=Z,l=this._stage.view,p=l.stateManager.camera,u=l.qualitySettings.fadeDuration,m=e===Ae.IDLE?r:i,c=s((p.tilt-h)/(o-h),0,1),g=s(((p.position.z??0)-d)/(_-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(u<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const A=t-this._lastFrameTime;this._lastFrameTime=t;const T=Math.max(1-r,Math.abs(r-i)),E=Math.min(T*A/u,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=ae.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ae.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),_=this._nodes.produces(O.FINAL),l=this._nodes.require("emissive",N.TRANSPARENT_ENVIRONMENT,O.COMPOSITE,O.FINAL)>0&&this._plugins.hasEmissions,p=l?F.ColorEmission:F.Color;this._renderContext.time=t,this._renderContext.output=p,this._bindParameters.oitPass=te.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.slicePlane=this._sliceHelper.plane,this._bindParameters.viewshedEnabled=this._nodes.produces(N.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const u=this._framebuffer,m=u.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,l);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(F.Color,...ye);this._precompilePrepasses(),this.performanceInfo.advance(be.PREPARE);const f=this._computeDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(s,a),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,p),this._renderContext.output=p,u.bind(),this._bindParameters.mainDepth=u.depth.attachment;const b=this.plugins.produces(F.Color,...De);b&&this._renderOpaqueGeometry(),u.update((e=>this._renderNodes(O.OPAQUE,e,b))),this.fboCache.debugCallback?.(O.OPAQUE,u.color.fbo),u.update((e=>this._renderNodes(N.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(N.OPAQUE_ENVIRONMENT,u.color.fbo),this._renderTerrainDepth(c),this._renderEdges(me.OPAQUE),u.bind(),this._renderPlugins(de.VOXEL,be.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(we.Geometry,p):this._renderTransparentGeometry()),u.update((e=>this._renderNodes(O.TRANSPARENT,e,g))),this.fboCache.debugCallback?.(O.TRANSPARENT,u.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,de.LINE_CALLOUTS),this._renderEdges(me.TRANSPARENT);const A=this._hasTransparentTerrain?this._renderTransparentTerrain():null;A&&(this.performanceInfo.advance(be.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(v.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,A.getTexture())),this._renderHUD(v.Occluded,u.color,p))),this._bindParameters.cullAboveTerrain=!1,A&&(u.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,A.getTexture()),A.release(),c&&(this._renderEdges(me.OPAQUE),g&&(this._oitEnabled?this._renderOIT(we.Geometry,p):this._renderTransparentGeometry(),this.performanceInfo.advance(be.TRANSPARENT)),this._renderEdges(me.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),c&&this._renderLineCallouts(v.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set(N.FOCUSAREA,this._renderFocusAreaGeometry()),u.update((e=>this._renderNodes(N.TRANSPARENT_ENVIRONMENT,e))),u.update((e=>this._renderNodes(N.VIEWSHED,e))),u.update((e=>this._renderNodes(N.LASERLINES,e))),u.update((e=>this._renderNodes(N.FOCUSAREA_COLOR,e))),u.update((e=>this._renderNodes(N.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass());const T=r===ae.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;u.update((e=>this._renderNodes(O.COMPOSITE,e))),this._pluginInput.release(N.FOCUSAREA);const E=!(r!==ae.Default||_||o&&!i),P=this._pluginInput.get(O.COMPOSITE),R=E?M:this.fboCache.acquire(P.fbo.width,P.fbo.height,N.ANTIALIASING),S=this._nodes.produces(N.ANTIALIASING)?this._renderNodes(N.ANTIALIASING,R):this._blitFBO(P,R,!1);let I;this._pluginInput.set(N.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(v.NotOccluded,S,p),I=this._renderNodes(N.HIGHLIGHTS,S)):(I=this._renderNodes(N.HIGHLIGHTS,S),this._renderHUD(v.NotOccluded,I,p));const C=this._renderNodes(N.MAGNIFIER,I);return o&&!i&&r===ae.Default&&!_&&this._blitFBO(C),_?(C.attachDepth(u.depth),this._blitFBO(this._renderNodes(O.FINAL,C)),C.detachDepth()):this._pluginInput.set(O.FINAL,C),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),u.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ae.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new ge(this._pluginInput.get(O.FINAL),T)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(N.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=F.Depth,this._plugins.precompile(de.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(de.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(N.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(de.OCCLUSION_PIXELS),this._plugins.precompile(de.LINE_CALLOUTS),this._precompileHUD(v.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(N.VIEWSHED,N.LASERLINES,N.FOCUSAREA_COLOR,N.OCCLUDED,N.ANTIALIASING,N.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(v.NotOccluded),this._hasHighlights&&(i.highlights.forEach(((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(F.Highlight)})),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(O.COMPOSITE,N.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_updateHighlights(){const e=this._stage.view.state;this._renderers.forEach((t=>t.updateHighlights(e.highlightOrderMap)))}_renderFocusAreaGeometry(){if(!this._nodes.produces(N.FOCUSAREA))return null;const{width:e,height:t}=this._framebufferSize;let r=this.fboCache.acquire(e,t,N.FOCUSAREA);return r=this._nodes.render(r,this._pluginInput),this.performanceInfo.advance(be.FOCUS_AREA_MASK),r}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(Te),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(be.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===Y.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(C),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Ee.RGBA,Pe.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Ee.RGBA,Pe.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,C),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===me.OPAQUE?be.OPAQUE_EDGES:be.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(be.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(he.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(F.ShadowHighlight,this._shadowMap),i.moveSnapshot(pe.Highlight),this._renderShadowCascades(F.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(pe.ExcludeHighlight),this._renderShadowCascades(F.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(F.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(be.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(F.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(Te):null;t?.retain(),this._pluginInput.set(N.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=d(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(Re.STENCIL),this._renderGeometryWithoutNormals(F.Depth),d(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(be.DEPTH)}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth").acquireDepth(Te);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this.renderAllGeometry(F.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(be.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=F.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(Te);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth").acquireDepth(Te);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(Re.DEPTH|Re.STENCIL),this._renderOpaqueAndTransparentGeometry(F.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return K.zero;const t=J(e,this._plugins.plugins,this._stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals",O.FINAL,O.COMPOSITE,O.OPAQUE,O.TRANSPARENT,N.VIEWSHED,N.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(F.Normal),this._needsDepth&&this._precompileAllGeometry(F.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(F.ShadowHighlight),this._precompileShadowCascades(F.ShadowExcludeHighlight),this._precompileShadowCascades(F.ShadowHighlight)):this._precompileShadowCascades(F.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(F.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",y.RGBA8);r.acquireDepth(Te),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._renderGeometryWithNormals(F.Normal);const i=this._nodes.optional("normals",O.FINAL,O.COMPOSITE,O.OPAQUE,O.TRANSPARENT,N.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(be.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();M.setName(N.SSAO);const t=this._nodes.render(M,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(be.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(de.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...xe);this._renderContext.renderOccludedMask=ie}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t,this._pluginInput)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>ee.Occlude&&this._plugins.render(this._pluginInput,de.OCCLUDED_TERRAIN),this.renderSlots(e,...xe),this._renderContext.renderOccludedMask=ie}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,de.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(F.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(F.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Oe),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Ne)}_precompileOpaqueGeometry(){this._plugins.precompile(...De)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...De)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...ye)}get _hasTransparentTerrain(){return this._plugins.produces(F.Color,de.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,de.TRANSPARENT_TERRAIN);if(!U(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,C),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,de.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",y.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,de.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(be.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===v.Occluded){const e=()=>this._plugins.render(this._pluginInput,de.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(x,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,de.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=F.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&U(this._renderContext.output)?(this._bindParameters.oitPass=te.ColorAlpha,this._plugins.precompile(...He),this._bindParameters.oitPass=te.FrontFace,this._plugins.precompile(...He),this._bindParameters.oitPass=te.NONE):this._plugins.precompile(...He),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(we.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===v.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(x,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(x),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===v.Occluded?be.HUD_OCCLUDED:be.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...He)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(F.ShadowHighlight,de.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>B?y.RG8UI:y.R8UI);a.acquireDepth(Te),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=F.Highlight,t.bindFramebuffer(a.fbo),Q(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(be.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(this._pluginInput,...Me),this._rctx.clear(Re.DEPTH),this._renderHUDElements(v.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.accumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(be.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&U(this._renderContext.output)?(this._bindParameters.oitPass=te.ColorAlpha,this._plugins.precompile(...ye),this._bindParameters.oitPass=te.FrontFace,this._plugins.precompile(...ye),this._bindParameters.oitPass=te.NONE):this._plugins.precompile(...ye)}_renderOIT(e,t,r=v.Both){const i=e===we.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=te.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",_=this.fboCache.acquire(s.width,s.height,d,y.RGBA16F),l=t===F.ColorEmission;l&&_.acquireColor(Se,y.RGBA16F,"emissive"),_.acquireColor(l?Ie:Se,y.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,S),n(),_.detachDepth(),h.oitPass=te.FrontFace;const p=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return l&&p.acquireColor(Se,y.RGBA16F,"emissive"),a?p.acquireDepth(x):p.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(p.fbo),this._rctx.clearFramebuffer(C,!!a),n(),p.detachDepth(),h.oitPass=te.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(Re.COLOR)):this._framebuffer.bind(),this._oitblend??=new W(this._techniques),this._oitblend.blend(this._rctx,_,p,h,l),a?.detachDepth(),p.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(be.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(be.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=M,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=E:(A(Fe,this._bindParameters.camera.viewMatrix),A(Le,this._bindParameters.camera.projectionMatrix),T(Ue,Fe,Le),T(Ue,this._renderContext.lastFrameCamera.viewMatrix,Ue),T(Ue,this._renderContext.lastFrameCamera.projectionMatrix,Ue),this._reprojectionMatrix=Ue);const t=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=E,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(Y.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}}var we;e([f({readOnly:!0})],Ce.prototype,"fullResolutionAtmosphere",null),e([f()],Ce.prototype,"_edgeView",void 0),e([f()],Ce.prototype,"updating",null),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(we||(we={}));const Oe=[de.INTEGRATED_MESH,de.OPAQUE_TERRAIN,de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL],Ne=[de.OPAQUE_MATERIAL_WITHOUT_NORMALS,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],De=[de.INTEGRATED_MESH,de.OPAQUE_TERRAIN,de.OPAQUE_MATERIAL,de.OPAQUE_MATERIAL_WITHOUT_NORMALS],ye=[de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],xe=[de.OPAQUE_MATERIAL,de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],He=[de.LINE_CALLOUTS_HUD_DEPTH,de.HUD_MATERIAL,de.LABEL_MATERIAL],Me=[de.TRANSPARENT_MATERIAL,de.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,de.OPAQUE_MATERIAL,de.OPAQUE_MATERIAL_WITHOUT_NORMALS,de.TRANSPARENT_TERRAIN,de.INTEGRATED_MESH,de.OPAQUE_TERRAIN],Le=P(),Fe=P(),Ue=P();function ve(e){return t=>e.immediate.schedule(t)}export{Ce as Renderer};
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as A,invert as T,multiply as E}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as P,create as R}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as S}from"../../../../chunks/vec42.js";import{ZEROS as I}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as C,ZEROS as w}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as O}from"../../../../geometry/support/Indices.js";import{RenderCategory as N,InternalRenderCategory as D}from"../../webgl.js";import{debugFlags as y}from"../../support/debugFlags.js";import{ColorFormat as x,DepthRenderbuffer16f as H}from"../../webgl/formats.js";import{FBOCache as M,defaultWebGLFBO as L}from"../core/FBOCache.js";import{RenderPassManager as F}from"../core/renderPasses/RenderPassManager.js";import{ShaderOutput as U,isColorOrColorEmission as v}from"../core/shaderLibrary/ShaderOutput.js";import{HUDRenderStyle as G}from"../core/shaderLibrary/hud/HUDRenderStyle.js";import{distanceFadeEnd as q}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as V}from"../effects/RenderNodes.js";import{RenderPluginManager as j}from"../effects/RenderPluginManager.js";import{Blit as B}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as Q,renderHighlightBuffer as W}from"../effects/highlight/Highlight.js";import{OITBlend as k}from"../effects/transparency/OITBlend.js";import{AnimationTimer as z}from"./AnimationTimer.js";import{AnimationTimeStep as Y}from"./AnimationTimeStep.js";import{RenderRequestType as X}from"./basicInterfaces.js";import{BoundingInfo as K}from"./BoundingInfo.js";import{DepthRange as J}from"./DepthRange.js";import{depthRangeFromScene as Z}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as $}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as ee}from"./MainFramebuffer.js";import{RenderOccludedFlag as te}from"./Material.js";import{OITPass as re}from"./OITPass.js";import{RenderContext as ie,defaultRenderOccludedMask as se}from"./RenderContext.js";import{RendererBase as ae}from"./RendererBase.js";import{RendererTarget as ne}from"./rendererUtils.js";import{setupFeatureDefaults as he,RenderFeature as oe}from"./RenderFeature.js";import{RenderPluginInput as de}from"./RenderPluginInput.js";import{RenderSlot as le}from"./RenderSlot.js";import{ShadowAccumulator as _e}from"./ShadowAccumulator.js";import{ShadowMap as ue,SnapshotSlot as pe}from"./ShadowMap.js";import me from"./SliceHelper.js";import{Transparency as ce}from"./edgeRendering/interfaces.js";import{MergedRenderer as ge}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as fe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as be,PerformanceCategory as Ae}from"../statistics/RendererPerformanceInfo.js";import{RenderState as Te}from"../../../support/RenderState.js";import{DepthStencilAttachment as Ee,PixelFormat as Pe,PixelType as Re,FramebufferBit as Se,ColorAttachment1 as Ie,ColorAttachment2 as Ce}from"../../../webgl/enums.js";let we=class extends ae{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new F,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=C(0,0,0,1),this._sliceHelper=new me,this._blit=null,this._oitblend=null,this._state=c(Te.IDLE),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new Y,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new de,this._releaseNormals=e=>{e.some((({name:e})=>"normals"===e))&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this.fboCache=new M(s),this._renderStateFeatures=c(he(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new ee(this.fboCache),this.performanceInfo=new be(this._rctx),this._shadowMap=new ue(this.fboCache,e.viewingMode),this._shadowAccumulator=new _e(this.fboCache,r,e,(e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t}),((t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(U.Shadow,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)}),n),this._renderContext=new ie(this._rctx,this._shadowMap,r),this._nodes=new V(this._renderContext),this._plugins=new j({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_((()=>e.view.state.camera),(()=>n()),u),_((()=>y.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES),(e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(ce.TRANSPARENT):()=>{},n()}),p),_((()=>e.view.environment.background?.color),(e=>{const t=e?i(e):w;S(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()}),u),_((()=>e.view.state.camera.relativeElevation),(e=>this._inGlobeView=(e??1/0)>=q),u),_((()=>this._bindParameters.clouds.fadeFactor),(()=>this._bindParameters.fadeLighting()),m),_((()=>this._bindParameters.clouds.data?.state),(()=>n()),m),_((()=>e.view.state.highlights),(e=>{this._bindParameters.highlights=e,n()}),p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.dispose(),this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),this._plugins.destroy(),this._blit=null,this._oitblend=null,K.prune(),ge.prune(),O()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=he(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate((i=>i.set(t,e,r))),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(oe.HighQualityTransparency)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(oe.WaterReflection))}get _hasHighlights(){return this._plugins.produces(U.Highlight,le.OPAQUE_MATERIAL,le.TRANSPARENT_MATERIAL,le.DRAPED_MATERIAL,le.HUD_MATERIAL,le.LABEL_MATERIAL)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(U.Highlight,le.HUD_MATERIAL,le.LABEL_MATERIAL)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(oe.SSAO))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(oe.Antialiasing)}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(oe.HighResolutionAtmosphere)}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return null!=this._edgeView&&this._edgeView.updating||this._shadowAccumulator.running||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r((async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:Ge(this.stage.view.resourceController)});return this.addHandles(_((()=>r.updating),(()=>this._requestRender()),m)),this._requestRender(),this._edgeViewCallbacks.forEach((e=>e(r))),this._edgeViewCallbacks.length=0,r}))),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&A(this._bindParameters.ssr.reprojectionMatrix,P)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),null!=e.environment){null!=e.environment.weather&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slicePlane(e){this._sliceHelper.plane!==e&&(this._sliceHelper.plane=e,this._requestRender())}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.modify(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(U.Color,...Me),has.water=this._plugins.produces(U.Normal,le.DRAPED_WATER),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new z(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r=ne.Default,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new fe(this._pluginInput.get(N.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=$,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,m=e===Te.IDLE?r:i,c=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const A=t-this._lastFrameTime;this._lastFrameTime=t;const T=Math.max(1-r,Math.abs(r-i)),E=Math.min(T*A/p,n);E>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*E,this._requestRender())}_render(e,t,r=ne.Default,i){this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=r===ne.Default,this._disposeBindBuffers();const{camera:s,contentCamera:a,mode:n,alignPixelEnabled:h}=e;this._state.value=n;const o=this._nodes.produces("magnifier-color"),l=this._nodes.produces(N.FINAL),_=this._nodes.require("emissive",D.TRANSPARENT_ENVIRONMENT,N.COMPOSITE,N.FINAL)>0&&this._plugins.hasEmissions,u=_?U.ColorEmission:U.Color;this._renderContext.time=t,this._renderContext.output=u,this._bindParameters.oitPass=re.NONE,this._bindParameters.alignPixelEnabled=h,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null,this._bindParameters.slicePlane=this._sliceHelper.plane,this._bindParameters.viewshedEnabled=this._nodes.produces(D.VIEWSHED),this._renderOverlay(t),s.setGLViewport(this._rctx);const p=this._framebuffer,m=p.initialize(s.fullWidth,s.fullHeight,this._backgroundColor,_);this.hasReflections?(m?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=m):m?.release(),this._ensureBindParametersCamera(s,a),this._updateHUDOccludedFragmentOpacity(n,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const c=this._highQualityTransparency&&this._hasTransparentTerrain,g=this._plugins.produces(U.Color,...xe);this._precompilePrepasses(),this.performanceInfo.advance(Ae.PREPARE);const f=this._computeDepthRange(s);this._renderShadowMap(s,this._bindParameters.lighting.mainLight.direction,f),this._ensureBindParametersCamera(s,a),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(f,s,a),this._ensureBindParametersSSR(t),this._precompileShaders(c,g,u),this._renderContext.output=u,p.bind(),this._bindParameters.mainDepth=p.depth.attachment;const b=this.plugins.produces(U.Color,...ye);b&&this._renderOpaqueGeometry(),p.update((e=>this._renderNodes(N.OPAQUE,e,b))),this.fboCache.debugCallback?.(N.OPAQUE,p.color.fbo),p.update((e=>this._renderNodes(D.OPAQUE_ENVIRONMENT,e))),this.fboCache.debugCallback?.(D.OPAQUE_ENVIRONMENT,p.color.fbo),this._renderTerrainDepth(c),this._renderEdges(ce.OPAQUE),p.bind(),this._renderPlugins(le.VOXEL,Ae.VOXEL),this._renderHiddenTransparentEdges(),g&&(this._oitEnabled?this._renderOIT(Oe.Geometry,u):this._renderTransparentGeometry()),p.update((e=>this._renderNodes(N.TRANSPARENT,e,g))),this.fboCache.debugCallback?.(N.TRANSPARENT,p.color.fbo),this._renderGeometryDepth(c),this._renderHUDVisibility(),c||this._plugins.render(this._pluginInput,le.LINE_CALLOUTS),this._renderEdges(ce.TRANSPARENT);const A=this._hasTransparentTerrain?this._renderTransparentTerrain():null;A&&(this.performanceInfo.advance(Ae.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(c?this._renderLineCallouts(G.Occluded):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,A.getTexture())),this._renderHUD(G.Occluded,p.color,u))),this._bindParameters.cullAboveTerrain=!1,A&&(p.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,A.getTexture()),A.release(),c&&(this._renderEdges(ce.OPAQUE),g&&(this._oitEnabled?this._renderOIT(Oe.Geometry,u):this._renderTransparentGeometry(),this.performanceInfo.advance(Ae.TRANSPARENT)),this._renderEdges(ce.TRANSPARENT))),this._bindParameters.ssao=d(this._bindParameters.ssao),c&&this._renderLineCallouts(G.NotOccluded),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment(),this._pluginInput.set(D.FOCUSAREA,this._renderFocusAreaGeometry()),p.update((e=>this._renderNodes(D.TRANSPARENT_ENVIRONMENT,e))),p.update((e=>this._renderNodes(D.VIEWSHED,e))),p.update((e=>this._renderNodes(D.LASERLINES,e))),p.update((e=>this._renderNodes(D.FOCUSAREA_COLOR,e))),p.update((e=>this._renderNodes(D.OCCLUDED,e))),this._pluginInput.set("highlights",this._renderHighlightPrepass());const T=r===ne.ObjectAndLayerID?this._renderObjectAndLayerIdColor():null;p.update((e=>this._renderNodes(N.COMPOSITE,e))),this._pluginInput.release(D.FOCUSAREA);const E=!(r!==ne.Default||l||o&&!i),P=this._pluginInput.get(N.COMPOSITE),R=E?L:this.fboCache.acquire(P.fbo.width,P.fbo.height,D.ANTIALIASING),S=this._nodes.produces(D.ANTIALIASING)?this._renderNodes(D.ANTIALIASING,R):this._blitFBO(P,R,!1);let I;this._pluginInput.set(D.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(G.NotOccluded,S,u),I=this._renderNodes(D.HIGHLIGHTS,S)):(I=this._renderNodes(D.HIGHLIGHTS,S),this._renderHUD(G.NotOccluded,I,u));const C=this._renderNodes(D.MAGNIFIER,I);return o&&!i&&r===ne.Default&&!l&&this._blitFBO(C),l?(C.attachDepth(p.depth),this._blitFBO(this._renderNodes(N.FINAL,C)),C.detachDepth()):this._pluginInput.set(N.FINAL,C),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),p.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),r!==ne.Default&&(this._releaseFBOs(),this._disposeOffscreenBuffers()),new fe(this._pluginInput.get(N.FINAL),T)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(D.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=U.Depth,this._plugins.precompile(le.TRANSPARENT_TERRAIN),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(le.TRANSPARENT_TERRAIN),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(D.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(le.OCCLUSION_PIXELS),this._plugins.precompile(le.LINE_CALLOUTS),this._precompileHUD(G.Occluded),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(D.VIEWSHED,D.LASERLINES,D.FOCUSAREA_COLOR,D.OCCLUDED,D.ANTIALIASING,D.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(G.NotOccluded),this._hasHighlights&&(i.highlights.forEach(((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(U.Highlight)})),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(N.COMPOSITE,D.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){if(!this._nodes.produces(D.FOCUSAREA))return null;const{width:e,height:t}=this._framebufferSize;let r=this.fboCache.acquire(e,t,D.FOCUSAREA);return r=this._nodes.render(r,this._pluginInput),this.performanceInfo.advance(Ae.FOCUS_AREA_MASK),r}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(Ee),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(Ae.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=e===X.BACKGROUND;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear-depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(w),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],Pe.RGBA,Re.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,Pe.RGBA,Re.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"edges"),s=()=>t.render(this._bindParameters,e),a=this._bindParameters.geometryDepth;this.renderToTargets(s,i,a??this._framebuffer.depth,w),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,i.getTexture()),i.release(),this.performanceInfo.advance(e===ce.OPAQUE?Ae.OPAQUE_EDGES:Ae.TRANSPARENT_EDGES)}_renderOverlay(e){this._bindParameters.overlay=this.overlay?.render(e),this._bindParameters.overlay&&this.performanceInfo.advance(Ae.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const i=this._shadowMap;i.start(e,t,r,this.isFeatureEnabled(oe.HighResolutionShadows),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(U.ShadowHighlight,this._shadowMap),i.moveSnapshot(pe.Highlight),this._renderShadowCascades(U.ShadowExcludeHighlight,this._shadowMap),i.copySnapshot(pe.ExcludeHighlight),this._renderShadowCascades(U.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(U.Shadow),i.finish(),e.setGLViewport(this._rctx),this.performanceInfo.advance(Ae.SHADOW_MAP)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(U.Depth)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._needsShadowAccumulation||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");if(e){const t=this._needsDepth?e.getAttachment(Ee):null;t?.retain(),this._pluginInput.set(D.SSAO,this._renderSSAO()),this._renderGeometryWithoutNormalsDepth(t)}else this._renderAllGeometryDepth()}_renderGeometryWithoutNormalsDepth(e){if(!this._needsDepth||!e)return void(this._bindParameters.depth=d(this._bindParameters.depth));const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"depth");r.attachDepth(e),e.release(),this._rctx.bindFramebuffer(r.fbo),this._rctx.clear(Se.STENCIL),this._renderGeometryWithoutNormals(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=r.obtainDepthTexture(),r.release(),this.performanceInfo.advance(Ae.DEPTH)}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"depth").acquireDepth(Ee);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(Se.DEPTH|Se.STENCIL),this.renderAllGeometry(U.Depth),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(Ae.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=U.Depth;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth").acquireDepth(Ee);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(Se.DEPTH|Se.STENCIL),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth").acquireDepth(Ee);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(Se.DEPTH|Se.STENCIL),this._renderOpaqueAndTransparentGeometry(U.Depth),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowAccumulation}_computeDepthRange(e){if(!this._needsDepthRange)return J.zero;const t=Z(e,this._plugins.plugins,this.stage.layers);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}get _normalsRequired(){const e=this._nodes.require("normals",N.FINAL,N.COMPOSITE,N.OPAQUE,N.TRANSPARENT,D.VIEWSHED,D.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(U.Normal),this._needsDepth&&this._precompileAllGeometry(U.Depth),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(U.ShadowHighlight),this._precompileShadowCascades(U.ShadowExcludeHighlight),this._precompileShadowCascades(U.ShadowHighlight)):this._precompileShadowCascades(U.Shadow)),this._needsShadowAccumulation&&this._precompileAllGeometry(U.Shadow)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",x.RGBA8);r.acquireDepth(Ee),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(w,!0,!0),this._renderGeometryWithNormals(U.Normal);const i=this._nodes.optional("normals",N.FINAL,N.COMPOSITE,N.OPAQUE,N.TRANSPARENT,D.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(Ae.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return void e?.detachDepth();L.setName(D.SSAO);const t=this._nodes.render(L,this._pluginInput);return this._bindParameters.ssao=t,e.detachDepth(),this._pluginInput.release("normals"),this.performanceInfo.advance(Ae.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(le.TRANSPARENT_TERRAIN),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...He);this._renderContext.renderOccludedMask=se}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll((e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t,this._pluginInput)}))}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>te.Occlude&&this._plugins.render(this._pluginInput,le.OCCLUDED_TERRAIN),this.renderSlots(e,...He),this._renderContext.renderOccludedMask=se}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,le.HUD_MATERIAL)}precompileViewshedShadowMap(){this._precompileAllGeometry(U.ViewshedShadow)}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(U.ViewshedShadow),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...Ne),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(this._pluginInput,...De)}_precompileOpaqueGeometry(){this._plugins.precompile(...ye)}_renderOpaqueGeometry(){this._plugins.render(this._pluginInput,...ye)}_renderTransparentGeometry(){this._plugins.render(this._pluginInput,...xe)}get _hasTransparentTerrain(){return this._plugins.produces(U.Color,le.TRANSPARENT_TERRAIN)}_renderTransparentTerrain(){const e=()=>this._plugins.render(this._pluginInput,le.TRANSPARENT_TERRAIN);if(!v(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,w),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,le.OCCLUSION_PIXELS)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",x.RGBA4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(this._pluginInput,le.OCCLUSION_PIXELS),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(Ae.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===G.Occluded){const e=()=>this._plugins.render(this._pluginInput,le.LINE_CALLOUTS),t=this._framebufferSize,r=this.fboCache.acquireDepth(H,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(this._pluginInput,le.LINE_CALLOUTS)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=U.Highlight,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&v(this._renderContext.output)?(this._bindParameters.oitPass=re.ColorAlpha,this._plugins.precompile(...Me),this._bindParameters.oitPass=re.FrontFace,this._plugins.precompile(...Me),this._bindParameters.oitPass=re.NONE):this._plugins.precompile(...Me),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(Oe.HUD,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,e===G.Occluded){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(H,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(H),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(e===G.Occluded?Ae.HUD_OCCLUDED:Ae.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(this._pluginInput,...Me)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(U.ShadowHighlight,le.OPAQUE_MATERIAL)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>Q?x.RG8UI:x.R8UI);a.acquireDepth(Ee),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=U.Highlight,t.bindFramebuffer(a.fbo),W(t,e,i,r,(()=>this._renderHighlightGeometries())),this.performanceInfo.advance(Ae.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(this._pluginInput,...Le),this._rctx.clear(Se.DEPTH),this._renderHUDElements(G.Both)}get _needsShadowAccumulation(){return this._shadowAccumulator.accumulating}_renderShadowAccumulation(e,t,r){this._needsShadowAccumulation&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,e,t,r)&&this.performanceInfo.advance(Ae.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&v(this._renderContext.output)?(this._bindParameters.oitPass=re.ColorAlpha,this._plugins.precompile(...xe),this._bindParameters.oitPass=re.FrontFace,this._plugins.precompile(...xe),this._bindParameters.oitPass=re.NONE):this._plugins.precompile(...xe)}_renderOIT(e,t,r=G.Both){const i=e===Oe.HUD,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=re.ColorAlpha;const d=a?"oit hud color+alpha":"oit color+alpha",l=t===U.ColorEmission,_=this.fboCache.acquire(s.width,s.height,d,l?x.RGBA16F:x.RGBA16F_NEAREST);l&&_.acquireColor(Ie,x.RGBA16F,"emissive"),_.acquireColor(l?Ce:Ie,x.R16F),a||_.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(_.fbo),this._rctx.clearFramebuffer([0,0,0,1]),l&&this._rctx.clearBuffer(1,I),n(),_.detachDepth(),h.oitPass=re.FrontFace;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return l&&u.acquireColor(Ie,x.RGBA16F,"emissive"),a?u.acquireDepth(H):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(w,!!a),n(),u.detachDepth(),h.oitPass=re.NONE,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(Se.COLOR)):this._framebuffer.bind(),this._oitblend??=new k(this._techniques),this._oitblend.blend(this._rctx,_,u,h,l),a?.detachDepth(),u.release(),_.release(),this._renderContext.output=o,a}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(Ae.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(this._pluginInput,le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH),this.performanceInfo.advance(Ae.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(this._pluginInput,e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}_blitFBO(e,t=L,r=!0){return this._blit??=new B(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=P:(T(Ue,this._bindParameters.camera.viewMatrix),T(Fe,this._bindParameters.camera.projectionMatrix),E(ve,Ue,Fe),E(ve,this._renderContext.lastFrameCamera.viewMatrix,ve),E(ve,this._renderContext.lastFrameCamera.projectionMatrix,ve),this._reprojectionMatrix=ve);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=P,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(X.UPDATE)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};var Oe;e([f({readOnly:!0})],we.prototype,"fullResolutionAtmosphere",null),e([f()],we.prototype,"_edgeView",void 0),e([f()],we.prototype,"updating",null),we=e([b("esri.views.3d.webgl-engine.lib.Renderer")],we),function(e){e[e.Geometry=0]="Geometry",e[e.HUD=1]="HUD"}(Oe||(Oe={}));const Ne=[le.INTEGRATED_MESH,le.OPAQUE_TERRAIN,le.OPAQUE_MATERIAL,le.TRANSPARENT_MATERIAL],De=[le.OPAQUE_MATERIAL_WITHOUT_NORMALS,le.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],ye=[le.INTEGRATED_MESH,le.OPAQUE_TERRAIN,le.OPAQUE_MATERIAL,le.OPAQUE_MATERIAL_WITHOUT_NORMALS],xe=[le.TRANSPARENT_MATERIAL,le.TRANSPARENT_MATERIAL_WITHOUT_NORMALS],He=[le.OPAQUE_MATERIAL,le.TRANSPARENT_MATERIAL,le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH],Me=[le.LINE_CALLOUTS_HUD_DEPTH,le.HUD_MATERIAL,le.LABEL_MATERIAL],Le=[le.TRANSPARENT_MATERIAL,le.TRANSPARENT_MATERIAL_WITHOUT_NORMALS,le.OPAQUE_MATERIAL,le.OPAQUE_MATERIAL_WITHOUT_NORMALS,le.TRANSPARENT_TERRAIN,le.INTEGRATED_MESH,le.OPAQUE_TERRAIN],Fe=R(),Ue=R(),ve=R();function Ge(e){return t=>e.immediate.schedule(t)}export{we as Renderer};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{splitRenderGeometryChangeSetByMaterial as o}from"./rendererUtils.js";import{MergedRenderer as a}from"../materials/renderers/MergedRenderer.js";let d=class extends r{constructor(e){super(e),this._renderers=new Map}destroy(){this._renderers.forEach((e=>e.destroy())),this._renderers.clear()}initialize(){this.addHandles(t((()=>this.stage.view.state.highlights),(()=>this.updateHighlights())))}getMaterialRenderer(e){return this._renderers.get(e)}updateHighlights(){this.renderers.forEach((e=>e.updateHighlights(this.stage.view.state.highlightOrderMap)))}modify(e,r,t,s){const{adds:i,removes:d,updates:n}=e;if(0===i.length&&0===d.length&&0===n.length)return!1;o(e).forEach(((e,i)=>{if(r.done)return;let o=this._renderers.get(i);null==o&&e.adds.length>0&&(o=new a({material:i,highlightOrderMap:this.stage.view.state.highlightOrderMap}),o.initializeRenderContext(t,s),this.rendererAdded(o),this._renderers.set(i,o)),o?(o.modify(e,r),o.updateHighlights(this.stage.view.state.highlightOrderMap),0===o.numGeometries&&(this._renderers.delete(o.material),this.rendererRemoved(o),o.destroy())):(e.clear(),r.madeProgress())}));let h=0;for(const o of this._renderers.values())o.drapedPriority=h++;return!0}get canCompact(){for(const e of this._renderers.values())if(e.canCompact)return!0;return!1}compact(e){let r=!1;for(const t of this._renderers.values()){if(e.done)return r;r=t.compact(e)||r}return r}get renderers(){return this._renderers}};e([s({constructOnly:!0})],d.prototype,"stage",void 0),d=e([i("esri.views.3d.webgl-engine.lib.RendererBase")],d);export{d as RendererBase};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../core/has.js";import{someMap as r}from"../../../../core/MapUtils.js";import t from"../../../../core/PooledArray.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as i}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{a as o}from"../../../../chunks/sphere.js";import{OverlayTarget as a}from"../../terrain/Intersector.js";import{ShaderOutput as d}from"../core/shaderLibrary/ShaderOutput.js";import{ChangeSet as h}from"./ChangeSet.js";import{newIntersectorResult as l}from"./Intersector.js";import{StoreResults as c,IntersectorType as p}from"./IntersectorInterfaces.js";import{RenderOccludedFlag as m}from"./Material.js";import{DirtyOperation as u,DirtyState as g}from"./ModelDirtyTypes.js";import{RendererBase as y}from"./RendererBase.js";import{RenderSlot as _}from"./RenderSlot.js";import{noBudget as f}from"../../../support/Scheduler.js";let R=class extends y{constructor(e){super(e),this._pending=new G,this._changes=new h,this._sortedRenderers=new t,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this._changes.prune(),this._sortedRenderers.clear(),this._geometries.clear(),this._pending.clear()}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _materials(){return this.rendererContext.materials}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return r(this.renderers,(r=>r.hasHighlight(e)))}get hasWater(){return this._hasWater}get rendersOccludedDraped(){for(const e of this.renderers.values())if(0!==e.numGeometries&&!e.queryRenderOccludedState(m.Occlude))return!0;return!1}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return this._processAddsRemoves(),!!this.modify(this._changes,f,this.rendererContext.pluginContext,this._materials)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=r(this.renderers,(e=>{const r=e.produces.get(_.DRAPED_MATERIAL);return!!r&&r(d.Highlight)})),this._hasWater=r(this.renderers,(e=>{const r=e.produces.get(_.DRAPED_WATER);return!!r&&r(d.Normal)})),this.notifyChange("updating"),!0)}rendererAdded(){this._sortedRenderers.clear()}rendererRemoved(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const i of t)this._geometries.set(i.id,i);const s=this._pending.empty;for(const i of t)this._pending.adds.add(i);s&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,r){const t=this._pending.empty,s=this._pending.adds;for(const i of e)s.has(i)?(this._pending.removed.add(i),s.delete(i)):this._pending.removed.has(i)||this._pending.removes.add(i),this._geometries.delete(i.id);t&&!this._pending.empty&&this.notifyChange("updating"),r===u.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const s of e){const e=this._changes.updates.pushNew();e.renderGeometry=this._validateRenderGeometry(s),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case g.TRANSFORMATION:case g.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case g.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll((t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r)),r}precompile(e){return this._sortedRenderers.reduce(((r,t)=>t.precompile(e)||r),!1)}render(e){this._sortedRenderers.forAll((r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)}))}intersect(e,r,t,s,i){for(const n of this._geometries.values()){if(!s(n))continue;this._intersectRenderGeometry(n,t,r,0,e,i);const o=this.rendererContext.longitudeCyclical;o&&(n.boundingSphere[0]-n.boundingSphere[3]<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,i),n.boundingSphere[0]+n.boundingSphere[3]>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,i)),i++}return i}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort(((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0)))}}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes)),this._changes.updates.filterInPlace((({renderGeometry:e})=>!this._pending.has(e))),this._pending.clear()}_intersectRenderGeometry(e,r,t,s,i,n){if(!e.visible||!e.material.visible)return;let o=0;s+=e.transformation[12],o=e.transformation[13],C[0]=t[0]-s,C[1]=t[1]-o,e.screenToWorldRatio=this.rendererContext.screenToWorldRatio,e.material.intersectDraped(e,null,i,C,((t,s,o)=>{v(r,o,n,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)}),r)}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._validateRenderGeometry(r);return e}_validateRenderGeometry(e){return null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(o(e.boundingSphere))),e}get test(){}};e([s({constructOnly:!0})],R.prototype,"drapeSource",void 0),e([s({constructOnly:!0})],R.prototype,"rendererContext",void 0),e([s()],R.prototype,"updating",null),e([s()],R.prototype,"rctx",null),e([s()],R.prototype,"_materials",null),e([s()],R.prototype,"_localOriginFactory",null),e([s({readOnly:!0})],R.prototype,"isEmpty",null),e([s()],R.prototype,"_geometries",void 0),R=e([i("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],R);class G{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function v(e,r,t,s,i,n,o){const d=new a(n,o,r),h=r=>{r.set(p.OVERLAY,d,e.dist,e.normal,e.transformation,t,s)};if((null==i.results.min.drapedLayerOrder||t>=i.results.min.drapedLayerOrder)&&(null==i.results.min.dist||i.results.ground.dist<=i.results.min.dist)&&h(i.results.min),i.options.store!==c.MIN&&(null==i.results.max.drapedLayerOrder||t<i.results.max.drapedLayerOrder)&&(null==i.results.max.dist||i.results.ground.dist>i.results.max.dist)&&h(i.results.max),i.options.store===c.ALL){const e=l(i.ray);h(e),i.results.all.push(e)}}const C=n();export{R as SortedRenderGeometryRenderer};
|
|
@@ -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 e from"../../../../core/Error.js";import t from"../../../../core/Evented.js";import{disposeMaybe as r,removeMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as
|
|
5
|
+
import"../../../../core/has.js";import e from"../../../../core/Error.js";import t from"../../../../core/Evented.js";import{disposeMaybe as r,removeMaybe as s}from"../../../../core/maybe.js";import{throwIfAborted as a,onAbort as i,createAbortError as o}from"../../../../core/promiseUtils.js";import{isUint8Array as n,isArrayBuffer as l}from"../../../../core/typedArrayUtil.js";import{isBlobProtocol as m,isDataProtocol as h}from"../../../../core/urlUtils.js";import{requestImage as p}from"../../../../support/requestImageUtils.js";import{loadImageAsync as d}from"../../../../support/requestUtils.js";import{TextureEncodingMimeType as _}from"./basicInterfaces.js";import{createTextureKTX2 as c,createTextureBasis as u,estimateMemoryKTX2 as g,estimateMemoryBasis as T}from"./BasisUtil.js";import{ContentObject as E}from"./ContentObject.js";import{ContentObjectType as x}from"./ContentObjectType.js";import{createDDSTexture as y}from"./DDSUtil.js";import{ensureImageMaxSize as f}from"./textureUtils.js";import{assert as A}from"./Util.js";import{TextureWrapMode as D,TextureSamplingMode as I,PixelFormat as F}from"../../../webgl/enums.js";import{Texture as M}from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";class C extends E{constructor(e,r){super(),this._data=e,this.type=x.Texture,this.events=new t,this._parameters={...P,...r},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!(m(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){h(e.src)||m(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new w;return t.wrapMode=this._parameters.wrap??D.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?I.LINEAR_MIPMAP_LINEAR:I.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture??this._emptyTexture}get loaded(){return null!=this._glTexture}get usedMemory(){return this._glTexture?.usedMemory||L(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._glTexture)return this._glTexture;const t=this._data;return null==t?(this._glTexture=new M(e,this._createDescriptor(e),null),this._glTexture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):n(t)&&this._parameters.encoding===_.DDS_ENCODING?this._loadFromDDSData(e,t):l(t)&&this._parameters.encoding===_.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(l(t)||n(t))&&this._parameters.encoding===_.KTX2_ENCODING?this._loadFromKTX2(e,t):(l(t)||n(t))&&this._parameters.encoding===_.BASIS_ENCODING?this._loadFromBasis(e,t):n(t)?this._loadFromPixelData(e,t):l(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_update(e,t){return null==this._glTexture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=y(e,this._createDescriptor(e),t),this._emptyTexture=null,this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>c(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>u(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){A(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?F.LUMINANCE:3===this._parameters.components?F.RGB:F.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new M(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const s=await p(t,{signal:r});return a(r),this._loadFromImage(e,s)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const s=await d(t,t.src,!1,r);return a(r),this._loadFromImage(e,s)}))}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(t,r){return this._loadAsync((a=>new Promise(((n,l)=>{const m=()=>{r.removeEventListener("loadeddata",h),r.removeEventListener("error",p),s(d)},h=()=>{r.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(m(),n(this._loadFromImage(t,r)))},p=t=>{m(),l(t||new e("texture:load-error","Failed to load video"))};r.addEventListener("loadeddata",h),r.addEventListener("error",p);const d=i(a,(()=>p(o())))}))))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=f(r,e.parameters));const s=j(r);this._parameters.width=s.width,this._parameters.height=s.height;const a=this._createDescriptor(e);return a.pixelFormat=3===this._parameters.components?F.RGB:F.RGBA,a.width=s.width,a.height=s.height,a.compressionHandle=this._parameters.compressionHandle,a.compressionCallback=this._parameters.compressionCallback,this._glTexture=new M(e,a,r),this._emptyTexture=null,this.events.emit("loaded"),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const s=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(s,s),r}unload(){if(this._glTexture=r(this._glTexture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function L(e,t){if(null==e)return 0;if(l(e)||n(e))return t.encoding===_.KTX2_ENCODING?g(e,!!t.mipmap):t.encoding===_.BASIS_ENCODING?T(e,!!t.mipmap):e.byteLength;const{width:r,height:s}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?j(e):t;return(t.mipmap?4/3:1)*r*s*(t.components||4)||0}function j(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const P={wrap:{s:D.REPEAT,t:D.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};export{C as Texture};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as a}from"../../../../../core/NestedMap.js";import o from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as m}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as A}from"./Instance.js";import{PerBufferData as E,hasVao as M}from"./PerBufferData.js";import{PerOriginData as B}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let S=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){q??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,m(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.cachedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach((t=>{t.buffers.forEach((t=>{t.updateHighlights(e),t.highlightNames.forEach((e=>this._highlightNames.add(e)))}))})),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:a,updateType:o}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(a.localOrigin.id),l=n?.findBuffer(a.id);if(null==l)return;const h=l.instances.get(a.id);if(o&(_.GEOMETRY|_.TRANSFORMATION)){const e=G(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(a,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}o&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new a;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new D(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let a=r.get(e.id,s);null==a&&(a=new D(e.vec3),r.set(e.id,s,a)),a.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const a=r.vertexBufferLayout.stride/4,o=this._computeDeltas(e.adds,e.removes);o.forEach(((e,n)=>{const l=e.get(null),h=l?.changes??[];o.delete(n,null);let u=i.get(n);if(e.forEach(((e,l)=>{if(o.delete(n,l),null==l)return void w(!1,"No VAO for removed geometries");if(l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.byteSize/4,d=h.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),m=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),g=Math.min((f+d-m)*a,W),p=g>c;g>N&&g<c/2?(e.changes.forEach((({id:e})=>l.deleteInstance(e))),l.instances.forEach((({geometry:e})=>h.push(e))),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)})),h.length>0)for(null==u&&(u=new B(l.origin),i.set(n,u)),u.buffers.forEach((e=>this._applyAdds(e,h)));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))})),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,a=s/4,o=Math.floor(W/a);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>o&&n>0){t.push(r);break}n+=s;const a=new A(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,a)}const l=n*a,h=G(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(U(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*a),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const o of t.changes){const t=o.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),q&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const a=L.back();if(a){if(a.to===s.from){a.to=s.to;continue}if(a.from===s.to){a.from=s.from;continue}}const n=L.pushNew();n.from=s.from,n.to=s.to}O(L);const s=this._bufferWriter.vertexBufferLayout.stride/4,a=e.vao.vertexBuffers.get("geometry");if(q){const t=(i-r)*s,o=G(t),n=this._bufferWriter.vertexBufferLayout.createView(o.buffer);o.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)})),a.setSubData(o,r*s,0,t)}else{const e=L.reduce(((e,t)=>Math.max(e,t.numElements)),0)*s,t=G(e);t.fill(0,0,e),L.forAll((e=>a.setSubData(t,e.from*s,0,e.numElements*s)))}e.holes.pushArray(L.data,L.length),L.forAll(((e,t)=>L.data[t]=null)),L.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!M(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,a=e.numElements,o=t.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),n=Math.min((a+o)*s,W),l=4*n;if(e.vao.byteSize<U(W-N)&&l>e.vao.byteSize)return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=R(e.holes,t);h.push(s),q&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let d=0,m=0,g=0;const p=G(q?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach(((t,r)=>{const a=h[r];if(null==a)return;const o=i.elementCount(t.geometry.attributes);if(!q){if(!(g===a)){const e=g-m;e>0&&c.setSubData(p,m*s,0,e*s),m=a,d=0}this._writeGeometry(t,y,d),d+=o,g=a+o}const n=new A(t,a,a+o,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0})),q){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)})),m=u,g=f}const _=g-m;_>0&&c.setSubData(p,m*s,0,_*s),r(t,((e,t)=>null==h[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(H,e.transformation),H[12]-=e.localOrigin.vec3[0],H[13]-=e.localOrigin.vec3[1],H[14]-=e.localOrigin.vec3[2],f(j,H),c(j,j),this._bufferWriter.write(H,j,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlight:s,slot:a}=r,o=t===g.ShadowHighlight,n=t===g.Highlight,l=n||o,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:d}of this._dataByOrigin.values())for(const i of d){if(u(i.highlightNames))continue;const s=o?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,a,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:a}=i,n=r===g.Highlight,l=a?.name??"";if(n&&!a)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),d=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:m}=e;m.runAppleAmdDriverHelper();const p=m.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new o;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,a=h?r():u?s?[s]:V:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=a.some((e=>e.length>0)),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),m.bindVAO(e.vao),y)for(const e of a)m.setPipelineState(t.getPipeline(!1,d)),e.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count)));_?.length&&(m.setPipelineState(t.getPipeline(!0,d)),_.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count))))}}}static prune(){z=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],S.prototype,"material",void 0),e([l({})],S.prototype,"highlightOrderMap",void 0),S=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],S);class D{constructor(e){this.origin=e,this.changes=new Array}}function R(e,t){const r=e.find((e=>e.numElements>=t));if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const H=d(),j=d(),L=new o({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,P=1024,T=16777216,W=T/4;let z=new Float32Array(N);function G(e){return z.length<e&&(z=new Float32Array(e)),z}function U(e){const t=4*e;return t<=P?P:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,T),t)}const V=[];let q;export{S as MergedRenderer,U as sizeForVao};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{removeUnordered as t,filterInPlace as r}from"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import{nextHighestPowerOfTwo as i}from"../../../../../core/mathUtils.js";import{disposeMaybe as s}from"../../../../../core/maybe.js";import{NestedMap as o}from"../../../../../core/NestedMap.js";import a from"../../../../../core/PooledArray.js";import{addMany as n}from"../../../../../core/SetUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/Logger.js";import{subclass as h}from"../../../../../core/accessorSupport/decorators/subclass.js";import{copy as u,invert as f,transpose as c}from"../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as d}from"../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{glLayout as m}from"../../../support/buffer/glUtil.js";import{ShaderOutput as g}from"../../core/shaderLibrary/ShaderOutput.js";import{SyncRenderPlugin as p}from"../../effects/RenderPlugin.js";import{GLMaterials as y}from"../../lib/GLMaterials.js";import{DirtyState as _}from"../../lib/ModelDirtyTypes.js";import{RenderSlot as b}from"../../lib/RenderSlot.js";import{assert as w}from"../../lib/Util.js";import{DrawParameters as v}from"../DrawParameters.js";import{BufferRange as C,mergeAdjacentRanges as O}from"./BufferRange.js";import{Instance as A}from"./Instance.js";import{PerBufferData as E,hasVao as B}from"./PerBufferData.js";import{PerOriginData as M}from"./PerOriginData.js";import{defaultHighlightName as x}from"../../../../support/HighlightDefaults.js";let D=class extends p{get _hasHighlights(){return this._highlightNames.size>0}hasHighlight(e){return this._highlightNames.has(e)}constructor(e){super(e),this._dataByOrigin=new Map,this._drawParameters=new v,this._highlightNames=new Set,this.drapedPriority=0,this._produces=new Map,this._hasOccludees=!1}destroy(){this._glMaterials=s(this._glMaterials),this._dataByOrigin.forEach((e=>e.dispose())),this._dataByOrigin.clear(),this._vaoCache=null}initialize(){this._updateProduces()}_updateProduces(){this.material.produces.forEach(((e,t)=>{this._produces.set(t,(t=>!(0===this._dataByOrigin.size||!(t!==g.Highlight&&t!==g.ShadowHighlight||this._hasHighlights))&&e(t)))}))}initializeRenderContext(e,t){q??=e.renderContext.rctx.isAssumedMetalDriver,this._glMaterials=new y(this.material,t??e.materials),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=e.renderContext.rctx.getVaoCache(this.material.vertexAttributeLocations,m(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get produces(){return this._produces}get hasOccludees(){return this._hasOccludees}get hasEmissions(){return this.material.hasEmissions}get isDecoration(){return this.material.parameters.isDecoration}queryRenderOccludedState(e){return this.material.queryRenderOccludedState(e)}get numGeometries(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.instances.size),0))),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach((t=>e+=t.buffers.reduce(((e,t)=>e+t.vao.cachedMemory),0))),e}forEachGeometry(e){this._dataByOrigin.forEach((t=>t.buffers.forEach((t=>t.instances.forEach((({geometry:t})=>e(t)))))))}modify(e,t){this._applyUpdates(e,t),this._applyAddsAndRemoves(e),this._updateDrawCommands()}get canCompact(){for(const e of this._dataByOrigin.values())if(e.buffers.some((e=>e.holes.length>1)))return!0;return!1}compact(e){if(!this.canCompact)return!1;let t=!1;for(const r of this._dataByOrigin.values()){const i=new Array;for(let t=0;t<r.buffers.length&&!e.done;){const s=r.buffers[t];s.holes.length<=1?++t:(s.instances.forEach((({geometry:e})=>i.push(e))),this._vaoCache.deleteVao(s.vao),r.buffers[t]=r.buffers[r.buffers.length-1],--r.buffers.length,e.madeProgress())}if(i.length>0){for(r.buffers.forEach((e=>this._applyAdds(e,i)));i.length>0;)r.buffers.push(this._applyAndRebuild(new E,i,null));t=!0}}return t}updateHighlights(e){this.highlightOrderMap=e,this._highlightNames.clear(),this._dataByOrigin.forEach((t=>{t.buffers.forEach((t=>{t.updateHighlights(e),t.highlightNames.forEach((e=>this._highlightNames.add(e)))}))})),this._updateProduces()}_applyUpdates(e,t){const r=this._bufferWriter;if(null==r)return void e.clearUpdates();const i=r.vertexBufferLayout.stride/4;for(const s of e.updates){if(t.done)return;const{renderGeometry:o,updateType:a}=s;e.pending.updates.removeUnordered(s),t.madeProgress();const n=this._dataByOrigin.get(o.localOrigin.id),l=n?.findBuffer(o.id);if(null==l)return;const h=l.instances.get(o.id);if(a&(_.GEOMETRY|_.TRANSFORMATION)){const e=U(r.elementCount(h.geometry.geometry.attributes)*i),t=r.vertexBufferLayout.createView(e.buffer);this._writeGeometry(o,t,0),l.vao.vertexBuffers.get("geometry").setSubData(e,h.from*i,0,h.numElements*i)}a&(_.HIGHLIGHT|_.OCCLUDEE|_.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,t){const r=new o;for(const i of e){const e=i.localOrigin;if(null==e)continue;let t=r.get(e.id,null);null==t&&(t=new R(e.vec3),r.set(e.id,null,t)),t.changes.push(i)}for(const i of t){const e=i.localOrigin;if(null==e)continue;const t=this._dataByOrigin.get(e.id),s=t?.findBuffer(i.id);if(null==s)continue;let o=r.get(e.id,s);null==o&&(o=new R(e.vec3),r.set(e.id,s,o)),o.changes.push(i)}return r}_applyAddsAndRemoves(e){const{_bufferWriter:r,_dataByOrigin:i,_vaoCache:s}=this;if(null==r||null==s)return void e.clearAddsAndRemoves();const o=r.vertexBufferLayout.stride/4,a=this._computeDeltas(e.adds,e.removes);a.forEach(((e,n)=>{const l=e.get(null),h=l?.changes??[];a.delete(n,null);let u=i.get(n);if(e.forEach(((e,l)=>{if(a.delete(n,l),null==l)return void w(!1,"No VAO for removed geometries");if(l.instances.size===e.changes.length)return s.deleteVao(l.vao),t(u.buffers,l),void(0===u.buffers.length&&0===h.length&&i.delete(n));const f=l.numElements,c=l.vao.getByteLength("geometry")/4,d=h.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),m=e.changes.reduce(((e,t)=>e+r.elementCount(t.geometry.attributes)),0),g=Math.min((f+d-m)*o,W),p=g>c;g>N&&g<c/2?(e.changes.forEach((({id:e})=>l.deleteInstance(e))),l.instances.forEach((({geometry:e})=>h.push(e))),this._vaoCache.deleteVao(l.vao),t(u.buffers,l)):p?this._applyAndRebuild(l,h,e):this._applyRemoves(l,e)})),h.length>0)for(null==u&&(u=new M(l.origin),i.set(n,u)),u.buffers.forEach((e=>this._applyAdds(e,h)));h.length>0;)u.buffers.push(this._applyAndRebuild(new E,h,null))})),e.clearAddsAndRemoves()}_updateDrawCommands(){this._highlightNames.clear(),this._hasOccludees=!1,this._dataByOrigin.forEach((e=>{e.buffers.forEach((e=>{e.updateIfDrawCommandsDirty(this.highlightOrderMap,this._bufferWriter.vertexBufferLayout.stride),e.hasHighlights&&n(this._highlightNames,e.highlightNames),this._hasOccludees=this._hasOccludees||e.hasOccludees}))}))}_applyAndRebuild(e,t,r){if(r)for(const d of r.changes)e.deleteInstance(d.id);const i=this._bufferWriter,s=i.vertexBufferLayout.stride,o=s/4,a=Math.floor(W/o);let n=e.numElements;for(;t.length>0;){const r=t.pop(),s=i.elementCount(r.geometry.attributes);if(n+s>a&&n>0){t.push(r);break}n+=s;const o=new A(r,0,0,this.highlightOrderMap);w(null==e.instances.get(r.id)),e.addInstance(r.id,o)}const l=n*o,h=U(l),u=i.vertexBufferLayout.createView(h.buffer);let f=0;e.resetInstanceSummary(),e.instances.forEach(((t,r)=>{this._writeGeometry(t.geometry,u,f);const s=f;f+=i.elementCount(t.geometry.geometry.attributes),e.updateInstance(r,s,f),e.updateDrawState(t)})),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(V(l)),e.vao.vertexBuffers.get("geometry").setSubData(h,0,0,f*o),e.holes.clear();const c=e.holes.pushNew();return c.from=f,c.to=Math.floor(e.vao.getByteLength("geometry")/s),e.updateDrawCommands(this.highlightOrderMap,s),e}_applyRemoves(e,t){if(0===t.changes.length||null==this._bufferWriter)return;let r=1/0,i=-1/0;for(const a of t.changes){const t=a.id,s=e.instances.get(t);if(!s)continue;e.deleteInstance(t),q&&(r=Math.min(r,s.from),i=Math.max(i,s.to));const o=j.back();if(o){if(o.to===s.from){o.to=s.to;continue}if(o.from===s.to){o.from=s.from;continue}}const n=j.pushNew();n.from=s.from,n.to=s.to}O(j);const s=this._bufferWriter.vertexBufferLayout.stride/4,o=e.vao.vertexBuffers.get("geometry");if(q){const t=(i-r)*s,a=U(t),n=this._bufferWriter.vertexBufferLayout.createView(a.buffer);a.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=r&&e.to<=i))return;const t=e.from-r;this._writeGeometry(e.geometry,n,t)})),o.setSubData(a,r*s,0,t)}else{const e=j.reduce(((e,t)=>Math.max(e,t.numElements)),0)*s,t=U(e);t.fill(0,0,e),j.forAll((e=>o.setSubData(t,e.from*s,0,e.numElements*s)))}e.holes.pushArray(j.data,j.length),j.forAll(((e,t)=>j.data[t]=null)),j.clear(),e.drawCommandsDirty=!0}_applyAdds(e,t){if(0===t.length||null==this._bufferWriter)return;if(!B(e))return void this._applyAndRebuild(e,t,null);const i=this._bufferWriter,s=i.vertexBufferLayout.stride/4,o=e.numElements,a=t.reduce(((e,t)=>e+i.elementCount(t.geometry.attributes)),0),n=Math.min((o+a)*s,W),l=4*n;if(e.vao.getByteLength("geometry")<V(W-N)&&l>e.vao.getByteLength("geometry"))return void this._applyAndRebuild(e,t,null);O(e.holes);const h=new Array;let u=1/0,f=-1/0;for(const r of t){const t=i.elementCount(r.geometry.attributes),s=H(e.holes,t);h.push(s),q&&null!=s&&(u=Math.min(s,u),f=Math.max(s+t,f))}const c=e.vao.vertexBuffers.get("geometry");let d=0,m=0,g=0;const p=U(q?(f-u)*s:n),y=i.vertexBufferLayout.createView(p.buffer);if(t.forEach(((t,r)=>{const o=h[r];if(null==o)return;const a=i.elementCount(t.geometry.attributes);if(!q){if(!(g===o)){const e=g-m;e>0&&c.setSubData(p,m*s,0,e*s),m=o,d=0}this._writeGeometry(t,y,d),d+=a,g=o+a}const n=new A(t,o,o+a,this.highlightOrderMap);w(null==e.instances.get(t.id)),e.addInstance(t.id,n),e.drawCommandsDirty=!0})),q){const t=(f-u)*s;p.fill(0,0,t),e.instances.forEach((e=>{if(!(e.from>=u&&e.to<=f))return;const t=e.from-u;this._writeGeometry(e.geometry,y,t)})),m=u,g=f}const _=g-m;_>0&&c.setSubData(p,m*s,0,_*s),r(t,((e,t)=>null==h[t]))}_writeGeometry(e,t,r){null!=this._bufferWriter&&(u(S,e.transformation),S[12]-=e.localOrigin.vec3[0],S[13]-=e.localOrigin.vec3[1],S[14]-=e.localOrigin.vec3[2],f(L,S),c(L,L),this._bufferWriter.write(S,L,e.geometry.attributes,e.geometry.objectAndLayerIdColor,t,r))}updateAnimation(e){return this.material.update(e)}acquireTechniques(e){if(!this.material.shouldRender(e))return null;const{output:t,bind:r}=e,i=this.material.produces.get(r.slot);if(!i?.(t))return null;const{highlight:s,slot:o}=r,a=t===g.ShadowHighlight,n=t===g.Highlight,l=n||a,h=s?.name;if(l&&(0===this._highlightNames.size||n&&h&&!this._highlightNames.has(h)))return null;const u=e=>n&&!!h&&!e.has(h),f=t===g.ShadowExcludeHighlight,c=!(l||f);for(const{buffers:d}of this._dataByOrigin.values())for(const i of d){if(u(i.highlightNames))continue;const s=a?i.drawCommandsHighlights.get(x):l?h?i.drawCommandsHighlights.get(h):i.drawCommandsHighlights.size>0:((f&&i.needsMultipleCommands()?i.drawCommandsShadowHighlightRest:i.drawCommandsDefault)||null)?.length??!1,n=c&&i.drawCommandsOccludees||null;if(s||n?.length){const i=this._glMaterials.load(e.rctx,o,t),s=i?.beginSlot(r);if(s)return s}}return null}render(e,t){const{output:r,bind:i}=e,{slot:s,highlight:o}=i,n=r===g.Highlight,l=o?.name??"";if(n&&!o)return;const h=r===g.ShadowHighlight,u=n||h,f=r===g.ShadowExcludeHighlight,c=!(u||f),d=s===b.OCCLUDER_MATERIAL||s===b.TRANSPARENT_OCCLUDER_MATERIAL?s:null,{rctx:m}=e;m.runAppleAmdDriverHelper();const p=m.bindTechnique(t,i,this.material.parameters);for(const g of this._dataByOrigin.values())for(const e of g.buffers){if(n&&(!e.hasHighlights||!e.drawCommandsHighlights.has(l)))continue;if(h&&(!e.hasHighlights||!e.drawCommandsHighlights.has(x)))continue;const r=()=>{const t=[],r=e.drawCommandsHighlights.get(x)??new a;return r&&t.push(r),t},s=u&&!h?e.drawCommandsHighlights.get(l)??null:null,o=h?r():u?s?[s]:z:f&&e.needsMultipleCommands()?[e.drawCommandsShadowHighlightRest]:[e.drawCommandsDefault],y=o.some((e=>e.length>0)),_=c&&e.drawCommandsOccludees||null;if(y||_?.length){if(this._drawParameters.origin=g.origin,p.bindDraw(i,this.material.parameters,this._drawParameters),t.ensureAttributeLocations(e.vao),m.bindVAO(e.vao),y)for(const e of o)m.setPipelineState(t.getPipeline(!1,d)),e.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count)));_?.length&&(m.setPipelineState(t.getPipeline(!0,d)),_.forAll((e=>m.drawArrays(t.primitiveType,e.first,e.count))))}}}static prune(){G=new Float32Array(N)}get test(){}};e([l({constructOnly:!0})],D.prototype,"material",void 0),e([l({})],D.prototype,"highlightOrderMap",void 0),D=e([h("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],D);class R{constructor(e){this.origin=e,this.changes=new Array}}function H(e,t){const r=e.find((e=>e.numElements>=t));if(null==r)return null;const i=r.from;return r.from+=t,r.from>=r.to&&e.removeUnordered(r),i}const S=d(),L=d(),j=new a({allocator:e=>e||new C,deallocator:null}),N=65536,I=4*N,P=1024,T=16777216,W=T/4;let G=new Float32Array(N);function U(e){return G.length<e&&(G=new Float32Array(e)),G}function V(e){const t=4*e;return t<=P?P:t<I?i(t):Math.max(Math.min(Math.ceil(1.5*t/I)*I,T),t)}const z=[];let q;export{D as MergedRenderer,V as sizeForVao};
|
|
@@ -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{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{BufferRange as e}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{defaultHighlightName as n}from"../../../../support/HighlightDefaults.js";class a{constructor(){this._numElements=0,this._instances=new Map,this.holes=new s({allocator:t=>t||new e,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=r(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=r(),this.drawCommandsShadowHighlightRest=r()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightNames.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateIfDrawCommandsDirty(t,s){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t,s)}}addInstance(t,s){this.deleteInstance(t),this._instances.set(t,s),this._numElements+=s.numElements}deleteInstance(t){const s=this._instances.get(t);s&&(this._numElements-=s.numElements,this._instances.delete(t))}updateInstance(t,s,e){const i=this._instances.get(t);i&&(this._numElements-=i.numElements,i.from=s,i.to=e,this._numElements+=i.numElements)}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t,s){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:e}=this;if(this._updateHighlightDrawCommands(t,e),!this.needsMultipleCommands()){const t=this.drawCommandsDefault.pushNew(),e=this.holes.front();return this.vao&&1===this.holes.length&&e.to===Math.floor(this.vao.
|
|
5
|
+
import{getOrCreateMapValue as t}from"../../../../../core/MapUtils.js";import s from"../../../../../core/PooledArray.js";import{BufferRange as e}from"./BufferRange.js";import{DrawCommand as i}from"./DrawCommand.js";import{defaultHighlightName as n}from"../../../../support/HighlightDefaults.js";class a{constructor(){this._numElements=0,this._instances=new Map,this.holes=new s({allocator:t=>t||new e,deallocator:null}),this.hasHiddenInstances=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.highlightNames=new Set,this.drawCommandsDefault=r(),this.drawCommandsHighlights=new Map,this.drawCommandsOccludees=r(),this.drawCommandsShadowHighlightRest=r()}get numElements(){return this._numElements}get instances(){return this._instances}get hasHighlights(){return this.highlightNames.size>0}resetInstanceSummary(){this.hasHiddenInstances=!1,this.hasOccludees=!1,this.highlightNames.clear()}updateIfDrawCommandsDirty(t,s){if(this.drawCommandsDirty){this.resetInstanceSummary();for(const t of this.instances.values())this.updateDrawState(t);this.updateDrawCommands(t,s)}}addInstance(t,s){this.deleteInstance(t),this._instances.set(t,s),this._numElements+=s.numElements}deleteInstance(t){const s=this._instances.get(t);s&&(this._numElements-=s.numElements,this._instances.delete(t))}updateInstance(t,s,e){const i=this._instances.get(t);i&&(this._numElements-=i.numElements,i.from=s,i.to=e,this._numElements+=i.numElements)}updateDrawState(t){if(t.isVisible){const{highlightName:s}=t;s&&this.highlightNames.add(s),t.hasOccludees&&(this.hasOccludees=!0)}else this.hasHiddenInstances=!0}updateDrawCommands(t,s){if(this.drawCommandsDefault.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsDirty=!1,0===this._instances.size)return;const{sortedInstances:e}=this;if(this._updateHighlightDrawCommands(t,e),!this.needsMultipleCommands()){const t=this.drawCommandsDefault.pushNew(),e=this.holes.front();return this.vao&&1===this.holes.length&&e.to===Math.floor(this.vao.getByteLength("geometry")/s)?(t.first=0,void(t.count=e.from)):(t.first=1/0,t.count=0,this._instances.forEach((s=>{t.first=Math.min(t.first,s.from),t.count=Math.max(t.count,s.to)})),void(t.count-=t.first))}for(const i of e)i.isVisible&&m(i.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,i)}get sortedInstances(){return Array.from(this._instances.values()).sort(((t,s)=>t.from===s.from?t.to-s.to:t.from-s.from))}updateHighlights(t){this.highlightNames.clear();const s=this.sortedInstances;for(const e of s)e.updateHighlightOptions(t),e.isVisible&&e.highlightName&&this.highlightNames.add(e.highlightName);this._updateHighlightDrawCommands(t)}_updateHighlightDrawCommands(s,e=this.sortedInstances){const{drawCommandsHighlights:i,drawCommandsShadowHighlightRest:a}=this;i.clear(),a.clear();for(const h of e){if(h.updateHighlightOptions(s),!h.isVisible)continue;const{highlightName:e}=h;if(e){this.highlightNames.add(e);m(t(i,e,r),h)}e&&e===n||m(a,h)}}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}}class h extends a{}function o(t){return null!=t.vao}function r(){return new s({allocator:t=>t||new i,deallocator:t=>t})}function m(t,s){const e=t.back();if(null==e){const e=t.pushNew();return e.first=s.from,void(e.count=s.numElements)}if(l(e,s)){const t=s.from-e.first+s.numElements;e.count=t}else{const e=t.pushNew();e.first=s.from,e.count=s.numElements}}function l(t,s){return t.first+t.count>=s.from}export{a as PerBufferData,h as PerVaoData,o as hasVao};
|
|
@@ -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{MemCachePool as e}from"../../../../../core/MemCachePool.js";import{VertexArrayObject as t}from"../../lib/VertexArrayObject.js";import{BufferObject as r}from"../../../../webgl/BufferObject.js";import{Usage as o}from"../../../../webgl/enums.js";class s{constructor(t,r,o){this._rctx=t,this._locations=r,this._layout=o,this._cache=new e(t.newCache,"VAOCache")}dispose(){this._cache.destroy()}newVao(e){const s=e.toString();let c=this._cache.pop(s);return c||(c=new t(this._rctx,this._locations,new Map([["geometry",this._layout]]),new Map([["geometry",r.createVertex(this._rctx,o.STATIC_DRAW)]])),c.vertexBuffers.get("geometry")?.setSize(e),c)}deleteVao(e){if(null==e)return;const t=e.
|
|
5
|
+
import{MemCachePool as e}from"../../../../../core/MemCachePool.js";import{VertexArrayObject as t}from"../../lib/VertexArrayObject.js";import{BufferObject as r}from"../../../../webgl/BufferObject.js";import{Usage as o}from"../../../../webgl/enums.js";class s{constructor(t,r,o){this._rctx=t,this._locations=r,this._layout=o,this._cache=new e(t.newCache,"VAOCache")}dispose(){this._cache.destroy()}newVao(e){const s=e.toString();let c=this._cache.pop(s);return c||(c=new t(this._rctx,this._locations,new Map([["geometry",this._layout]]),new Map([["geometry",r.createVertex(this._rctx,o.STATIC_DRAW)]])),c.vertexBuffers.get("geometry")?.setSize(e),c)}deleteVao(e){if(null==e)return;const t=e.getByteLength("geometry").toString();this._cache.put(t,e)}}export{s as VaoCache};
|
package/views/FocusAreas.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import o from"../core/Accessor.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import o from"../core/Accessor.js";import r from"../core/Collection.js";import{destroyMaybe as s}from"../core/maybe.js";import{watch as t,syncAndInitial as i}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{e as c}from"../chunks/earcut.js";import{create as d}from"../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as m}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import p from"../geometry/Point.js";import{computeTranslationToOriginAndRotation as l}from"../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as h}from"../geometry/support/DoubleArray.js";import{newIndexArray as u}from"../geometry/support/Indices.js";import{t as f}from"../chunks/vec3.js";import{ViewingMode as g}from"./ViewingMode.js";import{ElevationContext as y}from"./3d/layers/graphics/ElevationContext.js";import{extrudePolygon as v}from"./3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as j}from"./3d/layers/graphics/graphicUtils.js";import{geometryToRenderInfo as _}from"./3d/support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as w}from"./3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as A,FocusAreaMaskNode as R}from"./3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js";const b=-2e4,P=5e6,C=.42,G=.32;function N(e,o){if(e){if("bright"===o){const o=(e[0]+e[1]+e[2])/3;return[o*G+(1-G),o*G+(1-G),o*G+(1-G),e[3]*G]}return"dark"===o?[e[0]*C,e[1]*C,e[2]*C,e[3]*C]:e}}let x=class extends o{constructor(e){super(e),this.style="dark",this.geometries=new Array,this._areas=new r,this._elevationContext=new y}initialize(){this.addHandles([t((()=>this.style),(()=>this._updateRenderNodes()),i)]),this.addHandles([t((()=>this.activePolygons),(()=>this._updateFocusAreaGeometries()),i)])}get activePolygons(){const e=new r;for(const o of this.areas)if(o.enabled)for(const r of o.geometries)e.push(r);return e}add(e){this.areas.add(e),this._updateFocusAreaGeometries()}addMany(e){this.areas.addMany(e),this._updateFocusAreaGeometries()}remove(e){this.areas.remove(e),this._updateFocusAreaGeometries()}removeMany(e){this.areas.removeMany(e),this._updateFocusAreaGeometries()}removeAll(){this.areas.removeAll(),this._updateFocusAreaGeometries()}containsGeometry(e){const o=!0;if(0===this.activePolygons.length)return o;const r=new p(e);return this.activePolygons.some((e=>e.contains(r)))}get areas(){return this._areas}_updateFocusAreaGeometries(){this._extrudePolygons(),this._updateRenderNodes()}_extrudePolygons(){if(!this.view.renderCoordsHelper)return;this.geometries.length=0;const e=P-b,o=m(),r=this.view.renderCoordsHelper.viewingMode===g.Global,s=d(),t=d();r||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],o);for(const i of this.areas)if(i.enabled)for(const n of i.geometries){const a=j(n);if(null==a)continue;l(n.spatialReference,[a.x,a.y,0],s,this.view.renderCoordsHelper.spatialReference);const d=this.view.renderCoordsHelper.worldUpAtPosition([s[12],s[13],s[14]],k);t[12]=-s[12],t[13]=-s[13],t[14]=-s[14];const m=_(n,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:p,mapPositions:g,position:y}=m;for(const n of p){const a=n.count,m=c(n.mapPositions,n.holeIndices,3);if(0===m.length)continue;const p=m.length,l=6*a,j=u(l+p),_=u(p),w=h(3*l),R=h(3*l),P=h(3*l),C=h(l);v(y,g,m,n,w,P,R,C,j,_,e,o,r),f(w,w,t);const G=new A(w,_,j,e,[s[12]+b*d[0],s[13]+b*d[1],s[14]+b*d[2]],i.outline?.color);this.geometries.push(G)}}this._maskRenderNode?.updateGeometries()}_updateRenderNodes(){this.view.stage&&("none"===this.style||0===this.geometries.length?(this._maskRenderNode=s(this._maskRenderNode),this._colorRenderNode=s(this._colorRenderNode)):(this._maskRenderNode??=new R({focusAreas:this}),this._colorRenderNode??=new w({focusAreas:this})))}};e([n()],x.prototype,"activePolygons",null),e([n()],x.prototype,"style",void 0),e([n()],x.prototype,"geometries",void 0),e([n({constructOnly:!0})],x.prototype,"view",void 0),e([n()],x.prototype,"_areas",void 0),x=e([a("esri.views.FocusAreas")],x);const k=m();export{x as FocusAreas,N as focusAreaHUDColor};
|
|
@@ -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 t}from"../../core/maybe.js";import{baseTypedArrayMemory as i}from"../../core/memoryEstimations.js";import{ResourceType as r}from"./enums.js";import{bindVertexBufferLayout as s}from"./Util.js";const n=()=>e.getLogger("esri.views.webgl.VertexArrayObject");let o=class{constructor(e,t,i,r,s=null){this._context=e,this._locations=t,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}
|
|
5
|
+
import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{baseTypedArrayMemory as i}from"../../core/memoryEstimations.js";import{ResourceType as r}from"./enums.js";import{bindVertexBufferLayout as s}from"./Util.js";const n=()=>e.getLogger("esri.views.webgl.VertexArrayObject");let o=class{constructor(e,t,i,r,s=null){this._context=e,this._locations=t,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}getByteLength(e){return this._buffers.get(e)?.usedMemory??0}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return Array.from(this._buffers.values()).reduce(((e,t)=>e+t.usedMemory),this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*i)}get cachedMemory(){return this.usedMemory}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach((e=>e.dispose())),this._buffers.clear(),this._indexBuffer=t(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(r.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:e}=this._context,t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t,this._context.instanceCounter.increment(r.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:i}=this;e||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach(((e,i)=>{const r=t.get(i);r?s(this._context,this._locations,e,r):n().error("Vertex element descriptor is empty!")})),null!=i&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{o as VertexArrayObject};
|
package/views/webgl/enums.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
var _,E,R,A,T,N,S,I,O,C,D,L,P,G,U,M,B,F,H,n,V,X,Y,f,t;!function(_){_[_.DEPTH=256]="DEPTH",_[_.STENCIL=1024]="STENCIL",_[_.COLOR=16384]="COLOR"}(_||(_={})),function(_){_[_.COLOR=6144]="COLOR",_[_.DEPTH=6145]="DEPTH",_[_.STENCIL=6146]="STENCIL",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(E||(E={})),function(_){_[_.POINTS=0]="POINTS",_[_.LINES=1]="LINES",_[_.LINE_LOOP=2]="LINE_LOOP",_[_.LINE_STRIP=3]="LINE_STRIP",_[_.TRIANGLES=4]="TRIANGLES",_[_.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_[_.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(R||(R={})),function(_){_[_.ZERO=0]="ZERO",_[_.ONE=1]="ONE",_[_.SRC_COLOR=768]="SRC_COLOR",_[_.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_[_.SRC_ALPHA=770]="SRC_ALPHA",_[_.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_[_.DST_ALPHA=772]="DST_ALPHA",_[_.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_[_.DST_COLOR=774]="DST_COLOR",_[_.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_[_.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_[_.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_[_.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_[_.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_[_.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(A||(A={})),function(_){_[_.ADD=32774]="ADD",_[_.MIN=32775]="MIN",_[_.MAX=32776]="MAX",_[_.SUBTRACT=32778]="SUBTRACT",_[_.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(T||(T={})),function(_){_[_.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_[_.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_[_.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",_[_.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",_[_.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",_[_.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",_[_.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",_[_.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(N||(N={})),function(_){_[_.FRONT=1028]="FRONT",_[_.BACK=1029]="BACK",_[_.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(S||(S={})),function(_){_[_.CW=2304]="CW",_[_.CCW=2305]="CCW"}(I||(I={})),function(_){_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.INT=5124]="INT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.FLOAT=5126]="FLOAT",_[_.HALF_FLOAT=5131]="HALF_FLOAT"}(O||(O={})),function(_){_[_.NEVER=512]="NEVER",_[_.LESS=513]="LESS",_[_.EQUAL=514]="EQUAL",_[_.LEQUAL=515]="LEQUAL",_[_.GREATER=516]="GREATER",_[_.NOTEQUAL=517]="NOTEQUAL",_[_.GEQUAL=518]="GEQUAL",_[_.ALWAYS=519]="ALWAYS"}(C||(C={})),function(_){_[_.ZERO=0]="ZERO",_[_.KEEP=7680]="KEEP",_[_.REPLACE=7681]="REPLACE",_[_.INCR=7682]="INCR",_[_.DECR=7683]="DECR",_[_.INVERT=5386]="INVERT",_[_.INCR_WRAP=34055]="INCR_WRAP",_[_.DECR_WRAP=34056]="DECR_WRAP"}(D||(D={})),function(_){_[_.NEAREST=9728]="NEAREST",_[_.LINEAR=9729]="LINEAR",_[_.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_[_.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_[_.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_[_.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(L||(L={})),function(_){_[_.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_[_.REPEAT=10497]="REPEAT",_[_.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(P||(P={})),function(_){_[_.TEXTURE_2D=3553]="TEXTURE_2D",_[_.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_[_.TEXTURE_3D=32879]="TEXTURE_3D",_[_.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_[_.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_[_.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_[_.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_[_.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(G||(G={})),function(_){_[_.MIN_LOD=33082]="MIN_LOD",_[_.MAX_LOD=33083]="MAX_LOD",_[_.BASE_LEVEL=33084]="BASE_LEVEL",_[_.MAX_LEVEL=33085]="MAX_LEVEL",_[_.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE"}(U||(U={})),function(_){_[_.ALPHA=6406]="ALPHA",_[_.RGB=6407]="RGB",_[_.RGBA=6408]="RGBA",_[_.LUMINANCE=6409]="LUMINANCE",_[_.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_[_.RED=6403]="RED",_[_.RG=33319]="RG",_[_.RED_INTEGER=36244]="RED_INTEGER",_[_.RG_INTEGER=33320]="RG_INTEGER",_[_.RGB_INTEGER=36248]="RGB_INTEGER",_[_.RGBA_INTEGER=36249]="RGBA_INTEGER"}(M||(M={})),function(_){_[_.RGBA4=32854]="RGBA4",_[_.R16F=33325]="R16F",_[_.RG16F=33327]="RG16F",_[_.RGB32F=34837]="RGB32F",_[_.RGBA16F=34842]="RGBA16F",_[_.R32F=33326]="R32F",_[_.RG32F=33328]="RG32F",_[_.RGBA32F=34836]="RGBA32F",_[_.R11F_G11F_B10F=35898]="R11F_G11F_B10F",_[_.RGB8=32849]="RGB8",_[_.RGBA8=32856]="RGBA8",_[_.RGB5_A1=32855]="RGB5_A1",_[_.R8=33321]="R8",_[_.RG8=33323]="RG8",_[_.R8I=33329]="R8I",_[_.R8UI=33330]="R8UI",_[_.R16I=33331]="R16I",_[_.R16UI=33332]="R16UI",_[_.R32I=33333]="R32I",_[_.R32UI=33334]="R32UI",_[_.RG8I=33335]="RG8I",_[_.RG8UI=33336]="RG8UI",_[_.RG16I=33337]="RG16I",_[_.RG16UI=33338]="RG16UI",_[_.RG32I=33339]="RG32I",_[_.RG32UI=33340]="RG32UI",_[_.RGB16F=34843]="RGB16F",_[_.RGB9_E5=35901]="RGB9_E5",_[_.SRGB8=35905]="SRGB8",_[_.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",_[_.RGB565=36194]="RGB565",_[_.RGBA32UI=36208]="RGBA32UI",_[_.RGB32UI=36209]="RGB32UI",_[_.RGBA16UI=36214]="RGBA16UI",_[_.RGB16UI=36215]="RGB16UI",_[_.RGBA8UI=36220]="RGBA8UI",_[_.RGB8UI=36221]="RGB8UI",_[_.RGBA32I=36226]="RGBA32I",_[_.RGB32I=36227]="RGB32I",_[_.RGBA16I=36232]="RGBA16I",_[_.RGB16I=36233]="RGB16I",_[_.RGBA8I=36238]="RGBA8I",_[_.RGB8I=36239]="RGB8I",_[_.R8_SNORM=36756]="R8_SNORM",_[_.RG8_SNORM=36757]="RG8_SNORM",_[_.RGB8_SNORM=36758]="RGB8_SNORM",_[_.RGBA8_SNORM=36759]="RGBA8_SNORM",_[_.RGB10_A2=32857]="RGB10_A2",_[_.RGB10_A2UI=36975]="RGB10_A2UI"}(B||(B={})),function(_){_[_.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(F||(F={})),function(_){_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(H||(H={})),function(_){_[_.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_[_.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",_[_.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(n||(n={})),function(_){_[_.STENCIL_INDEX8=36168]="STENCIL_INDEX8"}(V||(V={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",_[_.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_[_.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_[_.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.INT=5124]="INT",_[_.HALF_FLOAT=5131]="HALF_FLOAT",_[_.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",_[_.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",_[_.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",_[_.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(X||(X={})),function(_){_[_.STATIC_DRAW=35044]="STATIC_DRAW",_[_.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_[_.STREAM_DRAW=35040]="STREAM_DRAW",_[_.STATIC_READ=35045]="STATIC_READ",_[_.DYNAMIC_READ=35049]="DYNAMIC_READ",_[_.STREAM_READ=35041]="STREAM_READ",_[_.STATIC_COPY=35046]="STATIC_COPY",_[_.DYNAMIC_COPY=35050]="DYNAMIC_COPY",_[_.STREAM_COPY=35042]="STREAM_COPY"}(Y||(Y={})),function(_){_[_.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_[_.VERTEX_SHADER=35633]="VERTEX_SHADER"}(f||(f={})),function(_){_[_.FRAMEBUFFER=36160]="FRAMEBUFFER",_[_.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",_[_.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(t||(t={}));const c=33984;var o,u;!function(_){_[_.Texture=0]="Texture",_[_.BufferObject=1]="BufferObject",_[_.VertexArrayObject=2]="VertexArrayObject",_[_.Shader=3]="Shader",_[_.Program=4]="Program",_[_.FramebufferObject=5]="FramebufferObject",_[_.Renderbuffer=6]="Renderbuffer",_[_.TransformFeedback=7]="TransformFeedback",_[_.Sync=8]="Sync",_[_.UNCOUNTED=9]="UNCOUNTED",_[_.LinesOfCode=9]="LinesOfCode",_[_.Uniform=10]="Uniform",_[_.COUNT=11]="COUNT"}(o||(o={})),function(_){_[_.NONE=0]="NONE",_[_.BACK=1029]="BACK"}(u||(u={}));const i=36064,e=36065,r=36066,W=36067,x=36068,K=36069,a=36070,b=36071,Z=36072,d=36073,m=36074,Q=36075,j=36076,s=36077,y=36078,v=36079,g=33306,h=36096,k=36128;var J,p,l,q,w,z,$,__,E_;!function(_){_[_.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",_[_.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",_[_.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",_[_.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",_[_.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",_[_.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",_[_.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",_[_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",_[_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(J||(J={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.FLOAT_VEC2=35664]="FLOAT_VEC2",_[_.FLOAT_VEC3=35665]="FLOAT_VEC3",_[_.FLOAT_VEC4=35666]="FLOAT_VEC4",_[_.INT=5124]="INT",_[_.INT_VEC2=35667]="INT_VEC2",_[_.INT_VEC3=35668]="INT_VEC3",_[_.INT_VEC4=35669]="INT_VEC4",_[_.BOOL=35670]="BOOL",_[_.BOOL_VEC2=35671]="BOOL_VEC2",_[_.BOOL_VEC3=35672]="BOOL_VEC3",_[_.BOOL_VEC4=35673]="BOOL_VEC4",_[_.FLOAT_MAT2=35674]="FLOAT_MAT2",_[_.FLOAT_MAT3=35675]="FLOAT_MAT3",_[_.FLOAT_MAT4=35676]="FLOAT_MAT4",_[_.SAMPLER_2D=35678]="SAMPLER_2D",_[_.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",_[_.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",_[_.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",_[_.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",_[_.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",_[_.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",_[_.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",_[_.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",_[_.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",_[_.SAMPLER_3D=35679]="SAMPLER_3D",_[_.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",_[_.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",_[_.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",_[_.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",_[_.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",_[_.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",_[_.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",_[_.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",_[_.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",_[_.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",_[_.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",_[_.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(p||(p={})),function(_){_[_.OBJECT_TYPE=37138]="OBJECT_TYPE",_[_.SYNC_CONDITION=37139]="SYNC_CONDITION",_[_.SYNC_STATUS=37140]="SYNC_STATUS",_[_.SYNC_FLAGS=37141]="SYNC_FLAGS"}(l||(l={})),function(_){_[_.UNSIGNALED=37144]="UNSIGNALED",_[_.SIGNALED=37145]="SIGNALED"}(q||(q={})),function(_){_[_.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",_[_.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",_[_.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",_[_.WAIT_FAILED=37149]="WAIT_FAILED"}(w||(w={})),function(_){_[_.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(z||(z={})),function(_){_[_.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}($||($={})),function(_){_[_.INVALID_ENUM=1280]="INVALID_ENUM",_[_.INVALID_VALUE=1281]="INVALID_VALUE",_[_.INVALID_OPERATION=1282]="INVALID_OPERATION",_[_.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",_[_.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",_[_.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL"}(__||(__={})),function(_){_[_.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR"}(E_||(E_={}));export{A as BlendFactor,T as BlendOperation,E as BufferContent,N as BufferType,w as ClientWaitSyncStatus,i as ColorAttachment0,e as ColorAttachment1,m as ColorAttachment10,Q as ColorAttachment11,j as ColorAttachment12,s as ColorAttachment13,y as ColorAttachment14,v as ColorAttachment15,r as ColorAttachment2,W as ColorAttachment3,x as ColorAttachment4,K as ColorAttachment5,a as ColorAttachment6,b as ColorAttachment7,Z as ColorAttachment8,d as ColorAttachment9,C as CompareFunction,J as CompressedTextureFormat,I as CullMode,O as DataType,h as DepthAttachment,g as DepthStencilAttachment,__ as ErrorConstant,E_ as Extension,S as Face,_ as FramebufferBit,t as FramebufferTarget,M as PixelFormat,X as PixelType,R as PrimitiveType,o as ResourceType,f as ShaderType,n as SizedDepthFormat,H as SizedDepthStencilFormat,B as SizedPixelFormat,V as SizedStencilFormat,u as SpecialDrawBuffers,k as StencilAttachment,D as StencilOperation,z as SyncCondition,$ as SyncFlag,l as SyncParameter,q as SyncStatus,U as TextureConstants,L as TextureSamplingMode,G as TextureType,P as TextureWrapMode,p as UniformType,F as UnsizedDepthFormat,Y as Usage,c as baseTextureUnit};
|
|
5
|
+
var _,E,R,A,T,N,S,I,O,C,D,L,P,G,U,M,B,F,H,n,V,X,Y,f,t;!function(_){_[_.DEPTH=256]="DEPTH",_[_.STENCIL=1024]="STENCIL",_[_.COLOR=16384]="COLOR"}(_||(_={})),function(_){_[_.COLOR=6144]="COLOR",_[_.DEPTH=6145]="DEPTH",_[_.STENCIL=6146]="STENCIL",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(E||(E={})),function(_){_[_.POINTS=0]="POINTS",_[_.LINES=1]="LINES",_[_.LINE_LOOP=2]="LINE_LOOP",_[_.LINE_STRIP=3]="LINE_STRIP",_[_.TRIANGLES=4]="TRIANGLES",_[_.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",_[_.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(R||(R={})),function(_){_[_.ZERO=0]="ZERO",_[_.ONE=1]="ONE",_[_.SRC_COLOR=768]="SRC_COLOR",_[_.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",_[_.SRC_ALPHA=770]="SRC_ALPHA",_[_.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",_[_.DST_ALPHA=772]="DST_ALPHA",_[_.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",_[_.DST_COLOR=774]="DST_COLOR",_[_.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",_[_.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",_[_.CONSTANT_COLOR=32769]="CONSTANT_COLOR",_[_.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",_[_.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",_[_.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(A||(A={})),function(_){_[_.ADD=32774]="ADD",_[_.MIN=32775]="MIN",_[_.MAX=32776]="MAX",_[_.SUBTRACT=32778]="SUBTRACT",_[_.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(T||(T={})),function(_){_[_.ARRAY_BUFFER=34962]="ARRAY_BUFFER",_[_.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",_[_.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",_[_.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",_[_.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",_[_.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",_[_.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",_[_.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"}(N||(N={})),function(_){_[_.FRONT=1028]="FRONT",_[_.BACK=1029]="BACK",_[_.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(S||(S={})),function(_){_[_.CW=2304]="CW",_[_.CCW=2305]="CCW"}(I||(I={})),function(_){_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.INT=5124]="INT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.FLOAT=5126]="FLOAT",_[_.HALF_FLOAT=5131]="HALF_FLOAT"}(O||(O={})),function(_){_[_.NEVER=512]="NEVER",_[_.LESS=513]="LESS",_[_.EQUAL=514]="EQUAL",_[_.LEQUAL=515]="LEQUAL",_[_.GREATER=516]="GREATER",_[_.NOTEQUAL=517]="NOTEQUAL",_[_.GEQUAL=518]="GEQUAL",_[_.ALWAYS=519]="ALWAYS"}(C||(C={})),function(_){_[_.ZERO=0]="ZERO",_[_.KEEP=7680]="KEEP",_[_.REPLACE=7681]="REPLACE",_[_.INCR=7682]="INCR",_[_.DECR=7683]="DECR",_[_.INVERT=5386]="INVERT",_[_.INCR_WRAP=34055]="INCR_WRAP",_[_.DECR_WRAP=34056]="DECR_WRAP"}(D||(D={})),function(_){_[_.NEAREST=9728]="NEAREST",_[_.LINEAR=9729]="LINEAR",_[_.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",_[_.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",_[_.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",_[_.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(L||(L={})),function(_){_[_.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",_[_.REPEAT=10497]="REPEAT",_[_.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(P||(P={})),function(_){_[_.TEXTURE_2D=3553]="TEXTURE_2D",_[_.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",_[_.TEXTURE_3D=32879]="TEXTURE_3D",_[_.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",_[_.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",_[_.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",_[_.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",_[_.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",_[_.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(G||(G={})),function(_){_[_.MIN_LOD=33082]="MIN_LOD",_[_.MAX_LOD=33083]="MAX_LOD",_[_.BASE_LEVEL=33084]="BASE_LEVEL",_[_.MAX_LEVEL=33085]="MAX_LEVEL",_[_.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE"}(U||(U={})),function(_){_[_.ALPHA=6406]="ALPHA",_[_.RGB=6407]="RGB",_[_.RGBA=6408]="RGBA",_[_.LUMINANCE=6409]="LUMINANCE",_[_.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",_[_.RED=6403]="RED",_[_.RG=33319]="RG",_[_.RED_INTEGER=36244]="RED_INTEGER",_[_.RG_INTEGER=33320]="RG_INTEGER",_[_.RGB_INTEGER=36248]="RGB_INTEGER",_[_.RGBA_INTEGER=36249]="RGBA_INTEGER"}(M||(M={})),function(_){_[_.RGBA4=32854]="RGBA4",_[_.R16F=33325]="R16F",_[_.RG16F=33327]="RG16F",_[_.RGB32F=34837]="RGB32F",_[_.RGBA16F=34842]="RGBA16F",_[_.R32F=33326]="R32F",_[_.RG32F=33328]="RG32F",_[_.RGBA32F=34836]="RGBA32F",_[_.R11F_G11F_B10F=35898]="R11F_G11F_B10F",_[_.RGB8=32849]="RGB8",_[_.RGBA8=32856]="RGBA8",_[_.RGB5_A1=32855]="RGB5_A1",_[_.R8=33321]="R8",_[_.RG8=33323]="RG8",_[_.R8I=33329]="R8I",_[_.R8UI=33330]="R8UI",_[_.R16I=33331]="R16I",_[_.R16UI=33332]="R16UI",_[_.R32I=33333]="R32I",_[_.R32UI=33334]="R32UI",_[_.RG8I=33335]="RG8I",_[_.RG8UI=33336]="RG8UI",_[_.RG16I=33337]="RG16I",_[_.RG16UI=33338]="RG16UI",_[_.RG32I=33339]="RG32I",_[_.RG32UI=33340]="RG32UI",_[_.RGB16F=34843]="RGB16F",_[_.RGB9_E5=35901]="RGB9_E5",_[_.SRGB8=35905]="SRGB8",_[_.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",_[_.RGB565=36194]="RGB565",_[_.RGBA32UI=36208]="RGBA32UI",_[_.RGB32UI=36209]="RGB32UI",_[_.RGBA16UI=36214]="RGBA16UI",_[_.RGB16UI=36215]="RGB16UI",_[_.RGBA8UI=36220]="RGBA8UI",_[_.RGB8UI=36221]="RGB8UI",_[_.RGBA32I=36226]="RGBA32I",_[_.RGB32I=36227]="RGB32I",_[_.RGBA16I=36232]="RGBA16I",_[_.RGB16I=36233]="RGB16I",_[_.RGBA8I=36238]="RGBA8I",_[_.RGB8I=36239]="RGB8I",_[_.R8_SNORM=36756]="R8_SNORM",_[_.RG8_SNORM=36757]="RG8_SNORM",_[_.RGB8_SNORM=36758]="RGB8_SNORM",_[_.RGBA8_SNORM=36759]="RGBA8_SNORM",_[_.RGB10_A2=32857]="RGB10_A2",_[_.RGB10_A2UI=36975]="RGB10_A2UI"}(B||(B={})),function(_){_[_.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",_[_.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(F||(F={})),function(_){_[_.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",_[_.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(H||(H={})),function(_){_[_.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",_[_.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",_[_.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F"}(n||(n={})),function(_){_[_.STENCIL_INDEX8=36168]="STENCIL_INDEX8"}(V||(V={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",_[_.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",_[_.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",_[_.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",_[_.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",_[_.BYTE=5120]="BYTE",_[_.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",_[_.SHORT=5122]="SHORT",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.INT=5124]="INT",_[_.HALF_FLOAT=5131]="HALF_FLOAT",_[_.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",_[_.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",_[_.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",_[_.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(X||(X={})),function(_){_[_.STATIC_DRAW=35044]="STATIC_DRAW",_[_.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",_[_.STREAM_DRAW=35040]="STREAM_DRAW",_[_.STATIC_READ=35045]="STATIC_READ",_[_.DYNAMIC_READ=35049]="DYNAMIC_READ",_[_.STREAM_READ=35041]="STREAM_READ",_[_.STATIC_COPY=35046]="STATIC_COPY",_[_.DYNAMIC_COPY=35050]="DYNAMIC_COPY",_[_.STREAM_COPY=35042]="STREAM_COPY"}(Y||(Y={})),function(_){_[_.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",_[_.VERTEX_SHADER=35633]="VERTEX_SHADER"}(f||(f={})),function(_){_[_.FRAMEBUFFER=36160]="FRAMEBUFFER",_[_.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",_[_.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(t||(t={}));const c=33984;var o,u;!function(_){_[_.Texture=0]="Texture",_[_.TileTexture=1]="TileTexture",_[_.BufferObject=2]="BufferObject",_[_.VertexArrayObject=3]="VertexArrayObject",_[_.Shader=4]="Shader",_[_.Program=5]="Program",_[_.FramebufferObject=6]="FramebufferObject",_[_.Renderbuffer=7]="Renderbuffer",_[_.TransformFeedback=8]="TransformFeedback",_[_.Sync=9]="Sync",_[_.UNCOUNTED=10]="UNCOUNTED",_[_.LinesOfCode=10]="LinesOfCode",_[_.Uniform=11]="Uniform",_[_.COUNT=12]="COUNT"}(o||(o={})),function(_){_[_.NONE=0]="NONE",_[_.BACK=1029]="BACK"}(u||(u={}));const e=36064,i=36065,r=36066,W=36067,x=36068,K=36069,a=36070,b=36071,Z=36072,d=36073,m=36074,Q=36075,j=36076,s=36077,y=36078,v=36079,g=33306,h=36096,k=36128;var l,J,p,q,w,z,$,__,E_;!function(_){_[_.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",_[_.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",_[_.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",_[_.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",_[_.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",_[_.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",_[_.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",_[_.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",_[_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",_[_.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",_[_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"}(l||(l={})),function(_){_[_.FLOAT=5126]="FLOAT",_[_.FLOAT_VEC2=35664]="FLOAT_VEC2",_[_.FLOAT_VEC3=35665]="FLOAT_VEC3",_[_.FLOAT_VEC4=35666]="FLOAT_VEC4",_[_.INT=5124]="INT",_[_.INT_VEC2=35667]="INT_VEC2",_[_.INT_VEC3=35668]="INT_VEC3",_[_.INT_VEC4=35669]="INT_VEC4",_[_.BOOL=35670]="BOOL",_[_.BOOL_VEC2=35671]="BOOL_VEC2",_[_.BOOL_VEC3=35672]="BOOL_VEC3",_[_.BOOL_VEC4=35673]="BOOL_VEC4",_[_.FLOAT_MAT2=35674]="FLOAT_MAT2",_[_.FLOAT_MAT3=35675]="FLOAT_MAT3",_[_.FLOAT_MAT4=35676]="FLOAT_MAT4",_[_.SAMPLER_2D=35678]="SAMPLER_2D",_[_.SAMPLER_CUBE=35680]="SAMPLER_CUBE",_[_.UNSIGNED_INT=5125]="UNSIGNED_INT",_[_.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",_[_.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",_[_.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",_[_.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",_[_.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",_[_.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",_[_.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",_[_.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",_[_.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",_[_.SAMPLER_3D=35679]="SAMPLER_3D",_[_.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",_[_.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",_[_.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",_[_.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",_[_.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",_[_.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",_[_.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",_[_.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",_[_.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",_[_.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",_[_.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",_[_.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(J||(J={})),function(_){_[_.OBJECT_TYPE=37138]="OBJECT_TYPE",_[_.SYNC_CONDITION=37139]="SYNC_CONDITION",_[_.SYNC_STATUS=37140]="SYNC_STATUS",_[_.SYNC_FLAGS=37141]="SYNC_FLAGS"}(p||(p={})),function(_){_[_.UNSIGNALED=37144]="UNSIGNALED",_[_.SIGNALED=37145]="SIGNALED"}(q||(q={})),function(_){_[_.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",_[_.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",_[_.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",_[_.WAIT_FAILED=37149]="WAIT_FAILED"}(w||(w={})),function(_){_[_.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(z||(z={})),function(_){_[_.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}($||($={})),function(_){_[_.INVALID_ENUM=1280]="INVALID_ENUM",_[_.INVALID_VALUE=1281]="INVALID_VALUE",_[_.INVALID_OPERATION=1282]="INVALID_OPERATION",_[_.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",_[_.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",_[_.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL"}(__||(__={})),function(_){_[_.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR"}(E_||(E_={}));export{A as BlendFactor,T as BlendOperation,E as BufferContent,N as BufferType,w as ClientWaitSyncStatus,e as ColorAttachment0,i as ColorAttachment1,m as ColorAttachment10,Q as ColorAttachment11,j as ColorAttachment12,s as ColorAttachment13,y as ColorAttachment14,v as ColorAttachment15,r as ColorAttachment2,W as ColorAttachment3,x as ColorAttachment4,K as ColorAttachment5,a as ColorAttachment6,b as ColorAttachment7,Z as ColorAttachment8,d as ColorAttachment9,C as CompareFunction,l as CompressedTextureFormat,I as CullMode,O as DataType,h as DepthAttachment,g as DepthStencilAttachment,__ as ErrorConstant,E_ as Extension,S as Face,_ as FramebufferBit,t as FramebufferTarget,M as PixelFormat,X as PixelType,R as PrimitiveType,o as ResourceType,f as ShaderType,n as SizedDepthFormat,H as SizedDepthStencilFormat,B as SizedPixelFormat,V as SizedStencilFormat,u as SpecialDrawBuffers,k as StencilAttachment,D as StencilOperation,z as SyncCondition,$ as SyncFlag,p as SyncParameter,q as SyncStatus,U as TextureConstants,L as TextureSamplingMode,G as TextureType,P as TextureWrapMode,J as UniformType,F as UnsizedDepthFormat,Y as Usage,c as baseTextureUnit};
|
|
@@ -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/Error.js";import e from"../../core/Logger.js";import{SizedPixelFormat as n,SizedDepthFormat as r,SizedDepthStencilFormat as i,CompressedTextureFormat as o,TextureType as u,PixelType as a,PixelFormat as l,UnsizedDepthFormat as c}from"./enums.js";const h=()=>e.getLogger("esri/views/webgl/textureUtils");function s(t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&h().error("Negative dimension parameters are not allowed!")}function d(t){return t in n}function m(t){return t in r}function f(t){return t in i}function E(t){return t in o}function T(t){return null!=t&&"type"in t&&"compressed"===t.type}function
|
|
5
|
+
import t from"../../core/Error.js";import e from"../../core/Logger.js";import{SizedPixelFormat as n,SizedDepthFormat as r,SizedDepthStencilFormat as i,CompressedTextureFormat as o,TextureType as u,PixelType as a,PixelFormat as l,UnsizedDepthFormat as c}from"./enums.js";const h=()=>e.getLogger("esri/views/webgl/textureUtils");function s(t){(null!=t.width&&t.width<0||null!=t.height&&t.height<0||null!=t.depth&&t.depth<0)&&h().error("Negative dimension parameters are not allowed!")}function d(t){return t in n}function m(t){return t in r}function f(t){return t in i}function E(t){return null!=t&&t in o}function T(t){return null!=t&&"type"in t&&"compressed"===t.type}function g(t){return E(t.descriptor.internalFormat)}function p(t){return null!=t&&"byteLength"in t}function w(t){return null!=t&&!T(t)&&!p(t)}function R(t){return t===u.TEXTURE_3D||t===u.TEXTURE_2D_ARRAY}function F(t,e,n,r=1){let i=Math.max(e,n);return t===u.TEXTURE_3D&&(i=Math.max(i,r)),Math.floor(Math.log2(i))+1}function B(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case a.FLOAT:switch(e.pixelFormat){case l.RGBA:return n.RGBA32F;case l.RGB:return n.RGB32F;default:throw new t("texture:unknown-format","Unable to derive format")}case a.UNSIGNED_BYTE:switch(e.pixelFormat){case l.RGBA:return n.RGBA8;case l.RGB:return n.RGB8}}const{pixelFormat:o}=e;return e.internalFormat=o===c.DEPTH_STENCIL?i.DEPTH24_STENCIL8:o===c.DEPTH_COMPONENT?r.DEPTH_COMPONENT24:o,e.internalFormat}function G(t){let e="width"in t?t.width:t.codedWidth,n="height"in t?t.height:t.codedHeight;const r=1;return t instanceof HTMLVideoElement&&(e=t.videoWidth,n=t.videoHeight),{width:e,height:n,depth:r}}export{F as calcMipmapLevels,B as deriveInternalFormat,G as getDimensions,R as is3DTarget,p as isArrayBufferView,T as isCompressedData,E as isCompressedFormat,g as isCompressedTexture,m as isSizedDepthFormat,f as isSizedDepthStencilFormat,d as isSizedPixelFormat,w as isTexImageSource,s as validateTexture};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{LayerTreeNode as o}from"../support/LayerTreeNode.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as r}from"../../support/jsxFactory.js";var
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as t}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{LayerTreeNode as o}from"../support/LayerTreeNode.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as r}from"../../support/jsxFactory.js";var n;const c={expand:"expand",collapse:"collapse",hideSublayer:"hideSublayer",showSublayer:"showSublayer"},a="esri-building-disciplines-tree-node",p={base:a,label:`${a}__label`,level:e=>`${a}--level-${e}`};let d=class extends s{static{n=this}constructor(e){super(e),this.messages=c,this.toggleSiblingsVisibility=!1,this._onCheckboxClick=e=>{e.stopPropagation();(e.metaKey||e.ctrlKey)&&this.toggleSiblingsVisibility&&(this.node.toggleVisibility(),this.node.toggleAllSiblingsVisibility())},this._onCheckboxToggle=e=>{this.node.toggleVisibility(e.currentTarget.checked)}}static loadDependencies(){return l({checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),tree:()=>import("@esri/calcite-components/dist/components/calcite-tree"),"tree-item":()=>import("@esri/calcite-components/dist/components/calcite-tree-item")})}loadDependencies(){return n.loadDependencies()}static{this.vnodeSelector="calcite-tree-item"}render(){const{node:e,messages:i}=this;if(e.isDiscipline&&!e.hasChildren)return r("div",{key:`${e.id}-empty`});const t=e.visible,s=!0===t,o=null===t,l=s?i?.hideSublayer:i?.showSublayer;return r("calcite-tree-item",{class:p.base,key:e.id},r("calcite-label",{class:p.label,layout:"inline"},r("calcite-checkbox",{checked:s,indeterminate:o,label:l,onclick:this._onCheckboxClick,title:l,onCalciteCheckboxChange:this._onCheckboxToggle}),e.title),this._renderedChildren)}get _renderedChildren(){const{node:e}=this;if(!e.hasChildren)return null;const{messages:i}=this,{toggleSiblingsVisibility:t}=this;return r("calcite-tree",{lines:!0,selectionMode:"none",slot:"children"},this.node.children.toArray().reverse().map((e=>r(n,{messages:i,node:e,toggleSiblingsVisibility:t}))))}};e([i({type:o})],d.prototype,"node",void 0),e([i()],d.prototype,"messages",void 0),e([i({nonNullable:!0})],d.prototype,"toggleSiblingsVisibility",void 0),e([i()],d.prototype,"_renderedChildren",null),d=n=e([t("esri.widgets.BuildingExplorer.BuildingDisciplinesTree.BuildingDisciplinesNode")],d);const h=d;export{h as default};
|