@arcgis/core 5.2.0-next.131 → 5.2.0-next.134

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 (173) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/107f4bcf8e6c91a67010.js +1 -0
  3. package/assets/esri/core/workers/chunks/{081c9ccaa5884c730a91.js → 1688c4dcd36db992a9dc.js} +1 -1
  4. package/assets/esri/core/workers/chunks/3a6b8f9aabde7e138834.js +1 -0
  5. package/assets/esri/core/workers/chunks/{18d5bad86ea3ef3ec747.js → eba9e03c1c9aa55044a3.js} +120 -120
  6. package/assets/esri/core/workers/chunks/f6c8e5abe1d55ab5c7dd.js +1 -0
  7. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  8. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  9. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  10. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  11. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  12. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  13. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  14. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  15. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  16. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  17. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  18. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  19. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  20. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  21. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  22. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  23. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  24. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  25. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  26. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  27. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  28. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  29. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  30. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  31. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  32. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  33. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  34. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  35. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  36. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  37. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  38. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  39. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  40. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  41. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  42. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  43. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  44. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  45. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  46. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  47. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  48. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  49. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  50. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  51. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  52. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  53. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  54. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  55. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  56. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  57. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  58. package/chunks/GaussianSplat.glsl.js +24 -9
  59. package/chunks/LineMarker.glsl.js +23 -23
  60. package/chunks/RibbonLine.glsl.js +136 -99
  61. package/config.js +1 -1
  62. package/core/PooledArray.js +1 -1
  63. package/geometry/operators/affineTransformOperator.d.ts +4 -0
  64. package/geometry/operators/alphaShapeOperator.d.ts +10 -1
  65. package/geometry/operators/areaOperator.d.ts +3 -0
  66. package/geometry/operators/autoCompleteOperator.d.ts +3 -0
  67. package/geometry/operators/boundaryOperator.d.ts +4 -0
  68. package/geometry/operators/bufferOperator.d.ts +6 -0
  69. package/geometry/operators/centroidOperator.d.ts +3 -0
  70. package/geometry/operators/clipOperator.d.ts +4 -0
  71. package/geometry/operators/containsOperator.d.ts +4 -0
  72. package/geometry/operators/convexHullOperator.d.ts +6 -0
  73. package/geometry/operators/crossesOperator.d.ts +4 -0
  74. package/geometry/operators/cutOperator.d.ts +3 -0
  75. package/geometry/operators/densifyOperator.d.ts +5 -0
  76. package/geometry/operators/differenceOperator.d.ts +4 -0
  77. package/geometry/operators/disjointOperator.d.ts +4 -0
  78. package/geometry/operators/distanceOperator.d.ts +4 -0
  79. package/geometry/operators/equalsOperator.d.ts +4 -0
  80. package/geometry/operators/extendOperator.d.ts +4 -0
  81. package/geometry/operators/generalizeOperator.d.ts +5 -0
  82. package/geometry/operators/geodesicBufferOperator.d.ts +8 -0
  83. package/geometry/operators/geodesicProximityOperator.d.ts +9 -0
  84. package/geometry/operators/geodeticAreaOperator.d.ts +6 -0
  85. package/geometry/operators/geodeticDensifyOperator.d.ts +7 -0
  86. package/geometry/operators/geodeticDistanceOperator.d.ts +6 -0
  87. package/geometry/operators/geodeticLengthOperator.d.ts +6 -0
  88. package/geometry/operators/geodeticUtilsOperator.d.ts +7 -0
  89. package/geometry/operators/graphicBufferOperator.d.ts +4 -0
  90. package/geometry/operators/integrateOperator.d.ts +3 -0
  91. package/geometry/operators/intersectionOperator.d.ts +5 -0
  92. package/geometry/operators/intersectsOperator.d.ts +4 -0
  93. package/geometry/operators/isNearOperator.d.ts +4 -0
  94. package/geometry/operators/labelPointOperator.d.ts +4 -0
  95. package/geometry/operators/lengthOperator.d.ts +3 -0
  96. package/geometry/operators/linesToPolygonsOperator.d.ts +3 -0
  97. package/geometry/operators/locateBetweenOperator.d.ts +3 -0
  98. package/geometry/operators/minimumBoundingCircleOperator.d.ts +5 -0
  99. package/geometry/operators/multiPartToSinglePartOperator.d.ts +4 -0
  100. package/geometry/operators/offsetOperator.d.ts +5 -0
  101. package/geometry/operators/overlapsOperator.d.ts +4 -0
  102. package/geometry/operators/polygonOverlayOperator.d.ts +9 -1
  103. package/geometry/operators/polygonSlicerOperator.d.ts +7 -0
  104. package/geometry/operators/projectOperator.d.ts +6 -0
  105. package/geometry/operators/proximityOperator.d.ts +7 -0
  106. package/geometry/operators/relateOperator.d.ts +5 -0
  107. package/geometry/operators/reshapeOperator.d.ts +3 -0
  108. package/geometry/operators/shapePreservingProjectOperator.d.ts +7 -0
  109. package/geometry/operators/simplifyOGCOperator.d.ts +5 -0
  110. package/geometry/operators/simplifyOperator.d.ts +5 -0
  111. package/geometry/operators/support/GeographicTransformation.d.ts +2 -0
  112. package/geometry/operators/support/GeographicTransformationStep.d.ts +2 -0
  113. package/geometry/operators/support/Transformation.d.ts +6 -1
  114. package/geometry/operators/support/geographicTransformationUtils.d.ts +4 -0
  115. package/geometry/operators/symmetricDifferenceOperator.d.ts +4 -0
  116. package/geometry/operators/touchesOperator.d.ts +4 -0
  117. package/geometry/operators/types.d.ts +1 -0
  118. package/geometry/operators/unionOperator.d.ts +4 -0
  119. package/geometry/operators/withinOperator.d.ts +4 -0
  120. package/kernel.js +1 -1
  121. package/layers/GaussianSplatLayer.d.ts +0 -1
  122. package/layers/GeospatialPDFLayer.js +1 -1
  123. package/package.json +2 -2
  124. package/support/revision.js +1 -1
  125. package/symbols/LineSymbol3D.d.ts +0 -7
  126. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  127. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  128. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  129. package/views/3d/interactive/placementTools/GroundNavigationPlacementTool3D.js +1 -1
  130. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  132. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  133. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  134. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  135. package/views/3d/state/Constraints.js +1 -1
  136. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  137. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  138. package/views/3d/state/utils/navigationUtils.js +1 -1
  139. package/views/3d/terrain/SphericalPatch.js +1 -1
  140. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  141. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +23 -12
  142. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +35 -25
  143. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +2 -2
  144. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
  145. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  146. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  147. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  148. package/views/3d/webgl-engine/lib/IntersectorResult.js +1 -1
  149. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  150. package/views/3d/webgl-engine/lib/PolygonIntersectionResults.js +1 -1
  151. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  152. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  153. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  154. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  155. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  156. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  157. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  158. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  159. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +4 -4
  160. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  161. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  162. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +1 -1
  163. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  164. package/views/support/PromiseQueue.js +1 -1
  165. package/views/support/Scheduler.js +1 -1
  166. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +1 -1
  167. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  168. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  169. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  170. package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +148 -1
  171. package/assets/esri/core/workers/chunks/540f60e31b19d85e9371.js +0 -1
  172. package/assets/esri/core/workers/chunks/55a560fd872f7463b33d.js +0 -1
  173. package/assets/esri/core/workers/chunks/cf6f671823fa6c2a9a5e.js +0 -1
@@ -1,26 +1,36 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{markerSizePerLineWidth as r}from"../../../../support/engineContent/marker.js";import{addPixelRatio as o}from"../util/View.glsl.js";import{FloatBindUniform as t}from"../../shaderModules/FloatBindUniform.js";import{FloatPassUniform as i}from"../../shaderModules/FloatPassUniform.js";import{If as a,glsl as n}from"../../shaderModules/glsl.js";import{parameter as s}from"../../shaderTechnique/ShaderTechniqueConfiguration.js";import{ViewingModeConfiguration as d}from"../../../materials/ViewingModeConfiguration.js";import{NoParameters as l}from"../../../../../webgl/NoParameters.js";class c extends d{constructor(){super(...arguments),this.hasScreenSizePerspective=!1,this.worldSized=!1}}e([s()],c.prototype,"hasScreenSizePerspective",void 0),e([s()],c.prototype,"worldSized",void 0);class m extends l{constructor(){super(...arguments),this.markerScale=1}}function p(e,s){const d=e.vertex,l=s.hasScreenSizePerspective,c=s.worldSized;o(d),d.constants.add("markerSizePerLineWidth","float",r),d.uniforms.add(new i("markerScale",({markerScale:e})=>e)),c&&d.uniforms.add(new t("groundMetersToScreenRatio",e=>1/(e.screenToPlanarDistanceRatio*e.planarDistanceToGroundRatio))),d.code.add(n`
3
- float getLineWidth(${a(l,"vec3 pos")}) {
4
- float size = max(getSize(${a(l,"pos")}), 1.0);
5
- return ${a(c,"size * pixelRatio * groundMetersToScreenRatio","size * pixelRatio")};
6
- }
7
-
8
- float getScreenMarkerSize(float lineWidth) {
9
- return markerScale * markerSizePerLineWidth * lineWidth;
10
- }
11
- `),d.constants.add("maxSegmentLengthFraction","float",.45).uniforms.add(new t("perRenderPixelRatio",e=>e.camera.perRenderPixelRatio)).code.add(n`
12
- bool areWorldMarkersHidden(vec3 pos, vec3 other) {
13
- vec3 midPoint = mix(pos, other, 0.5);
14
- float distanceToCamera = length(midPoint);
15
- float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
16
- float worldMarkerSize = getScreenMarkerSize(getLineWidth(${a(l,"pos")})) * screenToWorldRatio;
17
- float segmentLen = length(pos - other);
18
- return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
19
- }
20
-
21
- float getWorldMarkerSize(vec3 pos) {
22
- float distanceToCamera = length(pos);
23
- float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
24
- return getScreenMarkerSize(getLineWidth(${a(l,"pos")})) * screenToWorldRatio;
25
- }
26
- `)}export{p as MarkerSizing,c as MarkerSizingConfiguration,m as MarkerSizingPassParameters};
2
+ import{markerSizePerLineWidth as e}from"../../../../support/engineContent/marker.js";import{nearFar as r,metersPerRenderUnit as o,perScreenPixelRatio as t}from"../util/cameraUniforms.js";import{addPixelRatio as a}from"../util/View.glsl.js";import{FloatBindUniform as i}from"../../shaderModules/FloatBindUniform.js";import{FloatPassUniform as n}from"../../shaderModules/FloatPassUniform.js";import{glsl as s,If as d}from"../../shaderModules/glsl.js";import{NoParameters as l}from"../../../../../webgl/NoParameters.js";class m extends l{constructor(){super(...arguments),this.markerScale=1}}function c(l,m){const c=l.vertex,p=m.hasScreenSizePerspective,S=m.worldSized,f=S&&!m.draped;a(c),c.constants.add("markerSizePerLineWidth","float",e),c.uniforms.add(new n("markerScale",({markerScale:e})=>e)),S&&c.uniforms.add(new i("groundMetersToScreenRatio",e=>1/(e.screenToPlanarDistanceRatio*e.planarDistanceToGroundRatio))),c.code.add(s`float getScreenMarkerSize(float lineWidth) {
3
+ return markerScale * markerSizePerLineWidth * lineWidth;
4
+ }`),c.code.add(d(f,s`
5
+ float getLineWidth(vec3 pos) {
6
+ float size = getSize(${d(p,"pos")});
7
+ float metersPerScreenPixel = max(-pos.z, nearFar[0]) * metersPerRenderUnit * perScreenPixelRatio;
8
+ return max(size / metersPerScreenPixel, 1.0) * pixelRatio;
9
+ }
10
+ `,s`
11
+ float getLineWidth(${d(m.lineWidthRequiresPosition,"vec3 pos")}) {
12
+ float size = max(getSize(${d(p,"pos")}), 1.0);
13
+ return ${d(S,"size * pixelRatio * groundMetersToScreenRatio","size * pixelRatio")};
14
+ }
15
+ `)),f?c.uniforms.add(r,o,t):c.uniforms.add(new i("perRenderPixelRatio",e=>e.camera.perRenderPixelRatio)),c.code.add(d(f,s`
16
+ float getWorldMarkerSize(vec3 pos) {
17
+ return markerScale * markerSizePerLineWidth * getSize(${d(p,"pos")}) * 0.5 / metersPerRenderUnit;
18
+ }
19
+ `,s`
20
+ float getWorldMarkerSize(vec3 pos) {
21
+ float distanceToCamera = length(pos);
22
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
23
+ return getScreenMarkerSize(getLineWidth(${d(p,"pos")})) * screenToWorldRatio;
24
+ }
25
+ `)),c.constants.add("maxSegmentLengthFraction","float",.45),c.code.add(d(f,s`bool areWorldMarkersHidden(vec3 pos, vec3 other) {
26
+ return getWorldMarkerSize(pos) > maxSegmentLengthFraction * length(pos - other);
27
+ }`,s`
28
+ bool areWorldMarkersHidden(vec3 pos, vec3 other) {
29
+ vec3 midPoint = mix(pos, other, 0.5);
30
+ float distanceToCamera = length(midPoint);
31
+ float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5;
32
+ float worldMarkerSize = getScreenMarkerSize(getLineWidth(${d(p,"pos")})) * screenToWorldRatio;
33
+ float segmentLen = length(pos - other);
34
+ return worldMarkerSize > maxSegmentLengthFraction * segmentLen;
35
+ }
36
+ `))}export{c as MarkerSizing,m as MarkerSizingPassParameters};
@@ -12,13 +12,13 @@ float readShadowMap(const in vec3 _worldPos ) { return readShadowMap(_worldPos,
12
12
  float readShadow(float additionalAmbientScale, vec3 vpos) {
13
13
  return getShadow(additionalAmbientScale, ${h(d,"readShadowMap(vpos)","0.0")});
14
14
  }
15
- `)}function S(a,o){o&&a.uniforms.add(new l("shadowHighlight",({shadowHighlight:a})=>a?.getTexture())),a.uniforms.add(new n("shadowMap",({shadowMap:a})=>a.getOutput(5)??a.getOutput(7))).code.add(s`
15
+ `)}function S(a,o,e="gl_FragCoord.xy"){o&&a.uniforms.add(new l("shadowHighlight",({shadowHighlight:a})=>a?.getTexture())),a.uniforms.add(new n("shadowMap",({shadowMap:a})=>a.getOutput(5)??a.getOutput(7))).code.add(s`
16
16
  float readShadowMaps(const in vec3 uvzShadow) {
17
17
  if (uvzShadow.z < 0.0) {
18
18
  return 0.0;
19
19
  }
20
20
 
21
21
  float shadow1 = texture(shadowMap, uvzShadow);
22
- ${h(o,"float shadow2 = texelFetch(shadowHighlight, ivec2(gl_FragCoord.xy), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;","return shadow1;")}
22
+ ${h(o,`float shadow2 = texelFetch(shadowHighlight, ivec2(${e}), 0).r;\n return shadow1 > shadow2 ? shadow1 : shadow2;`,"return shadow1;")}
23
23
  }
24
24
  `)}a([w()],f.prototype,"hasShadowHighlights",void 0),a([w()],f.prototype,"receiveShadows",void 0);export{f as ReadShadowMapConfiguration,c as ReadShadowMapDrawParameters,u as ReadShadowMapPassParameters,m as readShadowDraw,S as readShadowMaps,g as readShadowPass};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2BindUniform as i}from"../../shaderModules/Float2BindUniform.js";import{Float4BindUniform as a}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as t}from"../../shaderModules/Matrix4BindUniform.js";const n=new t("view",({camera:e})=>e.viewMatrix),m=new t("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),s=new t("proj",({camera:e})=>e.projectionMatrix),l=new t("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),c=new t("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix),w=new i("nearFar",({camera:e})=>e.nearFar),f=new a("viewport",({camera:e})=>e.fullViewport),p=new o("pixelRatio",({camera:e})=>e.pixelRatio),d=new i("inverseScreenSize",({camera:r})=>e(v,1/r.fullWidth,1/r.fullHeight)),v=r();export{l as inverseProjectionMatrix,d as inverseScreenSize,m as inverseViewMatrix,w as nearFar,p as pixelRatio,s as projMatrix,n as viewMatrix,c as viewNormal,f as viewport};
2
+ import{set as e}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{Float2BindUniform as i}from"../../shaderModules/Float2BindUniform.js";import{Float4BindUniform as a}from"../../shaderModules/Float4BindUniform.js";import{FloatBindUniform as o}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as n}from"../../shaderModules/Matrix4BindUniform.js";const t=new n("view",({camera:e})=>e.viewMatrix),m=new n("inverseViewMatrix",({camera:e})=>e.inverseViewMatrix),s=new n("proj",({camera:e})=>e.projectionMatrix),c=new n("inverseProjectionMatrix",({camera:e})=>e.inverseProjectionMatrix),l=new n("viewNormal",({camera:e})=>e.viewInverseTransposeMatrix),w=new i("nearFar",({camera:e})=>e.nearFar),p=new a("viewport",({camera:e})=>e.fullViewport),d=new o("pixelRatio",({camera:e})=>e.pixelRatio),f=new o("perScreenPixelRatio",({camera:e})=>e.perScreenPixelRatio),x=new o("metersPerRenderUnit",e=>e.metersPerRenderUnit),v=new i("inverseScreenSize",({camera:r})=>e(M,1/r.fullWidth,1/r.fullHeight)),M=r();export{c as inverseProjectionMatrix,v as inverseScreenSize,m as inverseViewMatrix,x as metersPerRenderUnit,w as nearFar,f as perScreenPixelRatio,d as pixelRatio,s as projMatrix,t as viewMatrix,l as viewNormal,p as viewport};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{releaseMaybe as i}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import e from"../../webgl/RenderCamera.js";import{isColor as h}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as n}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as r}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as a}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as o}from"../lighting/SceneLighting.js";class l{constructor(i,t){this.width=i,this.height=t}}const g=5e5;class c{constructor(i){this.shadowMap=i,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this.renderingShadowAnalysisMap=!1,this._camera=t(new e),this._inverseViewport=s(),this._oldLighting=new o,this._newLighting=new o,this._fadedLighting=new o,this._lighting=this._newLighting,this.screenSpaceReflections=new a,this.reprojection=new r,this.highlights=new Array,this.highlightMixOrigin=s(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new n,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=i(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(i){this._emissions.value=i}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get hasEmissions(){return 0!==this.emissions}get camera(){return this._camera.value}set camera(i){this._camera.value=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<g}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,s,e){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=s,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===e&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return h(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(i){i&&(i.name="geometry depth"),this._depth=i}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}export{c as BindParameters,l as ViewportSize};
2
+ import{releaseMaybe as i}from"../../../../core/maybe.js";import{signal as t}from"../../../../core/signal.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import e from"../../webgl/RenderCamera.js";import{isColor as h}from"../core/shaderLibrary/ShaderOutput.js";import{CloudsParameters as n}from"../effects/clouds/CloudsParameters.js";import{ReprojectionUniforms as r}from"./ReprojectionUniforms.js";import{ScreenSpaceReflectionsUniforms as a}from"./ScreenSpaceReflectionsUniforms.js";import{SceneLighting as o}from"../lighting/SceneLighting.js";class l{constructor(i,t){this.width=i,this.height=t}}const g=5e5;class c{constructor(i){this.shadowMap=i,this.output=0,this.slot=2,this.slicePlane=null,this.planarDistanceToGroundRatio=1,this.metersPerRenderUnit=1,this.hasOccludees=!1,this._emissions=t(0),this.transparentWithoutDepthEmissionDimmingPass=!1,this.useFloatBlend=t(!0),this.enableFillLights=!0,this.alignPixelEnabled=!1,this.decorations=!0,this.frameRendererTarget=0,this.overlayStretch=1,this.viewshedEnabled=!1,this.laserlinesEnabled=!1,this.shadowAnalysisEnabled=!1,this.cutFillComputationEnabled=!1,this.cutFillVisualizationEnabled=!1,this.renderingShadowAnalysisMap=!1,this._camera=t(new e),this._inverseViewport=s(),this._oldLighting=new o,this._newLighting=new o,this._fadedLighting=new o,this._lighting=this._newLighting,this.screenSpaceReflections=new a,this.reprojection=new r,this.highlights=new Array,this.highlightMixOrigin=s(),this.highlightMixTexture=null,this.globalIlluminationEnabled=!1,this.hudRenderStyle=0,this.snowCover=0,this.clouds=new n,this.hasShadowHighlights=!1}destroy(){this._camera=this.contentCamera=null,this.mainDepth=this.overlay=this.ssao=this.shadowHighlight=null,this.depth=i(this.depth),this.shadowMap?.dispose()}get emissions(){return this._emissions.value}set emissions(i){this._emissions.value=i}get hasEmission(){switch(this.output){case 0:return this.hasOpaqueEmission;case 1:case 2:return this.hasTransparentEmission;default:return!1}}get hasOpaqueEmission(){return 1===this.emissions||3===this.emissions}get hasTransparentEmission(){return 2===this.emissions||3===this.emissions}get hasEmissions(){return 0!==this.emissions}get camera(){return this._camera.value}set camera(i){this._camera.value=i,this._inverseViewport[0]=1/i.fullViewport[2],this._inverseViewport[1]=1/i.fullViewport[3]}get enableOITOffset(){return this.camera.relativeElevation<g}get inverseViewport(){return this._inverseViewport}get lighting(){return this._lighting}fadeLighting(){switch(this.clouds.fadeFactor){case 0:this._lighting=this._oldLighting;break;default:this._fadedLighting.lerpLighting(this._oldLighting,this._newLighting,this.clouds.fadeFactor),this._lighting=this._fadedLighting;break;case 1:this._lighting=this._newLighting,this._oldLighting.copyFrom(this._newLighting)}}updateLighting(i,t,s,e){this._oldLighting.copyFrom(this.lighting),this._newLighting.noonFactor=t,this._newLighting.globalFactor=s,this._newLighting.set(i),this._oldLighting.updateLegacy(),1===e&&this.clouds.requestFade(),this.fadeLighting()}get hasScreenSpaceReflections(){return h(this.output)&&this.screenSpaceReflections.enabled&&null!=this.reprojection.lastFrameColor}get highlight(){return null==this.highlightLevel?null:this.highlights[this.highlightLevel]}get depth(){return this._depth}set depth(i){i&&(i.name="geometry depth"),this._depth=i}get occluder(){return 10===this.slot||11===this.slot?this.slot:null}}export{c as BindParameters,l as ViewportSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{watch as i}from"../../../../core/reactiveUtils.js";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,set as n,positiveInfinity as h,equals as l}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as p}from"../../webgl.js";import{addWraparound as u}from"../../layers/i3s/I3SUtil.js";import c from"../../webgl/RenderNode.js";import{canRenderGaussianSplats as m,requiresPreciseColorDepth as d,prepareGaussianSplatPerspectiveParameters as _}from"./GaussianSplatRenderUtils.js";import{G as g}from"../../../../chunks/GaussianSplatColorComposition.glsl.js";import{GaussianSplatColorCompositionTechnique as f}from"../shaders/GaussianSplatColorCompositionTechnique.js";import{G as C}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as b}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{G as P}from"../../../../chunks/GaussianSplatEmissionComposition.glsl.js";import{GaussianSplatEmissionCompositionTechnique as S}from"../shaders/GaussianSplatEmissionCompositionTechnique.js";import{GaussianSplatPassParameters as q}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechnique as w}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as v}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as R,DepthStencilAttachment as x,ColorAttachment0 as D,DrawBufferNone as y,PrimitiveType as E}from"../../../webgl/enums.js";let G=class extends c{constructor(e){super(e),this.consumes={required:[p.GAUSSIAN_SPLAT]},this.produces=p.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new q,this._colorCompositionPassParameters=new g,this._emissionCompositionPassParameters=new P,this._depthCompositionPassParameters=new C,this._clipBox=o(),this._previousSortRequestCameraDirection=a(),this._cameraSortDirty=!1,this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._configuration=new v(e.view.state.isGlobal),n(this._clipBox,h)}async initialize(){this.addHandles([i(()=>this.view.state.camera,()=>this._onCameraChange()),i(()=>2===this.view.state.mode,e=>{e&&this._cameraSortDirty&&this._requestCameraSort(this.view.state.camera.ray.direction),this.requestRender(1)})])}precompile(){this._canRender&&(this._updateConfigurations(),this.techniques.precompile(w,this._configuration),this.techniques.precompile(f),this.bindParameters.hasOpaqueEmission&&this.techniques.precompile(S),this.techniques.precompile(b))}render(){const e=this.input;if(this._updateConfigurations(),this._fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;const i=e.getAttachment(R),{fullWidth:t,fullHeight:s}=this.bindParameters.camera;this._prepareParameters();const r=this.renderingContext,a=this.fboCache.acquire(t,s,"gaussian color output"),o=e.getAttachment(x);a.attachDepth(o);const n=this.techniques.get(w,this._configuration);this._renderGaussianColorAndDepth(a,n),this._depthCompositionPassParameters.splatDepth=a.getTexture(R),r.bindFramebuffer(e.fbo);const h=this.techniques.get(b);r.bindTechnique(h,this.bindParameters,this._depthCompositionPassParameters),r.screen.draw(),this._colorCompositionPassParameters.splatColor=a.getTexture();const l=this.techniques.get(f);r.bindTechnique(l,this.bindParameters,this._colorCompositionPassParameters);const p=r.setDrawBuffers([D]);if(r.screen.draw(),i){this._emissionCompositionPassParameters.splatColor=a.getTexture();const e=this.techniques.get(S);r.bindTechnique(e,this.bindParameters,this._emissionCompositionPassParameters),r.setDrawBuffers([y,R]),r.screen.draw()}return r.setDrawBuffers(p),a.release(),e}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const i=e||h;this._hasSameClipBox(i)||(n(this._clipBox,i),this._tileCullingRevision=u(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!l(this._clipBox,h,(e,i)=>e===i)}get _isIdle(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _canRender(){return m(this._data)}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.preciseDepth=d(this.bindParameters),this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}_onCameraChange(){this._tileCullingRevision=u(this._tileCullingRevision,1);const e=this.view.state.camera.ray.direction;this._cameraSortDirty=!0,(this._isIdle||this._shouldRequestSort(e))&&this._requestCameraSort(e)}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_requestCameraSort(e){this._data.requestSort(),r(this._previousSortRequestCameraDirection,e),this._cameraSortDirty=!1}_prepareParameters(){_(this._passParameters,this.layerView,this.camera)}_hasSameClipBox(e){return l(this._clipBox,e,(e,i)=>e===i)}_renderGaussianColorAndDepth(e,i){const t=this.renderingContext;e.acquireColor(R,5,"gaussian depth output"),t.bindFramebuffer(e.fbo),t.setClearColor(0,0,0,0),t.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}};e([t()],G.prototype,"consumes",void 0),e([t()],G.prototype,"produces",void 0),e([t({constructOnly:!0})],G.prototype,"layerView",void 0),G=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderer")],G);export{G as GaussianSplatRenderer};
2
+ import{__decorate as e}from"tslib";import{watch as i}from"../../../../core/reactiveUtils.js";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{copy as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as o,set as n,positiveInfinity as h,equals as l}from"../../../../geometry/support/aaBoundingBox.js";import{InternalRenderCategory as u}from"../../webgl.js";import{addWraparound as p}from"../../layers/i3s/I3SUtil.js";import c from"../../webgl/RenderNode.js";import{canRenderGaussianSplats as m,requiresPreciseColorDepth as d,prepareGaussianSplatPerspectiveParameters as _}from"./GaussianSplatRenderUtils.js";import{G as g}from"../../../../chunks/GaussianSplatColorComposition.glsl.js";import{GaussianSplatColorCompositionTechnique as f}from"../shaders/GaussianSplatColorCompositionTechnique.js";import{G as C}from"../../../../chunks/GaussianSplatDepthComposition.glsl.js";import{GaussianSplatDepthCompositionTechnique as b}from"../shaders/GaussianSplatDepthCompositionTechnique.js";import{G as P}from"../../../../chunks/GaussianSplatEmissionComposition.glsl.js";import{GaussianSplatEmissionCompositionTechnique as S}from"../shaders/GaussianSplatEmissionCompositionTechnique.js";import{GaussianSplatPassParameters as q}from"../shaders/GaussianSplatPassParameters.js";import{GaussianSplatTechnique as w}from"../shaders/GaussianSplatTechnique.js";import{GaussianSplatTechniqueConfiguration as v}from"../shaders/GaussianSplatTechniqueConfiguration.js";import{ColorAttachment1 as R,DepthStencilAttachment as x,ColorAttachment0 as D,DrawBufferNone as y,PrimitiveType as E}from"../../../webgl/enums.js";let G=class extends c{constructor(e){super(e),this.consumes={required:[u.GAUSSIAN_SPLAT]},this.produces=u.GAUSSIAN_SPLAT,this._slicePlaneEnabled=!1,this.layerView=null,this._passParameters=new q,this._colorCompositionPassParameters=new g,this._emissionCompositionPassParameters=new P,this._depthCompositionPassParameters=new C,this._clipBox=o(),this._previousSortRequestCameraDirection=a(),this._cameraSortDirty=!1,this._tileCullingRevision=0,this._sortRequestDirectionEpsilon=.01,this._configuration=new v(e.view.state.isGlobal),n(this._clipBox,h)}async initialize(){this.addHandles([i(()=>this.view.state.camera,()=>this._onCameraChange()),i(()=>2===this.view.state.mode,e=>{e&&this._cameraSortDirty&&this._requestCameraSort(this.view.state.camera.ray.direction),this.requestRender(1)})])}precompile(){this._canRender&&(this._updateConfigurations(),this.techniques.precompile(w,this._configuration),this.techniques.precompile(f),this.bindParameters.hasOpaqueEmission&&this.techniques.precompile(S),this.techniques.precompile(b))}render(){const e=this.input;if(this._updateConfigurations(),this._fadeHelper.updateForFrame(this.view.stage.renderView.renderer.renderContext.time),!this._canRender)return e;const i=e.getAttachment(R),{fullWidth:t,fullHeight:s}=this.bindParameters.camera;this._prepareParameters();const r=this.renderingContext,a=this.fboCache.acquire(t,s,"gaussian color output"),o=e.getAttachment(x);a.attachDepth(o);const n=this.techniques.get(w,this._configuration);this._renderGaussianColorAndDepth(a,n),this._depthCompositionPassParameters.splatDepth=a.getTexture(R),r.bindFramebuffer(e.fbo);const h=this.techniques.get(b);r.bindTechnique(h,this.bindParameters,this._depthCompositionPassParameters),r.screen.draw(),this._colorCompositionPassParameters.splatColor=a.getTexture();const l=this.techniques.get(f);r.bindTechnique(l,this.bindParameters,this._colorCompositionPassParameters);const u=r.setDrawBuffers([D]);if(r.screen.draw(),i){this._emissionCompositionPassParameters.splatColor=a.getTexture();const e=this.techniques.get(S);r.bindTechnique(e,this.bindParameters,this._emissionCompositionPassParameters),r.setDrawBuffers([y,R]),r.screen.draw()}return r.setDrawBuffers(u),a.release(),e}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this.requestRender(1))}set clippingBox(e){const i=e||h;this._hasSameClipBox(i)||(n(this._clipBox,i),this._tileCullingRevision=p(this._tileCullingRevision,1),this._data.requestSort(),this.requestRender(1))}get clippingBox(){return this._clippingEnabled?this._clipBox:null}get tileCullingRevision(){return this._tileCullingRevision}get _clippingEnabled(){return!l(this._clipBox,h,(e,i)=>e===i)}get _isIdle(){return 2===this.view.state.mode}get _data(){return this.layerView.data}get _canRender(){return m(this._data)}get _fadeHelper(){return this.layerView.fadeHelper}_updateConfigurations(){this._configuration.alphaCutoff=this.view.qualitySettings.gaussianSplat.minimumOpacity,this._configuration.fadingEnabled=this._fadeHelper.fadingEnabled,this._configuration.receiveShadows=this.bindParameters.shadowMap.ready,this._configuration.fragmentShading=this._configuration.receiveShadows&&this.view.stage.renderer.isFeatureEnabled(12),this._configuration.preciseDepth=d(this.bindParameters),this._configuration.hasShadowHighlights=this._configuration.receiveShadows&&this.bindParameters.hasShadowHighlights,this._configuration.clippingEnabled=this._clippingEnabled,this._configuration.hasSlicePlane=this._slicePlaneEnabled&&null!=this.bindParameters.slicePlane}_onCameraChange(){this._tileCullingRevision=p(this._tileCullingRevision,1);const e=this.view.state.camera.ray.direction;this._cameraSortDirty=!0,(this._isIdle||this._shouldRequestSort(e))&&this._requestCameraSort(e)}_shouldRequestSort(e){return Math.abs(e[0]-this._previousSortRequestCameraDirection[0])>this._sortRequestDirectionEpsilon||Math.abs(e[1]-this._previousSortRequestCameraDirection[1])>this._sortRequestDirectionEpsilon||Math.abs(e[2]-this._previousSortRequestCameraDirection[2])>this._sortRequestDirectionEpsilon}_requestCameraSort(e){this._data.requestSort(),r(this._previousSortRequestCameraDirection,e),this._cameraSortDirty=!1}_prepareParameters(){_(this._passParameters,this.layerView,this.camera)}_hasSameClipBox(e){return l(this._clipBox,e,(e,i)=>e===i)}_renderGaussianColorAndDepth(e,i){const t=this.renderingContext;e.acquireColor(R,5,"gaussian depth output"),t.bindFramebuffer(e.fbo),t.setClearColor(0,0,0,0),t.clear(16384),this.renderingContext.bindTechnique(i,this.bindParameters,this._passParameters),this.renderingContext.drawArraysInstanced(E.TRIANGLE_STRIP,0,4,this._data.visibleGaussians)}};e([t()],G.prototype,"consumes",void 0),e([t()],G.prototype,"produces",void 0),e([t({constructOnly:!0})],G.prototype,"layerView",void 0),G=e([s("esri.views.3d.webgl-engine.lib.GaussianSplatRenderer")],G);export{G as GaussianSplatRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromTranslation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as s,transformMat4 as i,copy as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustumPlanes.js";import{create as a,fromPoints as l,copy as c}from"../../../../geometry/support/ray.js";import h from"../../webgl/RenderCamera.js";import{HUDTarget as f,HUDIntersectorResult as m}from"./HUDIntersectorResult.js";import{IntersectorOptions as u}from"./IntersectorInterfaces.js";import{IntersectorResultRay as y,compareOrderedIntersectionHits as d}from"./IntersectorResult.js";import{ObjectTarget as g}from"./ObjectTarget.js";import{PolygonIntersectionResults as p}from"./PolygonIntersectionResults.js";import{IntersectorTransform as _,getVerticalOffsetObject3D as v}from"./verticalOffsetUtils.js";const b=1e-5,j=e();class O{constructor(t){this.options=new u,this._results=new P,this.polygonResults=new p,this.transform=new _,this.camera=new h,this.screenPolygonPrimitiveProcessor=w,this.tolerance=b,this.verticalOffset=null,this._ray=a(),this._rayEnd=n(),this._rayBeginTransformed=n(),this._rayEndTransformed=n(),this.viewingMode=t??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,e,s){this.resetWithRay(l(t,e,this._ray),s)}resetWithRay(t,e){this.camera=e,t!==this._ray&&c(t,this._ray),0!==this.options.verticalOffset?2===this.viewingMode?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,s(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(t=null,e,s,i,r){this.point=e,this.filterPredicate=i,this.tolerance=s??b;const n=v(this.verticalOffset);if(t&&t.length>0){const e=r?t=>{r(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const s of t){const t=s.getSpatialQueryAccelerator?.();null!=t?(null!=n?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,e,n):t.forEachAlongRay(this._ray.origin,this._ray.direction,e),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(e)):s.objects.forEach(t=>e(t))}}this.sortResults()}*intersectScreenPolygon(t=null,e){if(this.verticalOffset=null,t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.();if(null!=t)for(const s of t.intersectingFrustumValues(e.broadPhaseFrustum,t=>t.visible))yield*this._intersectScreenPolygonObject(s,e);else for(const i of s.objects.values())i.visible&&o(e.broadPhaseFrustum,i.boundingVolumeWorldSpace.sphere)&&(yield*this._intersectScreenPolygonObject(i,e))}}*intersectHUDScreenPolygon(t=null,e){if(this.verticalOffset=null,this.options.selectionMode&&this.options.hud&&t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.(),i=t?.degenerateObjectValues()??s.objects.values();for(const s of i)yield*this._intersectScreenPolygonObject(s,e)}}*_intersectScreenPolygonObject(t,e){const s=t.geometries;if(!t.visible||!s)return;const i=t.effectiveTransformation;for(const r of s){if(!r.visible)continue;const{material:s,id:n}=r;if(!s.visible||!s.intersectScreenPolygon)continue;this._setGeometryTransform(i,r);const o=s.intersectScreenPolygon(r,this.transform.transform,this,e);o?.valid&&this._handleObjectScreenPolygonIntersection(o.type,new g(t,n,o.primitiveIndex),o.distance,o.point),yield}}intersectObject(t){const e=t.geometries;if(!e)return;const s=t.effectiveTransformation,r=v(this.verticalOffset);for(const n of e){if(!n.visible)continue;const{material:e,id:o}=n;if(!e.visible)continue;this._setGeometryTransform(s,n),i(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),i(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const a=this.transform.transform;null!=r&&(r.objectTransform=this.transform),e.intersectRay(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(e,s,i,r,n)=>this.handleObjectIntersection({object:t,geometryId:o,primitiveIndex:r},e,s,i,a,n))}}_setGeometryTransform(e,s){const i=1===s.type?t(j,s.localOrigin.vec3):s.transformation;this.transform.setAndInvalidateLazyTransforms(e,i)}handleObjectIntersection(t,e,s,i,r,n){if(e<0||null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const o=n?this._results.hud:this._results;t=n?new f(t,n):t;const a=n?r=>r.set(1,t,e,s,i):n=>n.set(4,t,e,s,i,r);if((null==o.min.renderDistance||s<o.min.renderDistance)&&a(o.min),0!==this.options.store&&(null==o.max.renderDistance||s>o.max.renderDistance)&&a(o.max),2===this.options.store)if(n){const t=new m(this._ray);a(t),this._results.hud.all.push(t)}else{const t=new y(this._ray);a(t),this._results.all.push(t)}}_handleObjectScreenPolygonIntersection(t,e,s,i){s<0||(null==this.filterPredicate||null!=i&&this.filterPredicate(this.camera.eye,i,1))&&this.polygonResults.add(t,1===t&&i?new f(e,i):e,s)}sortResults(t=this._results.all){t.sort(d)}}class P{constructor(){this.min=new y(a()),this.max=new y(a()),this.hud={min:new m(a()),max:new m(a()),all:new Array},this.ground=new y(a()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}const w={*processTriangle(t){yield t},*processLineSegment(t,e,s){r(t[0],e),r(t[1],s),yield t},validatePoint:()=>!0};export{O as Intersector,w as defaultScreenPolygonPrimitiveProcessor,b as defaultTolerance};
2
+ import{fromTranslation as t}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{add as s,transformMat4 as i,copy as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{intersectsSphere as o}from"../../../../geometry/support/frustumPlanes.js";import{create as a,fromPoints as l,copy as c}from"../../../../geometry/support/ray.js";import h from"../../webgl/RenderCamera.js";import{HUDTarget as f,HUDIntersectorResult as m}from"./HUDIntersectorResult.js";import{IntersectorOptions as u}from"./IntersectorInterfaces.js";import{IntersectorResultRay as y,compareOrderedIntersectionHits as d}from"./IntersectorResult.js";import{ObjectTarget as g}from"./ObjectTarget.js";import{PolygonIntersectionResults as p}from"./PolygonIntersectionResults.js";import{IntersectorTransform as _,getVerticalOffsetObject3D as v}from"./verticalOffsetUtils.js";const b=1e-5,j=e();class O{constructor(t){this.options=new u,this._results=new P,this.polygonResults=new p,this.transform=new _,this.camera=new h,this.screenPolygonPrimitiveProcessor=w,this.tolerance=b,this.verticalOffset=null,this._ray=a(),this._rayEnd=n(),this._rayBeginTransformed=n(),this._rayEndTransformed=n(),this.viewingMode=t??1}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(t,e,s){this.resetWithRay(l(t,e,this._ray),s)}resetWithRay(t,e){this.camera=e,t!==this._ray&&c(t,this._ray),0!==this.options.verticalOffset?2===this.viewingMode?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,s(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray),this.polygonResults.init()}intersect(t=null,e,s,i,r){this.point=e,this.filterPredicate=i,this.tolerance=s??b;const n=v(this.verticalOffset);if(t&&t.length>0){const e=r?t=>{r(t)&&this.intersectObject(t)}:t=>{this.intersectObject(t)};for(const s of t){const t=s.getSpatialQueryAccelerator?.();null!=t?(null!=n?t.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,e,n):t.forEachAlongRay(this._ray.origin,this._ray.direction,e),this.options.selectionMode&&this.options.hud&&t.forEachDegenerateObject(e)):s.objects.forEach(t=>e(t))}}this.sortResults()}*intersectScreenPolygon(t=null,e){if(this.verticalOffset=null,t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.();if(null!=t)for(const s of t.intersectingFrustumValues(e.broadPhaseFrustum,t=>t.visible))yield*this._intersectScreenPolygonObject(s,e);else for(const i of s.objects.values())i.visible&&o(e.broadPhaseFrustum,i.boundingVolumeWorldSpace.sphere)&&(yield*this._intersectScreenPolygonObject(i,e))}}*intersectHUDScreenPolygon(t=null,e){if(this.verticalOffset=null,this.options.selectionMode&&this.options.hud&&t?.length)for(const s of t){const t=s.getSpatialQueryAccelerator?.(),i=t?.degenerateObjectValues()??s.objects.values();for(const s of i)yield*this._intersectScreenPolygonObject(s,e)}}*_intersectScreenPolygonObject(t,e){const s=t.geometries;if(!t.visible||!s)return;const i=t.effectiveTransformation;for(const r of s){if(!r.visible)continue;const{material:s,id:n}=r;if(!s.visible||!s.intersectScreenPolygon)continue;this._setGeometryTransform(i,r);const o=s.intersectScreenPolygon(r,this.transform.transform,this,e);o?.valid&&this._handleObjectScreenPolygonIntersection(o.type,new g(t,n,o.primitiveIndex),o.distance,o.renderDistance,o.point),yield}}intersectObject(t){const e=t.geometries;if(!e)return;const s=t.effectiveTransformation,r=v(this.verticalOffset);for(const n of e){if(!n.visible)continue;const{material:e,id:o}=n;if(!e.visible)continue;this._setGeometryTransform(s,n),i(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),i(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const a=this.transform.transform;null!=r&&(r.objectTransform=this.transform),e.intersectRay(n,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(e,s,i,r,n)=>this.handleObjectIntersection({object:t,geometryId:o,primitiveIndex:r},e,s,i,a,n))}}_setGeometryTransform(e,s){const i=1===s.type?t(j,s.localOrigin.vec3):s.transformation;this.transform.setAndInvalidateLazyTransforms(e,i)}handleObjectIntersection(t,e,s,i,r,n){if(e<0||null!=this.filterPredicate&&!this.filterPredicate(this._ray.origin,this._rayEnd,s))return;const o=n?this._results.hud:this._results;t=n?new f(t,n):t;const a=n?r=>r.set(1,t,e,s,i):n=>n.set(4,t,e,s,i,r);if((null==o.min.renderDistance||s<o.min.renderDistance)&&a(o.min),0!==this.options.store&&(null==o.max.renderDistance||s>o.max.renderDistance)&&a(o.max),2===this.options.store)if(n){const t=new m(this._ray);a(t),this._results.hud.all.push(t)}else{const t=new y(this._ray);a(t),this._results.all.push(t)}}_handleObjectScreenPolygonIntersection(t,e,s,i,r){s<0||(null==this.filterPredicate||null!=r&&this.filterPredicate(this.camera.eye,r,1))&&this.polygonResults.add(t,1===t&&r?new f(e,r):e,s,i)}sortResults(t=this._results.all){t.sort(d)}}class P{constructor(){this.min=new y(a()),this.max=new y(a()),this.hud={min:new m(a()),max:new m(a()),all:new Array},this.ground=new y(a()),this.all=[]}init(t){this.min.init(t),this.max.init(t),this.ground.init(t),this.all.length=0,this.hud.min.init(t),this.hud.max.init(t),this.hud.all.length=0}}const w={*processTriangle(t){yield t},*processLineSegment(t,e,s){r(t[0],e),r(t[1],s),yield t},validatePoint:()=>!0};export{O as Intersector,w as defaultScreenPolygonPrimitiveProcessor,b as defaultTolerance};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{copy as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t,IDENTITY as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,length as s,add as n,copy as a,normalize as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c,UNIT_Z as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,copy as u}from"../../../../geometry/support/ray.js";class y{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(r,t,e,i=null,s=null,n=null){this.intersector=r,this._distance=e,this._renderDistance=i,this.target=t,this.drapedLayerOrder=s,this.renderPriority=n}}class p extends y{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:(i(x,this.ray.direction,this.distance),s(x))}withinDistance(r){return!!_(this)&&(null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=r)}getIntersectionPoint(r){return!!_(this)&&(i(x,this.ray.direction,this.distance),n(r,this.ray.origin,x),!0)}getTransformedNormal(r){return a(b,this.normal),b[3]=0,h(b,b,this.transformation),a(r,b),o(r,r)}constructor(r){super(),this.normal=c(),this.transformation=t(),this._ray=m(),this.init(r)}init(r){super._init(),r&&u(r,this._ray)}set(t,i,s,n,o,c,h,l){this._setBase(t,i,s,n,h,l),a(this.normal,o??d),r(this.transformation,c??e)}copy(t){this._setBase(t.intersector,t.target,t.distance,t.renderDistance,t.drapedLayerOrder,t.renderPriority),u(t.ray,this._ray),a(this.normal,t.normal),r(this.transformation,t.transformation)}}class f extends y{constructor(r,t,e,i=null,s=null){super(),this._setBase(r,t,e,e,i,s)}copy(r){this._setBase(r.intersector,r.target,r.distance,r.renderDistance,r.drapedLayerOrder,r.renderPriority)}}function _(r){return null!=r?.distance&&null!=r?.renderDistance}function g(r){return r instanceof p&&_(r)}function D(r,t){return r.renderDistance!==t.renderDistance?(r.renderDistance??0)-(t.renderDistance??0):r.drapedLayerOrder!==t.drapedLayerOrder?L(r.drapedLayerOrder,t.drapedLayerOrder):L(r.renderPriority,t.renderPriority)}function L(r,t){return(t??-Number.MAX_VALUE)-(r??-Number.MAX_VALUE)}const x=c(),b=l();export{y as IntersectorResult,p as IntersectorResultRay,f as IntersectorResultScreenPolygon,L as compareDrapedOrder,D as compareOrderedIntersectionHits,_ as isValidIntersectorResult,g as isValidIntersectorResultRay};
2
+ import{copy as r}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as t,IDENTITY as e}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as i,length as s,add as n,copy as a,normalize as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as c,UNIT_Z as d}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transformMat4 as h}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as m,copy as u}from"../../../../geometry/support/ray.js";class y{constructor(){this.intersector=4}get distance(){return this._distance}get renderDistance(){return this._renderDistance}_init(){this._distance=this._renderDistance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4}_setBase(r,t,e,i=null,s=null,n=null){this.intersector=r,this._distance=e,this._renderDistance=i,this.target=t,this.drapedLayerOrder=s,this.renderPriority=n}}class p extends y{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:(i(x,this.ray.direction,this.distance),s(x))}withinDistance(r){return!!_(this)&&(null!=this.distanceInRenderSpace&&this.distanceInRenderSpace<=r)}getIntersectionPoint(r){return!!_(this)&&(i(x,this.ray.direction,this.distance),n(r,this.ray.origin,x),!0)}getTransformedNormal(r){return a(b,this.normal),b[3]=0,h(b,b,this.transformation),a(r,b),o(r,r)}constructor(r){super(),this.normal=c(),this.transformation=t(),this._ray=m(),this.init(r)}init(r){super._init(),r&&u(r,this._ray)}set(t,i,s,n,o,c,h,l){this._setBase(t,i,s,n,h,l),a(this.normal,o??d),r(this.transformation,c??e)}copy(t){this._setBase(t.intersector,t.target,t.distance,t.renderDistance,t.drapedLayerOrder,t.renderPriority),u(t.ray,this._ray),a(this.normal,t.normal),r(this.transformation,t.transformation)}}class f extends y{constructor(r,t,e,i=e,s=null,n=null){super(),this._setBase(r,t,e,i,s,n)}copy(r){this._setBase(r.intersector,r.target,r.distance,r.renderDistance,r.drapedLayerOrder,r.renderPriority)}}function _(r){return null!=r?.distance&&null!=r?.renderDistance}function g(r){return r instanceof p&&_(r)}function D(r,t){return r.renderDistance!==t.renderDistance?(r.renderDistance??0)-(t.renderDistance??0):r.drapedLayerOrder!==t.drapedLayerOrder?L(r.drapedLayerOrder,t.drapedLayerOrder):L(r.renderPriority,t.renderPriority)}function L(r,t){return(t??-Number.MAX_VALUE)-(r??-Number.MAX_VALUE)}const x=c(),b=l();export{y as IntersectorResult,p as IntersectorResultRay,f as IntersectorResultScreenPolygon,L as compareDrapedOrder,D as compareOrderedIntersectionHits,_ as isValidIntersectorResult,g as isValidIntersectorResultRay};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{VisualVariablesParameters as i}from"../../layers/support/FastSymbolUpdates.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as s}from"./geometryDataUtils.js";import{Material as e}from"./Material.js";import{hasShadowHighlights as r}from"../shaders/ReceiveShadowsConfiguration.js";class o extends i{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.shadingEnabled=!1,this.isDecoration=!1,this.worldSized=!1}}class a extends e{constructor(){super(...arguments),this.primitiveVertexCount=1}updateConfiguration(i){super.updateConfiguration(i),this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.draped=18===i.slot,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.worldSized=this._configuration.draped&&this.parameters.worldSized,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasOccludees=i.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,t(i.output)&&this.parameters.shadingEnabled?(this._configuration.receiveShadows=i.shadowMap.enabled,this._configuration.hasShadowHighlights=r(this._configuration,i),this._configuration.receiveAmbientOcclusion=null!=i.ssao,this._configuration.receiveGlobalIllumination=i.globalIlluminationEnabled):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}computeAttachmentOrigin(i,t,e){return s(i,t,e,this._isClosed(e))}_isClosed(i){return(this.parameters.isClosed??!1)&&i>2}}export{a as LineMaterial,o as LineMaterialParameters};
2
+ import{VisualVariablesParameters as i}from"../../layers/support/FastSymbolUpdates.js";import{isColor as t}from"../core/shaderLibrary/ShaderOutput.js";import{computeAttachmentOriginLines as s}from"./geometryDataUtils.js";import{Material as e}from"./Material.js";import{hasShadowHighlights as r}from"../shaders/ReceiveShadowsConfiguration.js";class o extends i{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.shadingEnabled=!1,this.isDecoration=!1,this.worldSized=!1}}class a extends e{constructor(){super(...arguments),this.primitiveVertexCount=1}updateConfiguration(i){super.updateConfiguration(i),this._configuration.pbrMode=this.parameters.shadingEnabled?2:0,this._configuration.draped=18===i.slot,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.worldSized=this.parameters.worldSized,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasOccludees=i.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,t(i.output)&&this.parameters.shadingEnabled?(this._configuration.receiveShadows=i.shadowMap.enabled,this._configuration.hasShadowHighlights=r(this._configuration,i),this._configuration.receiveAmbientOcclusion=null!=i.ssao,this._configuration.receiveGlobalIllumination=i.globalIlluminationEnabled):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=this._configuration.receiveGlobalIllumination=!1}computeAttachmentOrigin(i,t,e){return s(i,t,e,this._isClosed(e))}_isClosed(i){return(this.parameters.isClosed??!1)&&i>2}}export{a as LineMaterial,o as LineMaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{IntersectorResultScreenPolygon as l,compareOrderedIntersectionHits as t}from"./IntersectorResult.js";class s{constructor(){this.all=[]}init(){this.all.length=0}add(t,s,r,o=null,e=null){this.all.push(new l(t,s,r,o,e))}sortResults(l=this.all){l.sort(t)}}export{s as PolygonIntersectionResults};
2
+ import{IntersectorResultScreenPolygon as l,compareOrderedIntersectionHits as t}from"./IntersectorResult.js";class s{constructor(){this.all=[]}init(){this.all.length=0}add(t,s,r,o=r,e=null,i=null){this.all.push(new l(t,s,r,o,e,i))}sortResults(l=this.all){l.sort(t)}}export{s as PolygonIntersectionResults};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),"high"===t){const e=has("disable-feature:global-illumination")?3:11;i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0),11===e&&i.set(2,10,!0)}else i.set(2,3,!0);if("low"!==t&&(i.set(2,5,!0),i.set(2,6,!0)),"medium"===t)for(const e of s)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);else if("high"===t)for(const e of o)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);return i}const s=[9,7],o=[...s,0,2,4];export{t as setupFeatureDefaults};
2
+ import has from"../../../../core/has.js";import{NestedMap as e}from"../../../../core/NestedMap.js";function t(t){const i=new e;if(i.set(2,4,!0),i.set(2,0,!0),i.set(2,2,!0),i.set(2,1,!0),i.set(2,8,!0),i.set(2,12,!0),"high"===t){const e=has("disable-feature:global-illumination")?3:11;i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0),11===e&&i.set(2,10,!0)}else i.set(2,3,!0);if("low"!==t&&(i.set(2,5,!0),i.set(2,6,!0)),"medium"===t)for(const e of s)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);else if("high"===t)for(const e of o)i.set(0,e,!0),i.set(1,e,!0),i.set(2,e,!0);return i}const s=[9,7],o=[...s,0,2,4];export{t as setupFeatureDefaults};
@@ -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 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{PixelType as de,ColorAttachment0 as le,ColorAttachment1 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._3dGeometryRendered(),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.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),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,de.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(le);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(i-1),t.attachColor(s,le),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(ue);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(ue,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(ue,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:ue;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-le,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,ue]);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)}}_3dGeometryRendered(){const e=this._bindParameters;this.hasReflections&&(e.depth=h(e.depth),e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);const t=this._framebuffer.color.getAttachment(ue)?.attachment;if(this.hasGlobalIllumination&&t){const{width:s,height:i}=this._framebuffer.size,r=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(s,i,"emissive",r),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_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};
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{PixelType as de,ColorAttachment0 as le,ColorAttachment1 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.metersPerRenderUnit=this.stage.view.renderCoordsHelper.unitInMeters,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._3dGeometryRendered(),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.hasGlobalIllumination&&(this._bindParameters.reprojection.lastFrameDepth=this._bindParameters.depth),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,de.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(le);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(3),e.depth=t.obtainDepthTexture(),e.depth?.retain(i-1),t.attachColor(s,le),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(ue);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(ue,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(ue,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:ue;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-le,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,ue]);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)}}_3dGeometryRendered(){const e=this._bindParameters;this.hasReflections&&(e.depth=h(e.depth),e.reprojection.lastFrameColor=h(e.reprojection.lastFrameColor)),e.shadowMap.disposeOutput(5);const t=this._framebuffer.color.getAttachment(ue)?.attachment;if(this.hasGlobalIllumination&&t){const{width:s,height:i}=this._framebuffer.size,r=e.useFloatBlend.value?8:5;e.reprojection.lastFrameEmission=this.fboCache.acquire(s,i,"emissive",r),this._blit.blitTexture(t,e,e.reprojection.lastFrameEmission.fbo)}}_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{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as i,everyMap as s}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as p}from"./ChangeSet.js";import{IntersectorResultRay as m}from"./IntersectorResult.js";import{RendererBase as g}from"./RendererBase.js";import{noBudget as u}from"../../../support/Scheduler.js";let y=class extends g{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return i(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&i(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return s(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get _screenToMapUnitsRatio(){return this.rendererContext.screenToMapUnitsRatio}get _mapUnitsToGroundRatio(){return this.rendererContext.mapUnitsToGroundRatio}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,u,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=i(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=i(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}addRenderer(){this._sortedRenderers.clear()}removeRenderer(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const s of t)this._geometries.set(s.id,s);const i=this._pending.empty;for(const s of t)this._pending.adds.add(s);switch(i&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,i=this._pending.adds;for(const s of e)i.has(s)?(this._pending.removed.add(s),i.delete(s)):this._pending.removed.has(s)||this._pending.removes.add(s),this._geometries.delete(s.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const i of e){const e=new p;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(i),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersectRay(e,r,t,i,s){for(const n of this._geometries.values()){if(!i(n))continue;this._intersectRenderGeometry(n,t,r,0,e,s);const o=this.rendererContext.longitudeCyclical;if(o){const i=n.boundingSphere.center,a=this._effectiveGeometryRadius(n);i[0]-a<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,s),i[0]+a>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,s)}s++}return s}*intersectScreenPolygon(e,r,t,i){for(const s of this._geometries.values()){if(!t(s))continue;this._intersectScreenPolygonRenderGeometry(s,r,0,e,i);const n=this.rendererContext.longitudeCyclical;if(n){const t=s.boundingSphere.center,o=this._effectiveGeometryRadius(s);t[0]-o<n.min&&this._intersectScreenPolygonRenderGeometry(s,r,n.range,e,i),t[0]+o>n.max&&this._intersectScreenPolygonRenderGeometry(s,r,-n.range,e,i)}i++,yield}return i}_effectiveGeometryRadius(e){const r=e.boundingSphere.radius;return r||this._screenToMapUnitsRatio*C}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,i,s,n){if(!e.visible||!e.material.visible||!e.material.intersectRayDraped)return;let o=0;0===e.type?(i+=e.transformation[12],o=e.transformation[13]):(i+=e.localOrigin.vec3[0],o=e.localOrigin.vec3[1]),G[0]=t[0]-i,G[1]=t[1]-o,e.material.intersectRayDraped(e,s,G,(t,i,o,a)=>{f(r,a,n,e.material.renderPriority,s,e.layerViewUid,e.graphicUid)},r,this._screenToMapUnitsRatio,this._mapUnitsToGroundRatio)}_intersectScreenPolygonRenderGeometry(e,r,t,i,s){if(!e.visible||!e.material.visible||!e.material.intersectScreenPolygonDraped)return;0===e.type?d(v,t+e.transformation[12],e.transformation[13]):d(v,t+e.localOrigin.vec3[0],e.localOrigin.vec3[1]);const n=this._screenToMapUnitsRatio;for(const o of r){const r=e.material.intersectScreenPolygonDraped(e,v,i,o,n,this._mapUnitsToGroundRatio);if(r)return void R(o.distance,r.primitiveIndex,s,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)}}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return 1===e.type||null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([a("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,i,s,n,o){const a=new c(n,o,r),d=r=>{r.set(5,a,e.distance,e.renderDistance,e.normal,e.transformation,t,i)};if((null==s.results.min.drapedLayerOrder||t>=s.results.min.drapedLayerOrder)&&(null==s.results.min.renderDistance||s.results.ground.renderDistance<=s.results.min.renderDistance)&&d(s.results.min),0!==s.options.store&&(null==s.results.max.drapedLayerOrder||t<s.results.max.drapedLayerOrder)&&(null==s.results.max.renderDistance||s.results.ground.renderDistance>s.results.max.renderDistance)&&d(s.results.max),2===s.options.store){const e=new m(s.ray);d(e),s.results.all.push(e)}}function R(e,r,t,i,s,n,o){s.polygonResults.add(5,new c(n,o,r),e,t,i)}const G=h(),v=h(),C=128;export{y as SortedRenderGeometryRenderer};
2
+ import{__decorate as e}from"tslib";import{addMany as r,filterInPlace as t}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{someMap as i,everyMap as s}from"../../../../core/MapUtils.js";import n from"../../../../core/PooledArray.js";import{property as o,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{set as d}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{OverlayTarget as c}from"../../terrain/Intersector.js";import{ChangeSet as l,RenderGeometryUpdate as p}from"./ChangeSet.js";import{IntersectorResultRay as m}from"./IntersectorResult.js";import{RendererBase as g}from"./RendererBase.js";import{noBudget as u}from"../../../support/Scheduler.js";let y=class extends g{constructor(e){super(e),this._pending=new _,this._changes=new l,this._sortedRenderers=new n,this._geometries=new Map,this._hasHighlights=!1,this._hasWater=!1}destroy(){this.destroyed||(this._changes.prune(),this._sortedRenderers.prune(),this._geometries.clear(),this._pending.clear())}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}hasHighlight(e){return i(this.renderers,r=>r.hasHighlight(e))}get hasWater(){return this._hasWater}get hasOccluders(){return this.renderers&&i(this.renderers,e=>e.hasOnlyOccluders)}get hasOnlyOccluders(){return s(this.renderers,e=>e.hasOnlyOccluders)}get isEmpty(){return!this.updating&&0===this.renderers.size&&0===this._geometries.size}get _screenToMapUnitsRatio(){return this.rendererContext.screenToMapUnitsRatio}get _mapUnitsToGroundRatio(){return this.rendererContext.mapUnitsToGroundRatio}get sortedRenderers(){return this._sortedRenderers}commitChanges(){return!!this.updating&&(this._processAddsRemoves(),this.commit(this._changes,u,this.rendererContext.pluginContext)&&(this._updateSortedMaterialRenderers(),this._hasHighlights=i(this.renderers,e=>{const r=e.produces.get(18);return!!r&&r(10)}),this._hasWater=i(this.renderers,e=>{const r=e.produces.get(19);return!!r&&r(4)})),this.notifyChange("updating"),!0)}addRenderer(){this._sortedRenderers.clear()}removeRenderer(){this._sortedRenderers.clear()}addGeometries(e,r){if(0===e.length)return;const t=this._validateRenderGeometries(e);for(const s of t)this._geometries.set(s.id,s);const i=this._pending.empty;for(const s of t)this._pending.adds.add(s);switch(i&&this.notifyChange("updating"),r){case 0:this._notifyGraphicVisibilityChanged(e);break;case 1:this._notifyGraphicGeometryChanged(e)}}removeGeometries(e,r){if(this.destroyed)return;const t=this._pending.empty,i=this._pending.adds;for(const s of e)i.has(s)?(this._pending.removed.add(s),i.delete(s)):this._pending.removed.has(s)||this._pending.removes.add(s),this._geometries.delete(s.id);t&&!this._pending.empty&&this.notifyChange("updating"),1===r&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,r){const t=0===this._changes.updates.length;for(const i of e){const e=new p;this._changes.updates.push(e),e.renderGeometry=this._ensureValidRenderGeometry(i),e.updateType=r}switch(t&&this._changes.updates.length>0&&this.notifyChange("updating"),r){case 4:case 2:return this._notifyGraphicGeometryChanged(e);case 1:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let r=!1;return this._sortedRenderers.forAll(t=>r=!!t.updateAnimation&&t.updateAnimation(e)||r),r}precompile(e){return this._sortedRenderers.reduce((r,t)=>t.precompile(e)||r,!1)}render(e){this._sortedRenderers.forAll(r=>{const t=r.acquireTechniques(e);t&&r.render(e,t)})}intersectRay(e,r,t,i,s){for(const n of this._geometries.values()){if(!i(n))continue;this._intersectRenderGeometry(n,t,r,0,e,s);const o=this.rendererContext.longitudeCyclical;if(o){const i=n.boundingSphere.center,a=this._effectiveGeometryRadius(n);i[0]-a<o.min&&this._intersectRenderGeometry(n,t,r,o.range,e,s),i[0]+a>o.max&&this._intersectRenderGeometry(n,t,r,-o.range,e,s)}s++}return s}*intersectScreenPolygon(e,r,t,i){for(const s of this._geometries.values()){if(!t(s))continue;this._intersectScreenPolygonRenderGeometry(s,r,0,e,i);const n=this.rendererContext.longitudeCyclical;if(n){const t=s.boundingSphere.center,o=this._effectiveGeometryRadius(s);t[0]-o<n.min&&this._intersectScreenPolygonRenderGeometry(s,r,n.range,e,i),t[0]+o>n.max&&this._intersectScreenPolygonRenderGeometry(s,r,-n.range,e,i)}i++,yield}return i}_effectiveGeometryRadius(e){const r=e.boundingSphere.radius;return r||this._screenToMapUnitsRatio*C}_updateSortedMaterialRenderers(){if(!(this._sortedRenderers.length>0)){for(const e of this.renderers.values())this._sortedRenderers.push(e);this._sortedRenderers.sort((e,r)=>r.material?.renderPriority===e.material?.renderPriority?e.drapedPriority-r.drapedPriority:(r.material?.renderPriority||0)-(e.material?.renderPriority||0))}}_processAddsRemoves(){this._changes.adds.length=0,this._changes.removes.length=0,r(this._changes.adds,Array.from(this._pending.adds)),r(this._changes.removes,Array.from(this._pending.removes)),t(this._changes.updates,({renderGeometry:e})=>!this._pending.has(e)),this._pending.clear()}_intersectRenderGeometry(e,r,t,i,s,n){if(!e.visible||!e.material.visible||!e.material.intersectRayDraped)return;let o=0;0===e.type?(i+=e.transformation[12],o=e.transformation[13]):(i+=e.localOrigin.vec3[0],o=e.localOrigin.vec3[1]),G[0]=t[0]-i,G[1]=t[1]-o,e.material.intersectRayDraped(e,s,G,(t,i,o,a)=>{f(r,a,n,e.material.renderPriority,s,e.layerViewUid,e.graphicUid)},r,this._screenToMapUnitsRatio,this._mapUnitsToGroundRatio)}_intersectScreenPolygonRenderGeometry(e,r,t,i,s){if(!e.visible||!e.material.visible||!e.material.intersectScreenPolygonDraped)return;0===e.type?d(v,t+e.transformation[12],e.transformation[13]):d(v,t+e.localOrigin.vec3[0],e.localOrigin.vec3[1]);const n=this._screenToMapUnitsRatio;for(const o of r){const r=e.material.intersectScreenPolygonDraped(e,v,i,o,n,this._mapUnitsToGroundRatio);if(r)return void R(o.distance,r.primitiveIndex,s,e.material.renderPriority,i,e.layerViewUid,e.graphicUid)}}_notifyGraphicGeometryChanged(e){if(null==this.drapeSource.notifyGraphicGeometryChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicGeometryChanged(t),r=t)}_notifyGraphicVisibilityChanged(e){if(null==this.drapeSource.notifyGraphicVisibilityChanged)return;let r;for(const{graphicUid:t}of e)null!=t&&t!==r&&(this.drapeSource.notifyGraphicVisibilityChanged(t),r=t)}_validateRenderGeometries(e){for(const r of e)this._ensureValidRenderGeometry(r);return e}_ensureValidRenderGeometry(e){return 1===e.type||null==e.localOrigin&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere.center)),e}get test(){}};e([o({constructOnly:!0})],y.prototype,"drapeSource",void 0),e([o({constructOnly:!0})],y.prototype,"rendererContext",void 0),e([o()],y.prototype,"updating",null),e([o()],y.prototype,"rctx",null),e([o()],y.prototype,"_localOriginFactory",null),e([o({readOnly:!0})],y.prototype,"isEmpty",null),e([o()],y.prototype,"_geometries",void 0),y=e([a("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],y);class _{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return 0===this.adds.size&&0===this.removes.size&&0===this.removed.size}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}}function f(e,r,t,i,s,n,o){const a=new c(n,o,r),d=r=>{r.set(5,a,e.distance,e.renderDistance,e.normal,e.transformation,t,i)};if((null==s.results.min.drapedLayerOrder||t>=s.results.min.drapedLayerOrder)&&(null==s.results.min.renderDistance||s.results.ground.renderDistance<=s.results.min.renderDistance)&&d(s.results.min),0!==s.options.store&&(null==s.results.max.drapedLayerOrder||t<s.results.max.drapedLayerOrder)&&(null==s.results.max.renderDistance||s.results.ground.renderDistance>s.results.max.renderDistance)&&d(s.results.max),2===s.options.store){const e=new m(s.ray);d(e),s.results.all.push(e)}}function R(e,r,t,i,s,n,o){s.polygonResults.add(5,new c(n,o,r),e,e,t,i)}const G=h(),v=h(),C=128;export{y as SortedRenderGeometryRenderer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{unique as e}from"../../../../../core/arrayUtils.js";import{estimateNumberArrayMemory as t,baseTypedArrayMemory as r}from"../../../../../core/memoryEstimations.js";import{IntersectorResultRay as s}from"../IntersectorResult.js";import{LodTarget as n}from"./Intersector.js";class i{constructor(e,t,r,s){this.material=e,this.buffer=t,this.numVertices=r,this.boundingInfo=s,this.bufferWriter=e.createBufferWriter()}get layout(){return this.bufferWriter.layout}get numTriangles(){return this.numVertices/3}computeUsedMemory(){return this.buffer.byteLength+r}get renderGeometry(){return this}}class o{constructor(e){this.engineGeometry=e;const t=this.material,r=this.engineGeometry,s=r.attributes,n=r.boundingInfo,o=t.createBufferWriter(),a=o.layout,m=o.elementCount(s),u=a.createBuffer(m);o.write(null,null,s,{buffer:u,offset:0}),this.renderGeometry=new i(t,u.buffer,m,n)}get material(){return this.engineGeometry.material}get numVertices(){return this.engineGeometry.indexCount}get numTriangles(){return this.numVertices/3}get boundingInfo(){return this.engineGeometry.boundingInfo}computeUsedMemory(){return this.engineGeometry.attributes.values().reduce((e,r)=>e+t(r.data,r.indices),0)}intersect(e,t,r,s,n,i,o,m){const u=this.engineGeometry;this.material.intersectRay(u,e.transform.transform,e,r,s,(r,s,u,c)=>a(r,s,u,c,e,t,i,o,n,m))}intersectScreenPolygon(e,t,r,s,i,o){const a=this.engineGeometry,m=this.material.intersectScreenPolygon?.(a,e.transform.transform,e,t);m?.valid&&e.polygonResults.add(3,new n(s.layerViewUid,s.graphicUid(r),m.primitiveIndex,i,o),m.distance)}}function a(e,t,r,i,o,a,m,u,c,l){if(e<0)return;if(a&&!a(o.rayBegin,o.rayEnd,e))return;const h=new n(m.layerViewUid,m.graphicUid(c),i,u,l);if((null==o.results.min.renderDistance||t<o.results.min.renderDistance)&&o.results.min.set(3,h,e,t,r,o.transform.transform),(null==o.results.max.renderDistance||t>o.results.max.renderDistance)&&o.results.max.set(3,h,e,t,r,o.transform.transform),2===o.options.store){const n=new s(o.results.min.ray);n.set(3,h,e,t,r,o.transform.transform),o.results.all.push(n)}}class m{constructor(e,t=null){this.geometry=e,this.textures=t}get material(){return this.geometry.material}get numTriangles(){return this.geometry.numTriangles}}class u{constructor(t,r,s){this.components=t,this.minScreenSpaceRadius=r,this.pivotOffset=s;const n=e(this.components.map(e=>e.geometry));this.numVertices=n.reduce((e,t)=>e+t.numVertices,0)}}class c{constructor(e){this.levels=e,this.levels.sort((e,t)=>e.minScreenSpaceRadius===t.minScreenSpaceRadius?e.numVertices-t.numVertices:e.minScreenSpaceRadius-t.minScreenSpaceRadius)}get materialParameters(){return this.levels[0].components[0].geometry.material.parameters}getMaterials(){const t=[];return this.levels.forEach(e=>e.components.forEach(e=>t.push(e.geometry.material))),e(t)}getTextures(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{null!=e.textures&&t.push(...e.textures)})),e(t)}getGeometries(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{t.push(e.geometry)})),e(t)}getEngineGeometries(){return this.getGeometries().map(e=>e.engineGeometry).filter(e=>null!=e)}computeUsedMemory(){const e=this.getGeometries(),t=this.getTextures(),r=e.reduce((e,t)=>e+t.computeUsedMemory(),0);return t.reduce((e,t)=>e+t.usedMemory,0)+r}}export{o as LodComponentEngineGeometry,i as LodComponentRenderGeometry,m as LodComponentResources,u as LodLevelResources,c as LodResources};
2
+ import{unique as e}from"../../../../../core/arrayUtils.js";import{estimateNumberArrayMemory as t,baseTypedArrayMemory as r}from"../../../../../core/memoryEstimations.js";import{IntersectorResultRay as s}from"../IntersectorResult.js";import{LodTarget as n}from"./Intersector.js";class i{constructor(e,t,r,s){this.material=e,this.buffer=t,this.numVertices=r,this.boundingInfo=s,this.bufferWriter=e.createBufferWriter()}get layout(){return this.bufferWriter.layout}get numTriangles(){return this.numVertices/3}computeUsedMemory(){return this.buffer.byteLength+r}get renderGeometry(){return this}}class o{constructor(e){this.engineGeometry=e;const t=this.material,r=this.engineGeometry,s=r.attributes,n=r.boundingInfo,o=t.createBufferWriter(),a=o.layout,m=o.elementCount(s),u=a.createBuffer(m);o.write(null,null,s,{buffer:u,offset:0}),this.renderGeometry=new i(t,u.buffer,m,n)}get material(){return this.engineGeometry.material}get numVertices(){return this.engineGeometry.indexCount}get numTriangles(){return this.numVertices/3}get boundingInfo(){return this.engineGeometry.boundingInfo}computeUsedMemory(){return this.engineGeometry.attributes.values().reduce((e,r)=>e+t(r.data,r.indices),0)}intersect(e,t,r,s,n,i,o,m){const u=this.engineGeometry;this.material.intersectRay(u,e.transform.transform,e,r,s,(r,s,u,c)=>a(r,s,u,c,e,t,i,o,n,m))}intersectScreenPolygon(e,t,r,s,i,o){const a=this.engineGeometry,m=this.material.intersectScreenPolygon?.(a,e.transform.transform,e,t);m?.valid&&e.polygonResults.add(3,new n(s.layerViewUid,s.graphicUid(r),m.primitiveIndex,i,o),m.distance,m.renderDistance)}}function a(e,t,r,i,o,a,m,u,c,l){if(e<0)return;if(a&&!a(o.rayBegin,o.rayEnd,e))return;const h=new n(m.layerViewUid,m.graphicUid(c),i,u,l);if((null==o.results.min.renderDistance||t<o.results.min.renderDistance)&&o.results.min.set(3,h,e,t,r,o.transform.transform),(null==o.results.max.renderDistance||t>o.results.max.renderDistance)&&o.results.max.set(3,h,e,t,r,o.transform.transform),2===o.options.store){const n=new s(o.results.min.ray);n.set(3,h,e,t,r,o.transform.transform),o.results.all.push(n)}}class m{constructor(e,t=null){this.geometry=e,this.textures=t}get material(){return this.geometry.material}get numTriangles(){return this.geometry.numTriangles}}class u{constructor(t,r,s){this.components=t,this.minScreenSpaceRadius=r,this.pivotOffset=s;const n=e(this.components.map(e=>e.geometry));this.numVertices=n.reduce((e,t)=>e+t.numVertices,0)}}class c{constructor(e){this.levels=e,this.levels.sort((e,t)=>e.minScreenSpaceRadius===t.minScreenSpaceRadius?e.numVertices-t.numVertices:e.minScreenSpaceRadius-t.minScreenSpaceRadius)}get materialParameters(){return this.levels[0].components[0].geometry.material.parameters}getMaterials(){const t=[];return this.levels.forEach(e=>e.components.forEach(e=>t.push(e.geometry.material))),e(t)}getTextures(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{null!=e.textures&&t.push(...e.textures)})),e(t)}getGeometries(){const t=new Array;return this.levels.forEach(e=>e.components.forEach(e=>{t.push(e.geometry)})),e(t)}getEngineGeometries(){return this.getGeometries().map(e=>e.engineGeometry).filter(e=>null!=e)}computeUsedMemory(){const e=this.getGeometries(),t=this.getTextures(),r=e.reduce((e,t)=>e+t.computeUsedMemory(),0);return t.reduce((e,t)=>e+t.usedMemory,0)+r}}export{o as LodComponentEngineGeometry,i as LodComponentRenderGeometry,m as LodComponentResources,u as LodLevelResources,c as LodResources};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../../core/PooledArray.js";import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{distance as r,copy as o,set as i,transformMat4 as n,squaredDistance as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{intersectsTransformedAabb as c}from"../../../../geometry/support/frustumPlanes.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as f,closestPointFromValues as p}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as d}from"./intersectionConstants.js";import{screenPolygonIntersectsTriangle as h}from"./screenPolygonOverlapUtils.js";class I{constructor(t){this.primitiveIndex=t}}class g{constructor(t){this.type=t,this.distance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=l(),this.normal=l()}reset(){this.distance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(t,e,r,i){this.distance=t,this.primitiveIndex=e,o(this.point,r),this.hasNormal=null!=i,null!=i&&o(this.normal,i)}updateIfCloserFromValues(t,e,r,o){t<this.distance&&this.update(t,e,r,o)}updateIfCloser(t){const{distance:e,primitiveIndex:r,point:o,normal:i}=t;this.updateIfCloserFromValues(e,r,o,t.hasNormal?i:null)}get valid(){return Number.isFinite(this.distance)}}function y(t,e,r,o,i){if(!t.visible)return null;const n=new g(4);let s;s=t.boundingInfo?b(t.readPrimitivePosition,t.boundingInfo,e,r,o,i):v(e,r,o,0,t.faceCount,t.readPrimitivePosition,i,null,0);for(const l of s)n.updateIfCloser(l);return n.valid?n:null}function*v(t,e,o,i,n,s,l,a=null,u=0){if(null==t.camera)return;const{camera:c,screenPolygonPrimitiveProcessor:p}=t;for(let d=i;d<n;++d){const t=(a?.[d]??d)+u,i=null==a?t:d,n=3*t;N(F[0],s,n+0,l,i,e),N(F[1],s,n+1,l,i,e),N(F[2],s,n+2,l,i,e);const h=O;let I;A.reset();const g=C;for(const e of p.processTriangle(F))if(g.length=0,m(c.frustum[4],e,()=>g.pushNew(),!1),!(g.length<3)){for(let t=0;t<g.length;t++)c.projectToScreen(g.at(t),V[t]);P(o,V,g.length)&&(j(c.eye,g,w),null==I&&(I=f(O,F[0],F[1],F[2])),A.updateIfCloserFromValues(r(c.eye,w),t,w,I?h:null))}A.valid&&(yield A)}}function*b(t,e,r,o,i,n){let s;if(null!=n?(a(x,e.box),n.applyToAabb(x),s=c(i.broadPhaseFrustum,x,o)):s=c(i.broadPhaseFrustum,e.box,o),!s)return;const{primitiveIndices:l}=e,u=l.length;if(u>d){const s=e.children;if(void 0!==s){for(const e of s)yield*b(t,e,r,o,i,n);return}}yield*v(r,o,i,0,u,t,n,l,0)}function N(t,e,r,o,s,l){const[a,u,c]=e(t,r);null!=o?o.applyToVertex(t,a,u,c,s):i(t,a,u,c),l&&n(t,t,l)}function P(t,e,r){for(let o=1;o<r-1;o++)if(h(t,e[0],e[o],e[o+1]))return!0;return!1}function j(t,e,r){let i=Number.POSITIVE_INFINITY;const n=e.at(0);for(let l=1;l<e.length-1;l++){p(S,t,n,e.at(l),e.at(l+1));const a=s(t,S);a<i&&(i=a,o(r,S))}}const x=u(),T=12,F=[l(),l(),l()],C=new t({allocator:t=>t??l()}),V=Array.from({length:T},()=>e()),w=l(),O=l(),S=l(),A=new g(4);export{I as DrapedHit,g as Hit,v as forEachTriangleRangeScreenPolygonHit,y as intersectTriangleGeometryScreenPolygon};
2
+ import t from"../../../../core/PooledArray.js";import{createScreenPointArray as e}from"../../../../core/screenUtils.js";import{distance as r,copy as o,set as i,transformMat4 as n,squaredDistance as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{copy as a,create as u}from"../../../../geometry/support/aaBoundingBox.js";import{intersectsTransformedAabb as c}from"../../../../geometry/support/frustumPlanes.js";import{clipPolygon as m}from"../../../../geometry/support/plane.js";import{normalFromValues as f,closestPointFromValues as p}from"../../../../geometry/support/triangle.js";import{boundingInfoSubdivisionThreshold as d}from"./intersectionConstants.js";import{screenPolygonIntersectsTriangle as h}from"./screenPolygonOverlapUtils.js";class I{constructor(t){this.primitiveIndex=t}}class g{constructor(t){this.type=t,this.distance=Number.POSITIVE_INFINITY,this.renderDistance=Number.POSITIVE_INFINITY,this.primitiveIndex=0,this.hasNormal=!1,this.point=l(),this.normal=l()}reset(){this.distance=Number.POSITIVE_INFINITY,this.renderDistance=Number.POSITIVE_INFINITY,this.hasNormal=!1}update(t,e,r,i,n=t){this.distance=t,this.renderDistance=n,this.primitiveIndex=e,o(this.point,r),this.hasNormal=null!=i,null!=i&&o(this.normal,i)}updateIfCloserFromValues(t,e,r,o,i=t){i<this.renderDistance&&this.update(t,e,r,o,i)}updateIfCloser(t){const{distance:e,renderDistance:r,primitiveIndex:o,point:i,normal:n}=t;this.updateIfCloserFromValues(e,o,i,t.hasNormal?n:null,r)}get valid(){return Number.isFinite(this.distance)}}function N(t,e,r,o,i){if(!t.visible)return null;const n=new g(4);let s;s=t.boundingInfo?y(t.readPrimitivePosition,t.boundingInfo,e,r,o,i):b(e,r,o,0,t.faceCount,t.readPrimitivePosition,i,null,0);for(const l of s)n.updateIfCloser(l);return n.valid?n:null}function*b(t,e,o,i,n,s,l,a=null,u=0){if(null==t.camera)return;const{camera:c,screenPolygonPrimitiveProcessor:p}=t;for(let d=i;d<n;++d){const t=(a?.[d]??d)+u,i=null==a?t:d,n=3*t;P(F[0],s,n+0,l,i,e),P(F[1],s,n+1,l,i,e),P(F[2],s,n+2,l,i,e);const h=S;let I;E.reset();const g=V;for(const e of p.processTriangle(F))if(g.length=0,m(c.frustum[4],e,()=>g.pushNew(),!1),!(g.length<3)){for(let t=0;t<g.length;t++)c.projectToScreen(g.at(t),C[t]);v(o,C,g.length)&&(T(c.eye,g,O),null==I&&(I=f(S,F[0],F[1],F[2])),E.updateIfCloserFromValues(r(c.eye,O),t,O,I?h:null))}E.valid&&(yield E)}}function*y(t,e,r,o,i,n){let s;if(null!=n?(a(j,e.box),n.applyToAabb(j),s=c(i.broadPhaseFrustum,j,o)):s=c(i.broadPhaseFrustum,e.box,o),!s)return;const{primitiveIndices:l}=e,u=l.length;if(u>d){const s=e.children;if(void 0!==s){for(const e of s)yield*y(t,e,r,o,i,n);return}}yield*b(r,o,i,0,u,t,n,l,0)}function P(t,e,r,o,s,l){const[a,u,c]=e(t,r);null!=o?o.applyToVertex(t,a,u,c,s):i(t,a,u,c),l&&n(t,t,l)}function v(t,e,r){for(let o=1;o<r-1;o++)if(h(t,e[0],e[o],e[o+1]))return!0;return!1}function T(t,e,r){let i=Number.POSITIVE_INFINITY;const n=e.at(0);for(let l=1;l<e.length-1;l++){p(D,t,n,e.at(l),e.at(l+1));const a=s(t,D);a<i&&(i=a,o(r,D))}}const j=u(),x=12,F=[l(),l(),l()],V=new t({allocator:t=>t??l()}),C=Array.from({length:x},()=>e()),O=l(),S=l(),D=l(),E=new g(4);export{I as DrapedHit,g as Hit,b as forEachTriangleRangeScreenPolygonHit,N as intersectTriangleGeometryScreenPolygon};