@arcgis/core 5.2.0-next.119 → 5.2.0-next.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/arcade/ArcadeDate.js +1 -1
  2. package/arcgisGlobal.d.ts +1 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/090c9c2dbf92f2cac0b8.js +1 -0
  5. package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +1 -0
  6. package/assets/esri/core/workers/chunks/{be4de7111bc21bc69de1.js → 2e999b05ce179dd9fa08.js} +1 -1
  7. package/assets/esri/core/workers/chunks/39985c51465b79ff0910.js +1 -0
  8. package/assets/esri/core/workers/chunks/4165eb86471ea3bbf364.js +1 -0
  9. package/assets/esri/core/workers/chunks/{731ec5de16753e10b963.js → 46388b86d1b10e6121bd.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{bdcca906fdfb8e179abb.js → 4efe5827a5c61db3b19d.js} +2 -2
  11. package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +1 -0
  12. package/assets/esri/core/workers/chunks/519ed8e6edd0f0014686.js +1 -0
  13. package/assets/esri/core/workers/chunks/{3c3e5e952fd6740bb234.js → 54f9062526c2002b7fd7.js} +1 -1
  14. package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +1 -0
  15. package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +1 -0
  16. package/assets/esri/core/workers/chunks/66ef6c034455abd61f39.js +1 -0
  17. package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +1 -0
  18. package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +1 -0
  19. package/assets/esri/core/workers/chunks/87aaed3dfa903bdf853c.js +1 -0
  20. package/assets/esri/core/workers/chunks/892dc038d569cffd26dc.js +1 -0
  21. package/assets/esri/core/workers/chunks/8ce14dd209462f88b163.js +1 -0
  22. package/assets/esri/core/workers/chunks/ab3d19c77e81fe3a099d.js +1 -0
  23. package/assets/esri/core/workers/chunks/bdf0b4653ee455e72f04.js +1 -0
  24. package/assets/esri/core/workers/chunks/c118b88a7c4359e68d9b.js +1 -0
  25. package/assets/esri/core/workers/chunks/cbeba973ef5593ffbba3.js +1 -0
  26. package/assets/esri/core/workers/chunks/ceda1e08c9ff26248db0.js +1 -0
  27. package/assets/esri/core/workers/chunks/{06e7411c5bed0a414031.js → d6130cd8a20d24dd9d3c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{49c6dc487714f9cd55c7.js → ddb5d29a8998d0a76fd4.js} +1 -1
  29. package/assets/esri/core/workers/chunks/e9f8325a4cf89ae816cc.js +1 -0
  30. package/assets/esri/core/workers/chunks/f2fca9a3a40170996ea2.js +1 -0
  31. package/assets/esri/core/workers/chunks/f5d06cd6d30a5f742f73.js +1 -0
  32. package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +1 -0
  33. package/chunks/ColorMaterial.glsl.js +8 -8
  34. package/chunks/GaussianSplat.glsl.js +13 -8
  35. package/chunks/GaussianSplatShadow.glsl.js +33 -4
  36. package/chunks/languageUtils.js +1 -1
  37. package/config.js +1 -1
  38. package/core/has.js +1 -1
  39. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  40. package/kernel.js +1 -1
  41. package/layers/support/NumericRange.d.ts +41 -0
  42. package/layers/support/fieldUtils.d.ts +9 -0
  43. package/linkChart/LinkChartProperties.js +1 -1
  44. package/package.json +4 -4
  45. package/support/revision.js +1 -1
  46. package/time/ianaZone.js +2 -0
  47. package/time/timeZoneUtils.js +1 -1
  48. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  49. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  50. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  51. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
  52. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  53. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  54. package/views/3d/analysis/LineOfSight/types.d.ts +1 -0
  55. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  56. package/views/3d/focusAreaUtils.js +1 -1
  57. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  58. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  59. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  60. package/views/3d/layers/graphics/extrudePolygon.js +2 -0
  61. package/views/3d/navigation/Navigation3D.js +1 -1
  62. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  63. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  64. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  65. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  66. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  67. package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
  68. package/views/3d/webgl-engine/lib/GaussianSplatPrepassDepthRenderer.js +2 -0
  69. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
  70. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  71. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  72. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  73. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  74. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  75. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  76. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +38 -27
  77. package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
  78. package/views/SceneView.d.ts +1 -1
  79. package/views/SceneView.js +1 -1
  80. package/views/draw/plugins/PolygonPlugin.js +1 -1
  81. package/webmap/utils.js +1 -1
  82. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  83. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +43 -2
  84. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  85. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +11 -0
  86. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  87. package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -0
  88. package/widgets/OrientedImageryViewer.js +1 -1
  89. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  90. package/assets/esri/core/workers/chunks/2c21f4744e19b925a6ae.js +0 -1
  91. package/assets/esri/core/workers/chunks/2c9783e3b44986e86797.js +0 -1
  92. package/assets/esri/core/workers/chunks/45858d1c6487f4a98e40.js +0 -1
  93. package/assets/esri/core/workers/chunks/497c5a9c95e9a89ac217.js +0 -1
  94. package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +0 -1
  95. package/assets/esri/core/workers/chunks/54f3bc940cea15fce2c7.js +0 -1
  96. package/assets/esri/core/workers/chunks/5f79ba5639067f734791.js +0 -1
  97. package/assets/esri/core/workers/chunks/61ea3493b477ddc442e6.js +0 -1
  98. package/assets/esri/core/workers/chunks/6b9d29ca568590358478.js +0 -1
  99. package/assets/esri/core/workers/chunks/7243d5721bb6a7329055.js +0 -1
  100. package/assets/esri/core/workers/chunks/7adff63fd66fab505ae6.js +0 -1
  101. package/assets/esri/core/workers/chunks/84b89c523d3e16a5ee46.js +0 -1
  102. package/assets/esri/core/workers/chunks/85c876ee9e63d5732937.js +0 -1
  103. package/assets/esri/core/workers/chunks/8cc95d827f460909d442.js +0 -1
  104. package/assets/esri/core/workers/chunks/97fea852f8e93e1286e4.js +0 -1
  105. package/assets/esri/core/workers/chunks/a5466c864c3ead9aac5a.js +0 -1
  106. package/assets/esri/core/workers/chunks/a774006be107e449bc29.js +0 -1
  107. package/assets/esri/core/workers/chunks/bb56ab53c5a10c9518a6.js +0 -1
  108. package/assets/esri/core/workers/chunks/d5defba320f2e49a377f.js +0 -1
  109. package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +0 -1
  110. package/assets/esri/core/workers/chunks/ebe7ba2557b50e18e547.js +0 -1
  111. package/assets/esri/core/workers/chunks/edd36e98355f1655e5c8.js +0 -1
  112. package/assets/esri/core/workers/chunks/f66e597e524b26e61cd3.js +0 -1
  113. package/views/3d/layers/graphics/extrudeUtils.js +0 -2
  114. /package/assets/esri/core/workers/chunks/{bdcca906fdfb8e179abb.js.LICENSE.txt → 4efe5827a5c61db3b19d.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as g,multiply as b,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as I}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as w}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as S,RenderNodeOutput as D,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as N}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as H}from"../../support/debugFlags.js";import{FBOCache as F}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as v}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as q,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{NavigationDepthCache as J}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as X}from"./OrderIndependentTransparency.js";import{RenderContext as $,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment0 as ue,ColorAttachment2 as _e,DrawBufferNone as me}from"../../../webgl/enums.js";const pe=has("disable-feature:async-navigation-3d-depth-readback");let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new re,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(z.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new F(i),this._compositor=new Q(i,s),this._renderStateFeatures=m(te(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,s),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this.navigationDepthCache=new J(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new G(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new v({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>H.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;w(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,W.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new B(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this.isFeatureEnabled(e,t)!==s&&(this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(S.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){const e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&!0===e?.hasHighQuality}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._bindParameters.globalIllumination=n(this._bindParameters.globalIllumination),this._bindParameters.reprojection.lastFrameDepth=n(this._bindParameters.reprojection.lastFrameDepth),this._bindParameters.reprojection.lastFrameEmission=n(this._bindParameters.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=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:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&f(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...we),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(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,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(D.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(S.LASERLINES),this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(S.CUTFILL_COMPUTATION,e)),this._pluginInput.set(S.FOCUSAREA_MASK,this._renderFocusAreaMask()),u.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(S.VIEWSHED,e)),u.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(S.FOCUSAREA,e)),this._pluginInput.release(S.FOCUSAREA_MASK),u.update(e=>this._renderNodes(S.CUTFILL,e)),this._pluginInput.release(S.GROUND_DEPTH),u.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(S.ANTIALIASING,e));const f=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;let b;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(S.HIGHLIGHT,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.emissions=g,u.update(e=>this._renderNodes(S.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),pe||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission?.release(),this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(de))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(b=u.color,b.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(b,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...be),t.output=0,this._plugins.precompile(...be),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(S.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL,S.LASERLINES,S.FOCUSAREA,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(S.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,S.MAGNIFIER),this._nodes.precompile(S.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){const e=this._nodes.produce(S.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(S.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,S.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(S.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e,i=s?this.performanceInfo.elapsedTime:0;if(s||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);const r=Math.max(i,e);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.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._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(S.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(S.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){this._bindParameters.depth=n(this._bindParameters.depth);const e=this._pluginInput.get("normals");if(e){this._pluginInput.set(S.AMBIENT_ILLUMINATION,this._renderAmbientIllumination());const t=this._needsDepth;if(t){const s=e.obtainAttachment(ue);this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),this._bindParameters.depth=e.obtainDepthTexture(),this._bindParameters.depth?.retain(t-1),e.attachColor(s,ue),s?.release(),this.performanceInfo.advance(oe.DEPTH)}else e.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._releaseGlobalIlluminationBuffers(),this._bindParameters.ssao=null,this._pluginInput.set(S.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(S.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const s=Y(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ae)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(S.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(S.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(S.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...R,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_renderAmbientIllumination(){const e=this._bindParameters,t=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);return this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:t,e.globalIllumination=this.hasGlobalIllumination?t:null,e.globalIlluminationEnabled=null!=e.globalIllumination,t&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?oe.AMBIENT_ILLUMINATION_HIGH_QUALITY:oe.AMBIENT_ILLUMINATION),t}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...be),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...Ie);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Ie),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(S.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Se)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Se),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ae)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile("opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...be)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...we),this._bindParameters.output=2,this._plugins.precompile(...we),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...we)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>q?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...N)+this._nodes.optional("highlights",...N)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ee),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(S.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._pluginInput.set(S.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(de,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(X),_&&this._rctx.clearBuffer(2,X),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(de,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:de;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),f?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(S.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(S.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([me,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(g(Ne,t.viewMatrix),g(Re,t.projectionMatrix),b(Oe,Ne,Re),b(Oe,s.viewMatrix,Oe),b(Oe,s.projectionMatrix,Oe),this._reprojectionMatrix=Oe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(b(He,s.viewMatrix,Ne),P(t,He)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const fe=[0,1,2,3],ge=[7,6,4,5],be=[7,6],Pe=[0,1,2,4,...be],Ae=[3,5],Ie=[2,4,8],we=[16,12,14,13],Ee=[4,5,2,3,0,1,...be],Ce=[4,8,5,11],Te={0:[13],1:[12],2:[13,12],3:[13,12]},Se=[0,1,...be],De=["normals","highlights"],Re=I(),Ne=I(),Oe=I(),He=I();function Fe(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
2
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{removeMaybe as i,abortMaybe as r,destroyMaybe as a,releaseMaybe as n,releaseReferencedMaybe as h}from"../../../../core/maybe.js";import{throwIfAborted as o}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as l,initial as u,sync as _}from"../../../../core/reactiveUtils.js";import{signal as m}from"../../../../core/signal.js";import{property as p,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{equals as f,invert as g,multiply as b,copy as P}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as A,create as w}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as I}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{fromValues as E,ZEROS as C}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as T}from"../../../../geometry/support/Indices.js";import{InternalRenderCategory as S,RenderNodeOutput as D,AllRenderNodeOutputs as R,AllInternalRenderNodeOutputs as N}from"../../webgl.js";import{minNearDistanceInMeters as O}from"../../state/NearFarHeuristic.js";import{debugFlags as H}from"../../support/debugFlags.js";import{FBOCache as F}from"../core/FBOCache.js";import{RenderPassManager as x}from"../core/renderPasses/RenderPassManager.js";import{isColor as y}from"../core/shaderLibrary/ShaderOutput.js";import{RenderNodes as G}from"../effects/RenderNodes.js";import{RenderPluginManager as M}from"../effects/RenderPluginManager.js";import{WeatherFader as v}from"../effects/WeatherFader.js";import{innerAtmosphereFadeStart as L}from"../effects/atmosphere/atmosphereUtils.js";import{Blit as U}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as q,renderHighlightBuffer as j}from"../effects/highlight/Highlight.js";import{OITBlend as B}from"../effects/transparency/OITBlend.js";import{AnimationTimer as V}from"./AnimationTimer.js";import{AnimationTimeStep as k}from"./AnimationTimeStep.js";import{BoundingInfo as W}from"./BoundingInfo.js";import{Compositor as Q}from"./Compositor.js";import{DepthRange as z}from"./DepthRange.js";import{depthRangeFromScene as Y}from"./depthRangeUtils.js";import{MainFramebuffer as K}from"./MainFramebuffer.js";import{NavigationDepthCache as J}from"./NavigationDepthCache.js";import{blendingColorAlphaClear as X}from"./OrderIndependentTransparency.js";import{RenderContext as $,defaultRenderOccludedMask as Z}from"./RenderContext.js";import{RendererBase as ee}from"./RendererBase.js";import{setupFeatureDefaults as te}from"./RenderFeature.js";import{RenderPluginInput as se}from"./RenderPluginInput.js";import{ShadowMap as ie}from"./ShadowMap.js";import re from"./SliceHelper.js";import{MergedRenderer as ae}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as ne}from"../parts/renderUtils.js";import{RendererPerformanceInfo as he,PerformanceCategory as oe}from"../statistics/RendererPerformanceInfo.js";import{ColorAttachment1 as de,PixelType as le,ColorAttachment0 as ue,ColorAttachment2 as _e,DrawBufferNone as me}from"../../../webgl/enums.js";const pe=has("disable-feature:async-navigation-3d-depth-readback");let ce=class extends ee{constructor(e,t,s,i,r){super({stage:e}),this._techniques=s,this._rctx=i,this._requestRender=r,this._pluginsHas={occludedHudElements:!1,hudElements:!1,water:!1},this.renderPassManager=new x,this._isRendering=!1,this._backgroundColor=E(0,0,0,1),this._sliceHelper=new re,this._shadowAccumulator=null,this._shadowCastOptions=null,this.sceneDepthRange=m(z.Infinite),this._state=m(2),this._hasAnimations=!1,this._animationTimestep=new k,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=m(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new se,this._hasTransparentGeometry=!1,this._releaseNodeInputs=e=>{for(const t of De)e.some(({name:e})=>e===t)&&this._pluginInput.release(t)},this._testsNeedsDepth=!1,this._fboCache=new F(i),this._compositor=new Q(i,s),this._renderStateFeatures=m(te(e.view.qualityProfile));const a=new ie(this._fboCache,e.viewingMode);this._renderContext=new $(this._rctx,a,s),this._framebuffer=new K(this._fboCache,this._bindParameters),this._performanceInfo=new he(this._rctx),this._blit=new U(s),this.navigationDepthCache=new J(this._rctx,this._fboCache,s,()=>this._requestRender(0)),this._nodes=new G(this._renderContext),this._plugins=new M({renderContext:this._renderContext,techniques:s,materials:t,requestRender:r,controller:e}),this._plugins.add(this.renderPassManager),this.weatherFader=new v({view:e.view,context:this._renderContext}),this.addHandles([d(()=>e.view.state.camera,()=>r(),l),d(()=>H.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},r()},u),d(()=>e.view.environment.background?.color,e=>{const t=e?e.toUnitRGBA():C;I(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),r()},l),d(()=>e.view.environmentManager.shadowsAvailable,e=>{this._bindParameters.shadowMap.enabled=e,this._requestRender(1)},l),d(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},_),d(()=>this._bindParameters.clouds.data?.state,()=>r(),_),d(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,r()},u),d(()=>"sun"===e.view.environment.lighting?.type,e=>{this._bindParameters.enableFillLights=e,this._requestRender()},l)])}destroy(){this._gpuTimerHandle=i(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowAccumulator=null,this._shadowCastOptions=null,this._loadEdgeViewTask=r(this._loadEdgeViewTask),this._edgeView=a(this._edgeView),this.renderPassManager.dispose(),this.weatherFader=a(this.weatherFader),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.navigationDepthCache.destroy(),this._fboCache.destroy(),this._fboCache=null,this._renderContext.destroy(),this._plugins.destroy(),this._pluginInput=null,this._oitBlendOrNil=null,this._nodes=null,this._framebuffer=null,this._performanceInfo=null,W.prune(),ae.prune(),T()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _oitBlend(){return this._oitBlendOrNil??=new B(this._techniques),this._oitBlendOrNil}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e){this._renderStateFeatures.value=te(e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,s){this.isFeatureEnabled(e,t)!==s&&(this._renderStateFeatures.mutate(i=>i.set(t,e,s)),this._requestRender())}setTime(e){this._renderContext.time=e}get hasReflections(){return this._bindParameters.screenSpaceReflections.enabled=this._pluginsHas.water&&this.isFeatureEnabled(4),this._bindParameters.screenSpaceReflections.enabled}get _hasHighlights(){return this._plugins.produces(10,2,4,18,12,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(10,12,13,14)}get hasAmbientIllumination(){return this._nodes.produces(S.AMBIENT_ILLUMINATION)}get hasGlobalIllumination(){return this.stage.renderView?.globalIllumination?.enabled??!1}get hasGlobalIlluminationHighQuality(){const e=this.stage.renderView?.globalIllumination;return this.hasGlobalIllumination&&!0===e?.hasHighQuality}get hasSMAA(){return this.isFeatureEnabled(0)}get _emissions(){const e=this._plugins.emissions;return this._hasTransparentGeometry?e:1===e||3===e?1:0}get hasFloatBlend(){return this._rctx.driverTest.floatBufferBlend.result&&this.isFeatureEnabled(9)}get highResolutionAtmosphere(){return this.isFeatureEnabled(2)}get fboCache(){return this._fboCache}setShadowAccumulator(e){this._shadowAccumulator=e,this._shadowCastOptions&&e.setParameters(this._shadowCastOptions)}_releaseFBOs(){this._bindParameters.hudOcclusion=n(this._bindParameters.hudOcclusion),this._bindParameters.depth=null}_disposeOffscreenBuffers(){this._framebuffer.dispose();const e=this._bindParameters;e.globalIllumination=n(e.globalIllumination),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),this._disposeBindBuffers()}_disposeBindBuffers(){this._bindParameters.shadowMap.disposeOutputs()}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._plugins.updating||this.weatherFader?.readyToRun||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=s(async e=>{const{EdgeView:t}=await(import("./edgeRendering/EdgeView.js"));o(e);const s=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:Fe(this.stage.view.resourceController)});return this.addHandles(d(()=>s.updating,()=>this._requestRender(),_)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(s)),this._edgeViewCallbacks.length=0,s})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView().catch(()=>{}),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&f(this._bindParameters.reprojection.matrix,A)}set _reprojectionMatrix(e){t(this._bindParameters.reprojection.matrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._bindParameters.shadowMap.enabled}setParameters(e){e.shadowCast&&(this._shadowCastOptions={...this._shadowCastOptions,...e.shadowCast},this._shadowAccumulator?.setParameters(e.shadowCast))}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}addRenderer(e){this._plugins.add(e)}removeRenderer(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this._occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get _occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.occludedHudElements=this._plugins.produces(0,13),has.hudElements=has.occludedHudElements||this._plugins.produces(0,...Ie),has.water=this._plugins.produces(4,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new V(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const s=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==s&&(this._gpuTimerHandle=s?i(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,s=!1){try{return this._isRendering=!0,this._render(e,t,s)}catch(i){console.error(`Exception during rendering: ${i}:\n${i.stack}`)}finally{this._isRendering=!1}return new ne(this._pluginInput.get(D.FINAL),null)}_render(e,t,s){const i=0===t;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=i,this._disposeBindBuffers();const{camera:r,contentCamera:a,mode:o,alignPixelEnabled:d}=e;this._state.value=o,this._bindParameters.frameRendererTarget=t,this._bindParameters.output=0,this._bindParameters.emissions=this._emissions,this._bindParameters.alignPixelEnabled=d,this._bindParameters.decorations=!s,this._bindParameters.mainDepth=null,this._bindParameters.useFloatBlend.value=this.hasFloatBlend;const l=!s||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=l?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(S.VIEWSHED),this._bindParameters.laserlinesEnabled=this._nodes.produces(S.LASERLINES),this._bindParameters.shadowAnalysisEnabled=!!this._shadowAccumulator?.active,this._bindParameters.cutFillComputationEnabled=this._nodes.produces(S.CUTFILL_COMPUTATION),this._bindParameters.cutFillVisualizationEnabled=this._nodes.produces(S.CUTFILL),this._ensureBindParameters(r,a),this._plugins.sortTestsTransparentOrderedSlots(Ce),this._plugins.prepareRender(),this._hasTransparentGeometry=this._plugins.produces(1,...ge),this._renderOverlay(),r.setGLViewport(this._rctx);const u=this._framebuffer,_=u.initialize(r.fullWidth,r.fullHeight,this._backgroundColor),m=this._needsLastFrameColor;m?(_?.retain(m-1),_?.setName("last frame color"),this._bindParameters.reprojection.lastFrameColor?.release(),this._bindParameters.reprojection.lastFrameColor=_):_?.release(),this._bindParameters.hasShadowHighlights=this._needsShadowHighlight&&!s,this._precompilePrepasses(),this.performanceInfo.advance(oe.PREPARE);const p=this._computeShadowDepthRange(r);this._pluginInput.set("normals",this._renderNormals()),this._renderAmbientIlluminationAndDepth(),this._renderShadowMap(r,a,this._bindParameters.lighting.mainLight.direction,p),this._renderShadowAccumulation(p),u.bind(),this._bindParameters.mainDepth=u.depth.attachment,this._precompileShaders(i),this._bindParameters.output=0,this._renderOpaque(),this._renderPreTransparent(),this._renderTransparent(),this.hasReflections&&(this._bindParameters.depth=h(this._bindParameters.depth),this._bindParameters.reprojection.lastFrameColor=h(this._bindParameters.reprojection.lastFrameColor)),this._bindParameters.shadowMap.disposeOutput(5),u.update(e=>this._renderNodes(S.CUTFILL_COMPUTATION,e)),this._pluginInput.set(S.FOCUSAREA_MASK,this._renderFocusAreaMask()),u.update(e=>this._renderNodes(S.TRANSPARENT_ENVIRONMENT,e)),u.update(e=>this._renderNodes(S.VIEWSHED,e)),u.update(e=>this._renderNodes(S.LASERLINES,e)),this._nodes.requireGeometryDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),u.update(e=>this._renderNodes(S.FOCUSAREA,e)),this._pluginInput.release(S.FOCUSAREA_MASK),u.update(e=>this._renderNodes(S.CUTFILL,e)),this._pluginInput.release(S.GROUND_DEPTH),u.update(e=>this._renderNodes(S.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass());const c=2===t?this._renderObjectAndLayerIdColor():null;u.update(e=>this._renderNodes(D.COMPOSITE,e)),this._bindParameters.shadowMap.disposeOutputs(),this._bindParameters.shadowHighlight=n(this._bindParameters.shadowHighlight),u.update(e=>this._renderNodes(S.ANTIALIASING,e));const f=this._hasTransparentGeometry?2:1,g=this._bindParameters.emissions;let b;return this._bindParameters.emissions=0,this._hasHUDHighlights&&u.update(e=>this._renderHUD(f,e)),u.update(e=>this._renderNodes(S.HIGHLIGHT,e)),this._hasHUDHighlights||u.update(e=>this._renderHUD(f,e)),this._bindParameters.emissions=g,u.update(e=>this._renderNodes(S.MAGNIFIER,e)),u.update(e=>this._renderNodes(D.FINAL,e)),i&&(this._blit.toFramebuffer(u.color,this._bindParameters),pe||2!==o&&0!==o||this.navigationDepthCache.update(this._bindParameters,u.depth.attachment,this._renderContext.time)),this._bindParameters.reprojection.lastFrameDepth?.release(),this._bindParameters.reprojection.lastFrameEmission?.release(),this.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth,0!==this._emissions&&(this._bindParameters.reprojection.lastFrameEmission=u.color.obtainAttachment(de))),this._testsNeedsDepth&&(this._bindParameters.depth=h(this._bindParameters.depth)),this._releaseFBOs(),u.releaseDepth(),this._bindParameters.reprojection.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),i||(b=u.color,b.retain(),this._releaseFBOs(),this._disposeOffscreenBuffers()),this.performanceInfo.finishFrame(),new ne(b,c)}_precompileShaders(e){++this._plugins.context.techniques.precompiling;const t=this._bindParameters;t.output=0;const s=t.emissions;if(this._precompileOpaqueGeometry(),this._nodes.precompile(S.OPAQUE_ENVIRONMENT,S.GAUSSIAN_SPLAT,S.OPAQUE_OCCLUSION_QUERY,S.VOXEL),this._precompileOpaqueGeometry(),t.output=3,this._plugins.precompile(...be),t.output=0,this._plugins.precompile(...be),this._hasTransparentGeometry){const e=this._pluginsHas.occludedHudElements;this._oitBlend.precompile(t,e,0),this._pluginsHas.hudElements&&this._oitBlend.precompile(t,!1,1),this._precompileTransparentGeometry(),t.hasTransparentEmission&&(t.emissions=3)}this._nodes.precompile(S.FOCUSAREA_MASK),this._compositor.precompile(this._usesPremultipliedAlphaBlit,!!this._needsEdges,t),this._hasTransparentGeometry||this._plugins.precompile(15),this._nodes.precompile(S.TRANSPARENT_ENVIRONMENT,S.VIEWSHED,S.CUTFILL_COMPUTATION,S.CUTFILL,S.LASERLINES,S.FOCUSAREA,S.OCCLUDED,S.ANTIALIASING),t.highlightMixTexture=t.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(0),t.emissions=0,this._precompileHUD(0),this._precompileHUD(1),t.emissions=s,this._hasHighlights&&(t.highlights.forEach((e,s)=>{t.highlightLevel=s,this._precompileAllGeometry(10),this._hasHUDHighlights&&this._plugins.precompile(13,12)}),t.highlightLevel=null,this._nodes.precompile(S.HIGHLIGHT)),t.highlightMixTexture=null,this._nodes.precompile(D.COMPOSITE,S.MAGNIFIER),this._nodes.precompile(S.TRANSPARENT_NO_DEPTH),this._plugins.precompile(8),t.hasOpaqueEmission&&(t.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.precompile(8),t.transparentWithoutDepthEmissionDimmingPass=!1),e&&this._blit.precompile(),--this._plugins.context.techniques.precompiling}_renderFocusAreaMask(){const e=this._nodes.produce(S.FOCUSAREA_MASK,this._pluginInput);return e&&this.performanceInfo.advance(oe.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces(S.OBJECT_AND_LAYER_ID_COLOR))return null;const e=this._bindParameters.output;++this._techniques.precompiling;const{width:t,height:s}=this._framebuffer.size;let i=this.fboCache.acquire(t,s,S.OBJECT_AND_LAYER_ID_COLOR).acquireDepth(14);return i=this._renderNodes(S.OBJECT_AND_LAYER_ID_COLOR,i),--this._techniques.precompiling,this._bindParameters.output=e,i}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,s=0===e,i=s?this.performanceInfo.elapsedTime:0;if(s||t){let e=0;t?e=this.performanceInfo.totalGPUTimeSampler.last:(this._rctx.gl.finish(),e=this.performanceInfo.elapsedTime);const r=Math.max(i,e);this._animationTimestep.frame(r,s)}}readAccumulatedShadow(e){return this._shadowAccumulator?.readAccumulatedShadow(e[0],e[1])??0}readMainDepth(e,t){const{mainDepth:s,camera:i}=this._bindParameters;if(!s)return;const r=this.fboCache.acquire(this._framebuffer.size.width,this._framebuffer.size.height,"linear depth");this._rctx.bindFramebuffer(r.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._compositor.blitDepthToLinearDepth(this._bindParameters,s),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),r.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,le.UNSIGNED_BYTE,t),r.release()}get _needsEdges(){return this._edgeView?.shouldRender()?this._edgeView:null}_renderEdges(e){const t=this._needsEdges;if(!t)return;const{width:s,height:i}=this._framebuffer.size,r=this.fboCache.acquire(s,i,"edges");r.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(C),t.render(this._bindParameters,e),r.detachDepth(),this._framebuffer.bind(),this._compositor.composite(this._bindParameters,r.getTexture()),r.release(),this.performanceInfo.advance(1===e?oe.OPAQUE_EDGES:oe.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(this._renderContext.time),this._bindParameters.overlay&&this.performanceInfo.advance(oe.OVERLAY)}_renderShadowMap(e,t,s,i){if(!this.shadowsEnabled)return;const r=this._bindParameters.shadowMap;if(r.start(e,s,i,this.isFeatureEnabled(5),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight){this._renderShadowCascades(6,r),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t);const s=this._bindParameters.output;this._bindParameters.output=0,this._bindParameters.shadowHighlight=this._nodes.produce(S.SHADOW_HIGHLIGHT,this._pluginInput),this._bindParameters.output=s,r.disposeOutput(6),r.clear(),this._renderShadowCascades(7,r)}else this._renderShadowCascades(5);e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,this._bindParameters.contentCamera),this._needsShadowHighlight&&(this._bindParameters.depth=h(this._bindParameters.depth)),this.performanceInfo.advance(S.SHADOWMAP)}_precompileShadowCascades(e){0!==this._bindParameters.shadowMap.cascades.length&&this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._bindParameters.shadowMap){const s=this._bindParameters.output,i=6!==e;t.bindFramebuffer();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e),i&&this._renderShadowNodes(t.renderTarget);t.finish(e),this._bindParameters.output=s}_renderShadowNodes(e){this._renderInternalNodeCategory(S.SHADOWMAP,e)}get _needsLastFrameColor(){return+this.hasReflections+ +this.hasGlobalIllumination}get _needsDepth(){return+this._nodes.requireGeometryDepth+ +this.hasReflections+ +this.hasGlobalIllumination+ +this._testsNeedsDepth+ +this._needsShadowHighlight}get _usesPremultipliedAlphaBlit(){return this._pluginsHas.hudElements}_renderAmbientIlluminationAndDepth(){const e=this._bindParameters;e.depth=n(this._bindParameters.depth);const t=this._pluginInput.get("normals");if(t){const s=this._nodes.produce(S.AMBIENT_ILLUMINATION,this._pluginInput);this._pluginInput.set(S.AMBIENT_ILLUMINATION,s),this._releaseGlobalIlluminationBuffers(),e.ssao=this.hasGlobalIllumination?null:s,e.globalIllumination=this.hasGlobalIllumination?s:null,e.globalIlluminationEnabled=null!=e.globalIllumination,s&&this.performanceInfo.advance(this.hasGlobalIlluminationHighQuality?oe.AMBIENT_ILLUMINATION_HIGH_QUALITY:oe.AMBIENT_ILLUMINATION);const i=this._needsDepth;if(i){const s=t.obtainAttachment(ue);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(i-1),t.attachColor(s,ue),s?.release(),this.performanceInfo.advance(oe.DEPTH)}else t.detachDepth();this.hasAmbientIllumination&&this._pluginInput.release("normals")}else this._releaseGlobalIlluminationBuffers(),e.ssao=null,this._pluginInput.set(S.AMBIENT_ILLUMINATION,null),this._renderAllGeometryDepth()}_renderAllGeometryDepth(){const e=this._needsDepth;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"geometry depth",14);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this.renderAllGeometry(3),this._renderGaussianSplatPrepassDepth(i),this._bindParameters.depth=i.obtainDepthTexture(),this._bindParameters.depth?.retain(e-1),i.release(),this.performanceInfo.advance(oe.DEPTH)}_renderGaussianSplatPrepassDepth(e){const t=this._shadowAccumulator;if(!t?.active||!t.requireGeometryDepth)return;const s=this._bindParameters.output;this._bindParameters.output=3,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=s}_renderGaussianSplatDepthAndNormals(e){const t=this._bindParameters.output;this._bindParameters.output=4,this._renderInternalNodeCategory(S.GAUSSIAN_SPLAT_DEPTH,e),this._bindParameters.output=t}get _needsShadowDepthRange(){return this._bindParameters.shadowMap.enabled||!!this._shadowAccumulator?.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return z.Zero;const t=Y(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.union(this._nodes.queryDepthRange(S.SHADOWMAP,e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<L)return void(this.sceneDepthRange.value=z.Infinite);const t=e.clone();t.near=O,t.far=1e10;const s=Y(t,this._plugins.plugins,this.stage.layers,1);s.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(s)||(this.sceneDepthRange.value=s)}get _normalsRequired(){return this._nodes.require("normals",...R,S.VIEWSHED,S.LASERLINES)+(this.hasAmbientIllumination?1:0)}_precompilePrepasses(){const e=!!this._normalsRequired;if(e?(this._precompilePlugins(4,Pe),this._needsDepth&&this._precompilePlugins(3,Ae)):this._needsDepth&&this._precompileAllGeometry(3),this.shadowsEnabled&&(this._needsShadowHighlight?(this._nodes.precompile(S.SHADOW_HIGHLIGHT),this._precompileShadowCascades(6),this._precompileShadowCascades(7)):this._precompileShadowCascades(5)),this._shadowAccumulator?.active&&(this._nodes.precompile(S.SHADOW_ACCUMULATION),this._precompileAllGeometry(5)),this._shadowAccumulator?.active||e){const t=this._bindParameters.output;this._bindParameters.output=e?4:3,this._nodes.precompile(S.GAUSSIAN_SPLAT_DEPTH),this._bindParameters.output=t}(this.shadowsEnabled||this._shadowAccumulator?.active)&&this._nodes.precompile(S.SHADOWMAP),this.hasAmbientIllumination&&e&&this._nodes.precompile(S.AMBIENT_ILLUMINATION)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const{width:t,height:s}=this._framebuffer.size,i=this.fboCache.acquire(t,s,"normals");i.acquireDepth(14),this._rctx.bindFramebuffer(i.fbo),this._rctx.clearFramebuffer(C,!0,!0),this._bindParameters.output=4,this._plugins.render(...Pe),this._renderGaussianSplatDepthAndNormals(i);const r=this._nodes.optional("normals",...R,S.VIEWSHED);return i.retain(e+r-1),this.performanceInfo.advance(oe.NORMALS),i}_releaseGlobalIlluminationBuffers(){const e=this._bindParameters;this.hasGlobalIllumination&&(e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.reprojection.lastFrameDepth=n(e.reprojection.lastFrameDepth),e.reprojection.lastFrameEmission=n(e.reprojection.lastFrameEmission),e.globalIllumination=h(e.globalIllumination),e.globalIlluminationEnabled=!1}_precompileAllGeometry(e){const t=this._bindParameters.output;this._bindParameters.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(...be),this._bindParameters.output=t}renderAllGeometry(e){this._bindParameters.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentGround()}precompileSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const s of t)this._renderContext.renderOccludedMask=s,this.precompileSlots(e,...we);this._renderContext.renderOccludedMask=Z}renderSlots(e,...t){for(const s of t)this._bindParameters.slot=s,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...we),this._renderContext.renderOccludedMask=Z}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Te[e])}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(16),this.renderHUD(e),this._bindParameters.hudRenderStyle=e,this._plugins.render(14)}precompileViewshedShadowMap(){const e=this._bindParameters.output;this._bindParameters.output=8,this._precompileAllGeometry(8),this._nodes.precompile(S.SHADOWMAP),this._bindParameters.output=e}precompileCutFillDepth(){this._precompilePlugins(9,Se)}_precompilePlugins(e,t){const s=this._bindParameters.output;this._bindParameters.output=e,this._plugins.precompile(...t),this._bindParameters.output=s}renderViewshedShadowMap(e,t){const{camera:s,contentCamera:i}=this._bindParameters,r=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(8),this._renderShadowNodes(t),this._ensureBindParametersCamera(s,i),this._bindParameters.camera.setGLViewport(this._rctx),this._bindParameters.output=r}renderCutFillDepth(e){const{camera:t,contentCamera:s}=this._bindParameters,i=this._bindParameters.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._bindParameters.output=9,this._plugins.render(...Se),this._ensureBindParametersCamera(t,s),t.setGLViewport(this._rctx),this._bindParameters.output=i}get _needsGroundDepth(){return this._bindParameters.cutFillVisualizationEnabled}_blitGroundDepth(){if(!this._needsGroundDepth)return null;const{width:e,height:t}=this._framebuffer.size,s=this.fboCache.acquire(e,t,S.GROUND_DEPTH,14);return this._rctx.blitFramebuffer(this._framebuffer.color.fbo,s.fbo,256),this._framebuffer.bind(),s}_renderOpaqueAndTransparentGeometry(e){this._bindParameters.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithoutNormals(e){this._bindParameters.output=e,this._plugins.render(...Ae)}_precompileOpaqueGeometry(){this._needsOpaquePass&&(this._plugins.precompile(...fe),this._nodes.precompile("opaque-color"))}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...ge),this._hasTransparentGeometry&&this._plugins.render(15)}_renderTransparentGround(){this._plugins.render(...be)}_precompileHUD(e){if(!this._pluginsHas.hudElements)return;const t=this._bindParameters.output,s=this._bindParameters.hudRenderStyle,i=this._bindParameters.emissions;this._bindParameters.emissions=0,this._bindParameters.hudRenderStyle=e,this._bindParameters.output=1,this._plugins.precompile(...Ie),this._bindParameters.output=2,this._plugins.precompile(...Ie),this._bindParameters.output=0,this._oitBlend.precompile(this._bindParameters,!1,1),this._hasHighlights&&(this._bindParameters.output=10,this._plugins.precompile(...Ie)),this._bindParameters.emissions=i,this._bindParameters.output=t,this._bindParameters.hudRenderStyle=s}_renderHUD(e,t){if(!this._pluginsHas.hudElements)return t;const s=this._renderOIT(1,e);this._rctx.bindFramebuffer(t.fbo);const i=!!t.getTexture(de);return this._compositor.compositePreMultipliedAlpha(this._bindParameters,s.getTexture(),i),s.release(),this.performanceInfo.advance(0===e?oe.HUD_OCCLUDED:oe.HUD),t}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(6,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:s}=this,{width:i,height:r}=this._framebuffer.size,{highlights:a}=s,n=a.length>q?3:1,h=e.acquire(i,r,"highlights",n);h.acquireDepth(14);const o=this._plugins.produces(10,0);return o&&this._framebuffer.color.fbo&&h.fbo&&t.blitFramebuffer(this._framebuffer.color.fbo,h.fbo,1024),t.bindFramebuffer(h.fbo),t.gl.clearBufferuiv(6144,0,[0,0,0,0]),o||t.clear(1024),this._bindParameters.output=10,t.bindFramebuffer(h.fbo),j(t,e,i,r,s,()=>this._renderHighlightGeometries()),h.detachDepth(),this.performanceInfo.advance(oe.HIGHLIGHTS),h.retain(this._nodes.require("highlights",...N)+this._nodes.optional("highlights",...N)-1),h}_renderHighlightGeometries(){this._plugins.render(...Ee),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e){const t=this._shadowAccumulator;if(!t)return;t.updateDepthRange(e);const s=t.requireGeometryDepth;this._bindParameters.output=0;const i=this._nodes.produce(S.SHADOW_ACCUMULATION,this._pluginInput);t.didAccumulate&&this.performanceInfo.advance(oe.ACCUMULATED_SHADOWS),this._pluginInput.set(S.SHADOW_ACCUMULATION,null),i?.release(),s&&(this._bindParameters.depth=h(this._bindParameters.depth))}renderShadowAccumulationShadowMap(e,t,s,i,r){const a=this.stage.view.qualitySettings.maximumPixelRatio;this._bindParameters.renderingShadowAnalysisMap=!0;try{s.start(e,i,r,!0,a),this._renderShadowCascades(5,s),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,t)}finally{this._bindParameters.renderingShadowAnalysisMap=!1}}_precompileTransparentGeometry(){y(this._bindParameters.output)?(this._bindParameters.output=1,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=2,this._plugins.precompile(...ge),this._hasTransparentGeometry&&this._plugins.precompile(15),this._bindParameters.output=0):this._plugins.precompile(...ge)}_renderOIT(e,t=2){const s=1===e,{width:i,height:r}=this._framebuffer.size,a=s?()=>this._renderHUDElements(t):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=h.useFloatBlend.value?8:5,d=h.output;h.output=1;const l=s?"oit hud":"oit",u=this.fboCache.acquire(i,r,l,o).acquireColor(de,this.hasFloatBlend?7:0,"oit alpha"),_=h.hasEmission&&(0===e||1!==t);_&&u.acquireColor(_e,o,"oit emissive"),s||u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(X),_&&this._rctx.clearBuffer(2,X),a(),u.detachDepth(),h.output=2;const m=this.fboCache.acquire(i,r,s?"oit front hud":"oit front");_&&m.acquireColor(de,o,"oit front emissive"),s?m.acquireDepth(this._hudDepthFormat):m.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(m.fbo),this._rctx.clearFramebuffer(C,s),a(),m.detachDepth();const p=this._pluginsHas.occludedHudElements&&!s,c=p&&0!==h.emissions?_e:de;let f;return h.hudOcclusion=n(this._bindParameters.hudOcclusion),h.output=0,s?(f=this.fboCache.acquire(i,r,"oit composite hud"),this._rctx.bindFramebuffer(f.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):(0!==h.emissions&&this._framebuffer.ensureEmissionAttachment(),p&&(this._framebuffer.color.acquireColor(c,0,"hud occlusion"),this._rctx.clearBuffer(c-ue,C)),this._framebuffer.bind()),this._oitBlend.blend(this._rctx,u,m,h,p,e,this._fboCache.debugCallback),f?.detachDepth(),s||(_&&(this._bindParameters.emissions=3),p&&(h.hudOcclusion=this._framebuffer.color.obtainAttachment(c))),m.release(),u.release(),h.output=d,f}get _hudDepthFormat(){return this.isFeatureEnabled(7)?14:13}get _needsOpaquePass(){return this.plugins.produces(0,...fe)||this.plugins.produces(5,...fe)||this.plugins.produces(3,3)}_renderOpaque(){const e=this._needsOpaquePass;e&&(this._plugins.render(0,1),this._pluginInput.set(S.GROUND_DEPTH,this._blitGroundDepth()),this._plugins.render(2,3));const t=this._framebuffer;t.update(t=>this._renderNodes(D.OPAQUE,t,e)),this.fboCache.debugCallback?.(D.OPAQUE,t.color.fbo),t.update(e=>this._renderNodes(S.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(S.OPAQUE_ENVIRONMENT,t.color.fbo),this._renderEdges(1)}_renderPreTransparent(){this._framebuffer.update(e=>this._renderNodes(S.GAUSSIAN_SPLAT,e)),this.fboCache.debugCallback?.(S.GAUSSIAN_SPLAT,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.OPAQUE_OCCLUSION_QUERY,e)),this.fboCache.debugCallback?.(S.OPAQUE_OCCLUSION_QUERY,this._framebuffer.color.fbo),this._framebuffer.update(e=>this._renderNodes(S.VOXEL,e)),this.fboCache.debugCallback?.(S.VOXEL,this._framebuffer.color.fbo)}_renderTransparent(){const e=this._framebuffer;if(this._renderHiddenTransparentEdges(),this._hasTransparentGeometry&&this._renderOIT(0),e.update(e=>this._renderNodes(D.TRANSPARENT,e,this._hasTransparentGeometry)),this.fboCache.debugCallback?.(D.TRANSPARENT,e.color.fbo),this._hasTransparentGeometry||this._plugins.render(15),this._renderEdges(0),this._bindParameters.ssao=n(this._bindParameters.ssao),e.update(e=>this._renderNodes(S.TRANSPARENT_NO_DEPTH,e)),this.fboCache.debugCallback?.(S.TRANSPARENT_NO_DEPTH,e.color.fbo),this._framebuffer.bind(),this._plugins.render(8),this._bindParameters.hasEmission){const e=this._rctx.setDrawBuffers([me,de]);this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!0,this._plugins.render(8),this._bindParameters.transparentWithoutDepthEmissionDimmingPass=!1,this._rctx.setDrawBuffers(e)}this.performanceInfo.advance(oe.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderNodes(e,t,s=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return s&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNodeInputs);return this.performanceInfo.advance(e),this._fboCache.debugCallback?.(e,i.fbo),i}_renderInternalNodeCategory(e,t){if(!t)return;const s=t.name;try{this._renderNodes(e,t)}finally{this._pluginInput.set(e,null),t.setName(s)}}_ensureBindParameters(e,t){this._ensureBindParametersCamera(e,t),this._ensureBindParametersWeatherFader(),this._ensureBindParametersScreenSpaceReflections(),this._ensureBindParametersReprojection()}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersWeatherFader(){1===this.stage.viewingMode&&(this._bindParameters.clouds.data&&(this._bindParameters.clouds.fade(this._bindParameters.camera,this.renderContext.time,this.stage.view.qualitySettings.fadeDuration,this.stage.view.state.stationary),this.weatherFader?.cleanupCubemap()),this._bindParameters.snowCover=this.weatherFader?.snowCover??0)}_ensureBindParametersScreenSpaceReflections(){const{time:e}=this.renderContext,{screenSpaceReflections:t}=this._bindParameters;if(this.hasReflections){null==this._ssrEnableTime&&(this._ssrEnableTime=e);const s=this.stage.view.qualitySettings.fadeDuration;t.fadeFactor=s>0?Math.min(s,e-this._ssrEnableTime)/s:1,t.fadeFactor<1&&this._requestRender()}else this._ssrEnableTime=null}_ensureBindParametersReprojection(){if(!(this.hasReflections||this.hasGlobalIllumination))return void(this._reprojectionMatrix=A);const{reprojection:e,camera:t}=this._bindParameters,{lastFrameCamera:s}=e,i=!s.equals(t);if(i?(g(Ne,t.viewMatrix),g(Re,t.projectionMatrix),b(Oe,Ne,Re),b(Oe,s.viewMatrix,Oe),b(Oe,s.projectionMatrix,Oe),this._reprojectionMatrix=Oe):this._reprojectionMatrix=A,this.hasGlobalIllumination){const{viewMatrix:t}=e;i?(b(He,s.viewMatrix,Ne),P(t,He)):P(t,A)}}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,s,i){this._bindParameters.updateLighting(e,t,s,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0,clouds:this.weatherFader?.usedMemory??0}}get test(){}};e([p({readOnly:!0})],ce.prototype,"highResolutionAtmosphere",null),e([p()],ce.prototype,"_edgeView",void 0),e([p()],ce.prototype,"updating",null),ce=e([c("esri.views.3d.webgl-engine.lib.Renderer")],ce);const fe=[0,1,2,3],ge=[7,6,4,5],be=[7,6],Pe=[0,1,2,4,...be],Ae=[3,5],we=[2,4,8],Ie=[16,12,14,13],Ee=[4,5,2,3,0,1,...be],Ce=[4,8,5,11],Te={0:[13],1:[12],2:[13,12],3:[13,12]},Se=[0,1,...be],De=["normals","highlights"],Re=w(),Ne=w(),Oe=w(),He=w();function Fe(e){return t=>e.immediate.schedule(t)}export{ce as Renderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e,scale as t,add as r,normalize as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as n,fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as p,scale as h}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as c}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as l,isDepth as m,is2DGeometryOutput as u}from"../core/shaderLibrary/ShaderOutput.js";import f from"../lib/GLMaterial.js";import{intersectTriangleGeometry as g}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as d}from"../lib/screenPolygonTriangleIntersections.js";import{assert as S}from"../lib/Util.js";import{applyPolygonOffsetToHit as _,intersectWithPolygonOffset as b}from"./intersectWithPolygonOffset.js";import{TriangleMaterial as y}from"./TriangleMaterial.js";import{VisualVariablePassParameters as x}from"./VisualVariablePassParameters.js";import{writeAttributes as z,writePosition as j}from"./internal/bufferWriterUtils.js";import{getLayout as D,ColorMaterialTechnique as P}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as w}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as C}from"../../../../webscene/support/AlphaCutoff.js";class V extends y{constructor(e){super(e,O),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>this._isOpaqueMaterialPass(e)],[3,e=>!this.parameters.shadingEnabled&&this._isOpaqueNoSSAODepthPass(e)],[4,e=>l(e)&&this.transparent&&this.parameters.writeDepth],[5,e=>!this.parameters.shadingEnabled&&m(e)&&this.transparent&&this.parameters.writeDepth],[8,e=>l(e)&&this.transparent&&!this.parameters.writeDepth],[18,e=>u(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.emissionSource=this.emissions?1:0}get visible(){return this.parameters.color[3]>=C}get transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}intersectRay(e,t,r,s,i,a){if(!this.parameters.screenSizeEnabled)return super.intersectRay(e,t,r,s,i,a);this._intersectScreenSizeRay(e,r,s,i,a)}intersectRayDraped(e,t,r,s){if(!this.parameters.screenSizeEnabled)return super.intersectRayDraped(e,t,r,s);this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersectScreenSizeRay(e,t,this._pp0,this._pp1,s)}intersectScreenPolygon(e,t,r,s){return this.parameters.screenSizeEnabled?_(d(e,r,t,s,this._createScreenSizeVertexDisplacement(e,r)),this._configuration,r.camera.eye):super.intersectScreenPolygon(e,t,r,s)}_intersectScreenSizeRay(e,t,r,s,i){g(e,t,r,s,this._createScreenSizeVertexDisplacement(e,t),b(i,this._configuration,r,s))}_createScreenSizeVertexDisplacement(s,i){const a=s.attributes.get("offset").data;return{applyToVertex:(s,n,o,p,h)=>{const c=e(T,a[3*h],a[3*h+1],a[3*h+2]);e(s,n,o,p);const l=this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(c)??1);return t(c,c,l),r(s,s,c),s},applyToAabb:e=>{const t=p(e,T);return h(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}}}_isOpaqueMaterialPass(e){return 10===e||l(e)&&!this.transparent}_isOpaqueNoSSAODepthPass(e){return m(e)&&this.parameters.writeDepth&&!this.transparent}createGLMaterial(e){return new E(e)}createBufferWriter(){return new M(D(this.parameters))}}class E extends f{beginSlot(e){return this.getTechnique(P,e)}}class O extends x{constructor(){super(...arguments),this.color=n,this.shadingTint=o(0,0,0,.25),this.shadingDirection=s(a(),[.5,-.5,-.5]),this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=0,this.hasSlicePlane=!1,this.cullFace=0,this.draped=!1,this.shadingEnabled=!1,this.screenSizeEnabled=!1,this.screenSizeScale=14,this.useIndexing=!1}}class M{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s){if(null==s)return;z(r,this.layout,e,t,s);const i=s.buffer.getField("offset",c);if(i&&r.has("offset")){const e=r.get("offset");S(3===e.size),j(e,t,i,s.offset)}}}const T=a();export{V as ColorMaterial,O as Parameters};
2
+ import{set as e,scale as t,add as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as s,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as a,fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as p}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as h}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as c,isDepth as l,is2DGeometryOutput as m}from"../core/shaderLibrary/ShaderOutput.js";import u from"../lib/GLMaterial.js";import{intersectTriangleGeometry as f}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as g}from"../lib/screenPolygonTriangleIntersections.js";import{assert as d}from"../lib/Util.js";import{applyPolygonOffsetToHit as S,intersectWithPolygonOffset as _}from"./intersectWithPolygonOffset.js";import{TriangleMaterial as b}from"./TriangleMaterial.js";import{VisualVariablePassParameters as y}from"./VisualVariablePassParameters.js";import{writeAttributes as x,writePosition as z}from"./internal/bufferWriterUtils.js";import{getLayout as j,ColorMaterialTechnique as P}from"../shaders/ColorMaterialTechnique.js";import{ColorMaterialTechniqueConfiguration as w}from"../shaders/ColorMaterialTechniqueConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class C extends b{constructor(e){super(e,E),this._configuration=new w,this.supportsEdges=!0,this._pp0=s(0,0,1),this._pp1=s(0,0,0),this.produces=new Map([[2,e=>this._isOpaqueMaterialPass(e)],[3,e=>!this.parameters.shadingEnabled&&this._isOpaqueNoSSAODepthPass(e)],[4,e=>c(e)&&this.transparent&&this.parameters.writeDepth],[5,e=>!this.parameters.shadingEnabled&&l(e)&&this.transparent&&this.parameters.writeDepth],[8,e=>c(e)&&this.transparent&&!this.parameters.writeDepth],[18,e=>m(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVColor=!!this.parameters.vvColor,this._configuration.draped=this.parameters.draped,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.emissionSource=this.emissions?1:0}get visible(){return this.parameters.color[3]>=D}get transparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}intersectRay(e,t,r,s,i,a){if(!this.parameters.screenSizeEnabled)return super.intersectRay(e,t,r,s,i,a);this._intersectScreenSizeRay(e,r,s,i,a)}intersectRayDraped(e,t,r,s){if(!this.parameters.screenSizeEnabled)return super.intersectRayDraped(e,t,r,s);this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersectScreenSizeRay(e,t,this._pp0,this._pp1,s)}intersectScreenPolygon(e,t,r,s){return this.parameters.screenSizeEnabled?S(g(e,r,t,s,this._createScreenSizeVertexDisplacement(e,r)),this._configuration,r.camera.eye):super.intersectScreenPolygon(e,t,r,s)}_intersectScreenSizeRay(e,t,r,s,i){f(e,t,r,s,this._createScreenSizeVertexDisplacement(e,t),_(i,this._configuration,r,s))}_createScreenSizeVertexDisplacement(s,i){const a=s.attributes.get("offset").data;return{applyToVertex:(s,n,o,p,h)=>{const c=e(M,a[3*h],a[3*h+1],a[3*h+2]);e(s,n,o,p);const l=this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(c)??1);return t(c,c,l),r(s,s,c),s},applyToAabb:e=>{const t=o(e,M);return p(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}}}_isOpaqueMaterialPass(e){return 10===e||c(e)&&!this.transparent}_isOpaqueNoSSAODepthPass(e){return l(e)&&this.parameters.writeDepth&&!this.transparent}createGLMaterial(e){return new V(e)}createBufferWriter(){return new O(j(this.parameters))}}class V extends u{beginSlot(e){return this.getTechnique(P,e)}}class E extends y{constructor(){super(...arguments),this.color=a,this.shadingTint=n(0,0,0,.25),this.forceTransparentMode=!1,this.writeDepth=!0,this.hasVertexColors=!1,this.polygonOffset=0,this.hasSlicePlane=!1,this.cullFace=0,this.draped=!1,this.shadingEnabled=!1,this.screenSizeEnabled=!1,this.screenSizeScale=14,this.useIndexing=!1}}class O{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s){if(null==s)return;x(r,this.layout,e,t,s);const i=s.buffer.getField("offset",h);if(i&&r.has("offset")){const e=r.get("offset");d(3===e.size),z(e,t,i,s.offset)}}}const M=i();export{C as ColorMaterial,E as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ScreenSizeScaling.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float3PassUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/vec3.js";import"../core/shaderLibrary/ScreenSizeScaling.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/Transform.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/attributes/VertexColor.glsl.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/glsl.js";import"./OutputColorHighlightOLID.glsl.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/ColorMaterial.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{normalize as t}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ZEROS as o,fromValues as s}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as a}from"../../support/buffer/InterleavedLayout.js";import{isOITFrontFace as n}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as c}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as p}from"../effects/geometry/olidUtils.js";import{depthWrite as u,depthTest as f,blending as d}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as h,stencilBaseAllZeros as g,stencilWriteMaskOn as b}from"../lib/StencilUtils.js";import{polygonOffset as j}from"../materials/PolygonOffset.js";import{VisualVariablePassParameters as P}from"../materials/VisualVariablePassParameters.js";import{C as S}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as v,defaultColorWrite as T,cullingParams as x}from"../../../webgl/renderState.js";class C extends P{constructor(){super(...arguments),this.color=o,this.shadingTint=s(0,0,0,.25),this.shadingDirection=t(i(),[.5,-.5,-.5]),this.screenSizeScale=14}}let y=class extends m{constructor(e,r){super(e,r,l(z(r))),this.shader=new c(S,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:i,cullFace:o,draped:s,hasOccludees:l,shadingEnabled:a}=e,c=a&&!n(t)?515:513,m=l&&!a;return v({blending:i?d(t,!1,e.emissionDimmingPass):null,culling:x(o),depthTest:s?null:f(t,c),depthWrite:u(e),colorWrite:T,stencilWrite:m?b:null,stencilTest:m?r?h:g:null,polygonOffset:j(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r,t){return t?this._occludeePipelineState:super.getPipeline(e,r)}};function z(e){const r=a().vec3f("position");return e.shadingEnabled&&r.vec3f("normal"),e.screenSizeEnabled&&r.vec3f("offset"),p()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}y=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],y);export{C as ColorMaterialPassParameters,y as ColorMaterialTechnique,z as getLayout};
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as t,fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isOITFrontFace as l}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as n}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as a}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as c}from"../effects/geometry/olidUtils.js";import{depthWrite as p,depthTest as m,blending as u}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as d,stencilBaseAllZeros as f,stencilWriteMaskOn as h}from"../lib/StencilUtils.js";import{polygonOffset as g}from"../materials/PolygonOffset.js";import{VisualVariablePassParameters as b}from"../materials/VisualVariablePassParameters.js";import{C as j}from"../../../../chunks/ColorMaterial.glsl.js";import{makePipelineState as P,defaultColorWrite as S,cullingParams as v}from"../../../webgl/renderState.js";class T extends b{constructor(){super(...arguments),this.color=t,this.shadingTint=i(0,0,0,.25),this.screenSizeScale=14}}let C=class extends a{constructor(e,r){super(e,r,s(y(r))),this.shader=new n(j,()=>import("./ColorMaterial.glsl.js")),this.ignoreUnused=!0}_createPipeline(e,r){const{output:t,transparent:i,cullFace:s,draped:o,hasOccludees:n,shadingEnabled:a}=e,c=a&&!l(t)?515:513,b=n&&!a;return P({blending:i?u(t,!1,e.emissionDimmingPass):null,culling:v(s),depthTest:o?null:m(t,c),depthWrite:p(e),colorWrite:S,stencilWrite:b?h:null,stencilTest:b?r?d:f:null,polygonOffset:g(e)})}initializePipeline(e){return this._occludeePipelineState=this._createPipeline(e,!0),this._createPipeline(e,!1)}getPipeline(e,r,t){return t?this._occludeePipelineState:super.getPipeline(e,r)}};function y(e){const r=o().vec3f("position");return e.shadingEnabled&&r.vec3f("normal"),e.screenSizeEnabled&&r.vec3f("offset"),c()&&r.vec4u8("olidColor"),e.hasVVColor?r.f32("colorFeatureAttribute"):e.hasVertexColors&&r.vec4u8("color",{glNormalized:!0}),r.freeze()}C=e([r("esri.views.3d.webgl-engine.shaders.ColorMaterialTechnique")],C);export{T as ColorMaterialPassParameters,C as ColorMaterialTechnique,y as getLayout};
@@ -1,14 +1,29 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{RejectBySlicePass as a}from"../core/shaderLibrary/Slice.glsl.js";import{DepthConversion as e}from"../core/shaderLibrary/output/DepthConversion.glsl.js";import{positionOutsideClipSpace as i}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{inverseProjMatrix as n,inverseScreenSize as t,projMatrix as s,viewMatrix as r,nearFar as o}from"../core/shaderLibrary/util/cameraUniforms.js";import{GaussianSplatCovariance as c}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as l}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as u}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as d}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as p}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as f}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as m}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as v}from"../core/shaderModules/FloatPassUniform.js";import{glsl as g,If as x}from"../core/shaderModules/glsl.js";import{Texture2DUintPassUniform as y}from"../core/shaderModules/Texture2DUintPassUniform.js";function h(e,i){const{clippingEnabled:n}=i,{fragment:f,varyings:x,vertex:h}=e;x.add("gaussianCoordinates","vec2"),x.add("gaussianLogAlphaCutoff","float"),x.add("fragmentPositionCameraRelative","vec3"),h.uniforms.add(new y("splatOrderTexture",a=>a.splatOrder),new y("splatAtlasTexture",a=>a.splatAtlas),new y("splatHeaderTexture",a=>a.splatHeader),new v("minSplatRadius",a=>a.minSplatRadius),t,s,r,o),n&&(h.uniforms.add(new m("clipMin",a=>a.clipMinCameraRelative),new m("clipMax",a=>a.clipMaxCameraRelative)),f.uniforms.add(new m("clipMin",a=>a.clipMinCameraRelative),new m("clipMax",a=>a.clipMaxCameraRelative))),h.include(d),h.include(u),h.include(p),h.include(c),h.include(l),h.include(a,i),f.include(l),f.include(a,i),f.main.add(g`
3
- ${D(i)}
4
- `)}function P(a,i){a.include(h,i),a.vertex.uniforms.add(new v("focalLength",a=>a.focalLength),new f("tanFov",a=>a.tanFov)),i.preciseDepth?(a.include(R),a.vertex.uniforms.add(n),a.fragment.include(e),a.fragment.code.add(g`float gaussianSplatDepth() {
2
+ import{RejectBySlicePass as a}from"../core/shaderLibrary/Slice.glsl.js";import{DepthConversion as e}from"../core/shaderLibrary/output/DepthConversion.glsl.js";import{positionOutsideClipSpace as i}from"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import{inverseProjMatrix as n,inverseScreenSize as t,projMatrix as s,viewMatrix as r,nearFar as o}from"../core/shaderLibrary/util/cameraUniforms.js";import{GaussianSplatCovariance as c}from"../core/shaderLibrary/util/GaussianSplatCovariance.glsl.js";import{GaussianSplatEvaluation as l}from"../core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js";import{GaussianSplatTextureFetch as u}from"../core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js";import{GaussianSplatUnpacking as d}from"../core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js";import{QuaternionToRotationMatrix as p}from"../core/shaderLibrary/util/QuaternionToRotationMatrix.glsl.js";import{Float2PassUniform as m}from"../core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as v}from"../core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as f}from"../core/shaderModules/FloatPassUniform.js";import{glsl as g,If as y}from"../core/shaderModules/glsl.js";import{Texture2DUintPassUniform as x}from"../core/shaderModules/Texture2DUintPassUniform.js";function P(e,i){const{clippingEnabled:n}=i,{fragment:m,varyings:y,vertex:P}=e;y.add("gaussianCoordinates","vec2"),y.add("gaussianLogAlphaCutoff","float"),y.add("fragmentPositionCameraRelative","vec3"),P.uniforms.add(new x("splatOrderTexture",a=>a.splatOrder),new x("splatAtlasTexture",a=>a.splatAtlas),new x("splatHeaderTexture",a=>a.splatHeader),new f("minSplatRadius",a=>a.minSplatRadius),t,s,r,o),n&&(P.uniforms.add(new v("clipMin",a=>a.clipMinCameraRelative),new v("clipMax",a=>a.clipMaxCameraRelative)),m.uniforms.add(new v("clipMin",a=>a.clipMinCameraRelative),new v("clipMax",a=>a.clipMaxCameraRelative))),P.include(d),P.include(u),P.include(p),P.include(c),P.include(l),P.include(a,i),m.include(l),m.include(a,i),m.main.add(g`
3
+ ${z(i)}
4
+ `)}function R(a,i){a.include(P,i),a.vertex.uniforms.add(new f("focalLength",a=>a.focalLength),new m("tanFov",a=>a.tanFov)),i.preciseDepth?(a.include(h),a.vertex.uniforms.add(n),a.fragment.include(e),a.fragment.code.add(g`float gaussianSplatDepth() {
5
5
  float rayDepth = gaussianSplatRayDepth();
6
6
  return delinearizeDepth(-rayDepth);
7
7
  }`)):a.fragment.code.add(g`float gaussianSplatDepth() {
8
8
  return gl_FragCoord.z;
9
- }`)}function R(a){a.varyings.add("rayGaussianFactor","vec4"),a.fragment.code.add(g`float gaussianSplatRayDepth() {
9
+ }`)}function h(a){a.varyings.add("rayGaussianFactor","vec4"),a.vertex.code.add(g`vec3 reconstructViewRay(vec2 clipPosition, mat4 inverseProjection) {
10
+ vec3 rayViewPoint = (inverseProjection * vec4(clipPosition, -1.0, 1.0)).xyz;
11
+ return vec3(-rayViewPoint.xy / rayViewPoint.z, -1.0);
12
+ }
13
+ vec4 computeGaussianRayFactor(
14
+ vec3 rayView,
15
+ vec3 cameraRelativePosition,
16
+ vec3 gaussianScale,
17
+ mat3 gaussianRotation,
18
+ mat3 viewRotation
19
+ ) {
20
+ vec3 inverseGaussianScale = 1.0 / gaussianScale;
21
+ vec3 rayGaussianFactorCenter = (gaussianRotation * cameraRelativePosition) * inverseGaussianScale;
22
+ vec3 rayGaussianFactorRay = (gaussianRotation * (transpose(viewRotation) * rayView)) * inverseGaussianScale;
23
+ return vec4(rayGaussianFactorRay, dot(rayGaussianFactorCenter, rayGaussianFactorRay));
24
+ }`),a.fragment.code.add(g`float gaussianSplatRayDepth() {
10
25
  return rayGaussianFactor.w / dot(rayGaussianFactor.xyz, rayGaussianFactor.xyz);
11
- }`)}function S(a){a.uniforms.add(new y("splatFadingTexture",a=>a.splatFading)),a.code.add(g`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
26
+ }`)}function S(a){a.uniforms.add(new x("splatFadingTexture",a=>a.splatFading)),a.code.add(g`float applyGaussianSplatFading(float opacity, uint gaussianIndex) {
12
27
  uint pageIndex = fetchGaussianPageIndex(gaussianIndex);
13
28
  uint fadingTextureWidth = uint(textureSize(splatFadingTexture, 0).x);
14
29
  uint fadeX = pageIndex % fadingTextureWidth;
@@ -24,14 +39,14 @@ return opacity * float(opacityModifier) / 255.0;
24
39
 
25
40
  vec3 cameraRelativePosition = fetchGaussianCameraRelativePosition(gaussianIndex, packedGaussian);
26
41
 
27
- ${x(n,g`
42
+ ${y(n,g`
28
43
  if (cameraRelativePosition.x < clipMin.x || cameraRelativePosition.y < clipMin.y || cameraRelativePosition.z < clipMin.z ||
29
44
  cameraRelativePosition.x > clipMax.x || cameraRelativePosition.y > clipMax.y || cameraRelativePosition.z > clipMax.z) {
30
45
  return;
31
46
  }
32
47
  `)}
33
48
 
34
- ${x(t,g`
49
+ ${y(t,g`
35
50
  if (rejectBySlice(cameraRelativePosition)) {
36
51
  return;
37
52
  }
@@ -42,11 +57,8 @@ return opacity * float(opacityModifier) / 255.0;
42
57
  if (viewPos.z > -nearFar.x || viewPos.z < -nearFar.y) {
43
58
  return;
44
59
  }
45
- `}const G=g`vec3 gaussianScale = unpackScale(packedGaussian);
46
- mat3 gaussianRotation = quaternionToRotationMatrix(unpackQuaternion(packedGaussian));`;function w(a){return g`
47
- vec3 inverseGaussianScale = 1.0 / gaussianScale;
48
- vec3 rayGaussianFactorCenter = (gaussianRotation * ${a}) * inverseGaussianScale;
49
- `}function M(a,e){return g`
60
+ `}const w=g`vec3 gaussianScale = unpackScale(packedGaussian);
61
+ mat3 gaussianRotation = quaternionToRotationMatrix(unpackQuaternion(packedGaussian));`;function G(a,e){return g`
50
62
  float determinant = computeGaussianCovarianceDeterminant(covariance2D);
51
63
  if (determinant <= 0.0) {
52
64
  return;
@@ -61,7 +73,7 @@ mat3 gaussianRotation = quaternionToRotationMatrix(unpackQuaternion(packedGaussi
61
73
  if (rejectGaussianByMinimumRadius(maxRadius, ${e}, minSplatRadius)) {
62
74
  return;
63
75
  }
64
- `}const F=g`vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;
76
+ `}const M=g`vec2 clipSpacePixelScale = 2.0 * inverseScreenSize;
65
77
  if (rejectGaussianByScreenBounds(ndcPos.xy, screenRadii, clipSpacePixelScale)) {
66
78
  return;
67
79
  }
@@ -70,10 +82,10 @@ gaussianCoordinates = quadCorner * sqrt(gaussianEllipseThreshold);
70
82
  float inverseRadiusX = inversesqrt(covariance2D.x);
71
83
  vec2 choleskyAxisX = covariance2D.xy * inverseRadiusX;
72
84
  vec2 choleskyAxisY = vec2(0.0, sqrt(determinant) * inverseRadiusX);
73
- vec2 offsetFromCenter = gaussianCoordinates.x * choleskyAxisX + gaussianCoordinates.y * choleskyAxisY;`;function z(a,e){return g`
85
+ vec2 offsetFromCenter = gaussianCoordinates.x * choleskyAxisX + gaussianCoordinates.y * choleskyAxisY;`;function F(a,e){return g`
74
86
  ${C(a,g.float(e))}
75
87
 
76
- ${G}
88
+ ${w}
77
89
  vec3 covariance2D = computeGaussianCovariance2D(viewPos.xyz, focalLength, tanFov, gaussianScale, gaussianRotation, view);
78
90
  float minimumRadiusOpacity = opacity;
79
91
  float opacityScale = regularizeGaussianCovariance(covariance2D);
@@ -82,38 +94,37 @@ vec2 offsetFromCenter = gaussianCoordinates.x * choleskyAxisX + gaussianCoordina
82
94
  return;
83
95
  }
84
96
 
85
- ${M(`${g.float(Math.log(e))} - log(opacity)`,"minimumRadiusOpacity")}
97
+ ${G(`${g.float(Math.log(e))} - log(opacity)`,"minimumRadiusOpacity")}
86
98
  ${j(a)}
87
99
  `}function j(a){return g`
88
100
  vec4 projPos = proj * viewPos;
89
101
  float invW = 1.0 / (projPos.w + 1e-7);
90
102
  vec3 ndcPos = projPos.xyz * invW;
91
- ${F}
103
+ ${M}
92
104
 
93
105
  float viewSpacePixelScale = -viewPos.z / focalLength;
94
106
  vec3 fragmentViewOffset = vec3(offsetFromCenter * viewSpacePixelScale, 0.0);
95
107
  fragmentPositionCameraRelative = cameraRelativePosition + transpose(mat3(view)) * fragmentViewOffset;
96
108
 
97
109
  vec2 quadClipPosition = ndcPos.xy + offsetFromCenter * clipSpacePixelScale - inverseScreenSize;
98
- ${x(a.preciseDepth,g`
99
- ${w("cameraRelativePosition")}
100
- vec3 rayViewPoint = (inverseProjectionMatrix * vec4(quadClipPosition, -1.0, 1.0)).xyz;
101
- vec3 rayView = vec3(-rayViewPoint.xy / rayViewPoint.z, -1.0);
102
- vec3 rayGaussianFactorRay = (gaussianRotation * (transpose(mat3(view)) * rayView)) * inverseGaussianScale;
103
- rayGaussianFactor = vec4(rayGaussianFactorRay, dot(rayGaussianFactorCenter, rayGaussianFactorRay));
110
+ ${y(a.preciseDepth,g`
111
+ vec3 rayView = reconstructViewRay(quadClipPosition, inverseProjectionMatrix);
112
+ rayGaussianFactor = computeGaussianRayFactor(
113
+ rayView, cameraRelativePosition, gaussianScale, gaussianRotation, mat3(view)
114
+ );
104
115
  `)}
105
116
  gl_Position = vec4(quadClipPosition, ndcPos.z, 1.0);
106
- `}function D(a){const{clippingEnabled:e,hasSlicePlane:i}=a;return g`
107
- ${x(e,g`
117
+ `}function z(a){const{clippingEnabled:e,hasSlicePlane:i}=a;return g`
118
+ ${y(e,g`
108
119
  if (fragmentPositionCameraRelative.x < clipMin.x || fragmentPositionCameraRelative.y < clipMin.y || fragmentPositionCameraRelative.z < clipMin.z ||
109
120
  fragmentPositionCameraRelative.x > clipMax.x || fragmentPositionCameraRelative.y > clipMax.y || fragmentPositionCameraRelative.z > clipMax.z) {
110
121
  discard;
111
122
  }
112
123
  `)}
113
- ${x(i,g`if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }`)}
124
+ ${y(i,g`if (rejectBySlice(fragmentPositionCameraRelative)) { discard; }`)}
114
125
 
115
126
  float gaussianExponent = evaluateGaussianExponent(gaussianCoordinates);
116
127
  if (gaussianExponent > 0.0 || gaussianExponent < gaussianLogAlphaCutoff) {
117
128
  discard;
118
129
  }
119
- `}export{S as GaussianSplatFading,h as GaussianSplatPass,P as GaussianSplatPerspectivePass,M as gaussianSplatComputeEllipse,F as gaussianSplatComputeQuad,C as gaussianSplatCullAndTransformVertex,z as gaussianSplatPerspectiveVertex,G as gaussianSplatUnpackScaleAndRotation};
130
+ `}export{S as GaussianSplatFading,P as GaussianSplatPass,R as GaussianSplatPerspectivePass,G as gaussianSplatComputeEllipse,M as gaussianSplatComputeQuad,C as gaussianSplatCullAndTransformVertex,F as gaussianSplatPerspectiveVertex,h as gaussianSplatRayDepth,w as gaussianSplatUnpackScaleAndRotation};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"./GaussianSplatDepthPolicy.js";import"./GaussianSplatPass.glsl.js";import"./GaussianSplatPassParameters.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatShadowPassParameters,b as build}from"../../../../chunks/GaussianSplatShadow.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4PassUniform.js";import"./GaussianSplatDepthPolicy.js";import"./GaussianSplatPass.glsl.js";import"./GaussianSplatPassParameters.js";import"../../../webgl/ShaderBuilder.js";export{G as GaussianSplatShadowPassParameters,b as build}from"../../../../chunks/GaussianSplatShadow.glsl.js";
@@ -24,7 +24,7 @@ import type { TimeZone } from "../time/types.js";
24
24
  import type { BreakpointsOwner, BreakpointsOwnerProperties } from "./BreakpointsOwner.js";
25
25
  import type { DOMContainer, DOMContainerProperties } from "./DOMContainer.js";
26
26
  import type { PopupView, PopupViewProperties } from "./PopupView.js";
27
- import type { HitTestOptions3D, SceneViewHitTestResult, GoToTarget3D, GoToOptions3D, UserSettings as ScreenshotUserSettings, Screenshot } from "./types.js";
27
+ import type { GoToOptions3D, GoToTarget3D, HitTestOptions3D, SceneViewHitTestResult, Screenshot, UserSettings as ScreenshotUserSettings } from "./types.js";
28
28
  import type { LayerView3DFor } from "./3d/types.js";
29
29
  import type { AnalysisView3DFor } from "./3d/analysis/types.js";
30
30
  import type { EnvironmentProperties } from "./3d/environment/Environment.js";