@ifc-lite/renderer 3.2.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aabb-edges.d.ts +10 -0
- package/dist/aabb-edges.d.ts.map +1 -1
- package/dist/aabb-edges.js +13 -0
- package/dist/aabb-edges.js.map +1 -1
- package/dist/ao-params.d.ts +85 -0
- package/dist/ao-params.d.ts.map +1 -0
- package/dist/ao-params.js +109 -0
- package/dist/ao-params.js.map +1 -0
- package/dist/ao-pass.d.ts +47 -0
- package/dist/ao-pass.d.ts.map +1 -0
- package/dist/ao-pass.js +157 -0
- package/dist/ao-pass.js.map +1 -0
- package/dist/camera-matrices.d.ts +3 -0
- package/dist/camera-matrices.d.ts.map +1 -1
- package/dist/camera-matrices.js +12 -1
- package/dist/camera-matrices.js.map +1 -1
- package/dist/camera-orientation.d.ts +62 -0
- package/dist/camera-orientation.d.ts.map +1 -0
- package/dist/camera-orientation.js +155 -0
- package/dist/camera-orientation.js.map +1 -0
- package/dist/camera-projection.d.ts +3 -1
- package/dist/camera-projection.d.ts.map +1 -1
- package/dist/camera-projection.js +26 -20
- package/dist/camera-projection.js.map +1 -1
- package/dist/camera-surface-zoom.d.ts +32 -0
- package/dist/camera-surface-zoom.d.ts.map +1 -0
- package/dist/camera-surface-zoom.js +37 -0
- package/dist/camera-surface-zoom.js.map +1 -0
- package/dist/camera.d.ts +32 -61
- package/dist/camera.d.ts.map +1 -1
- package/dist/camera.js +71 -167
- package/dist/camera.js.map +1 -1
- package/dist/clash-solid-pipeline.d.ts +9 -3
- package/dist/clash-solid-pipeline.d.ts.map +1 -1
- package/dist/clash-solid-pipeline.js +31 -8
- package/dist/clash-solid-pipeline.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -3
- package/dist/constants.js.map +1 -1
- package/dist/depth-reconstruct.d.ts +43 -0
- package/dist/depth-reconstruct.d.ts.map +1 -0
- package/dist/depth-reconstruct.js +35 -0
- package/dist/depth-reconstruct.js.map +1 -0
- package/dist/device.js +1 -1
- package/dist/device.js.map +1 -1
- package/dist/edge-params.d.ts +43 -0
- package/dist/edge-params.d.ts.map +1 -0
- package/dist/edge-params.js +63 -0
- package/dist/edge-params.js.map +1 -0
- package/dist/edge-pass.d.ts +38 -0
- package/dist/edge-pass.d.ts.map +1 -0
- package/dist/edge-pass.js +111 -0
- package/dist/edge-pass.js.map +1 -0
- package/dist/environment.d.ts +26 -15
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +24 -13
- package/dist/environment.js.map +1 -1
- package/dist/federation-registry.d.ts +16 -0
- package/dist/federation-registry.d.ts.map +1 -1
- package/dist/federation-registry.js +80 -9
- package/dist/federation-registry.js.map +1 -1
- package/dist/gpu-static-upload.d.ts +39 -0
- package/dist/gpu-static-upload.d.ts.map +1 -0
- package/dist/gpu-static-upload.js +70 -0
- package/dist/gpu-static-upload.js.map +1 -0
- package/dist/gpu-upload-guard.d.ts +12 -23
- package/dist/gpu-upload-guard.d.ts.map +1 -1
- package/dist/gpu-upload-guard.js +12 -26
- package/dist/gpu-upload-guard.js.map +1 -1
- package/dist/index.d.ts +58 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +255 -284
- package/dist/index.js.map +1 -1
- package/dist/instanced-render.d.ts +25 -5
- package/dist/instanced-render.d.ts.map +1 -1
- package/dist/instanced-render.js +50 -13
- package/dist/instanced-render.js.map +1 -1
- package/dist/instanced-rte.d.ts +17 -0
- package/dist/instanced-rte.d.ts.map +1 -0
- package/dist/instanced-rte.js +32 -0
- package/dist/instanced-rte.js.map +1 -0
- package/dist/mesh-material.d.ts +26 -0
- package/dist/mesh-material.d.ts.map +1 -0
- package/dist/mesh-material.js +52 -0
- package/dist/mesh-material.js.map +1 -0
- package/dist/mesh-rte-uniforms.d.ts +47 -0
- package/dist/mesh-rte-uniforms.d.ts.map +1 -0
- package/dist/mesh-rte-uniforms.js +60 -0
- package/dist/mesh-rte-uniforms.js.map +1 -0
- package/dist/model-bounds-tracker.d.ts +7 -0
- package/dist/model-bounds-tracker.d.ts.map +1 -1
- package/dist/model-bounds-tracker.js +16 -5
- package/dist/model-bounds-tracker.js.map +1 -1
- package/dist/model-translation.d.ts +1 -1
- package/dist/model-translation.d.ts.map +1 -1
- package/dist/model-translation.js +50 -2
- package/dist/model-translation.js.map +1 -1
- package/dist/overlay-theme-uniforms.d.ts +54 -0
- package/dist/overlay-theme-uniforms.d.ts.map +1 -0
- package/dist/overlay-theme-uniforms.js +89 -0
- package/dist/overlay-theme-uniforms.js.map +1 -0
- package/dist/overlay-theme.d.ts +73 -0
- package/dist/overlay-theme.d.ts.map +1 -0
- package/dist/overlay-theme.js +24 -0
- package/dist/overlay-theme.js.map +1 -0
- package/dist/pick-rte-snapshot.d.ts +7 -0
- package/dist/pick-rte-snapshot.d.ts.map +1 -0
- package/dist/pick-rte-snapshot.js +15 -0
- package/dist/pick-rte-snapshot.js.map +1 -0
- package/dist/pick-types.d.ts +17 -0
- package/dist/pick-types.d.ts.map +1 -0
- package/dist/pick-types.js +5 -0
- package/dist/pick-types.js.map +1 -0
- package/dist/pick-uniforms.d.ts +6 -0
- package/dist/pick-uniforms.d.ts.map +1 -1
- package/dist/pick-uniforms.js +22 -18
- package/dist/pick-uniforms.js.map +1 -1
- package/dist/pick-world-position.d.ts +18 -0
- package/dist/pick-world-position.d.ts.map +1 -0
- package/dist/pick-world-position.js +21 -0
- package/dist/pick-world-position.js.map +1 -0
- package/dist/picker-readbacks.d.ts +6 -0
- package/dist/picker-readbacks.d.ts.map +1 -0
- package/dist/picker-readbacks.js +20 -0
- package/dist/picker-readbacks.js.map +1 -0
- package/dist/picker-rte-uniforms.d.ts +6 -0
- package/dist/picker-rte-uniforms.d.ts.map +1 -0
- package/dist/picker-rte-uniforms.js +41 -0
- package/dist/picker-rte-uniforms.js.map +1 -0
- package/dist/picker.d.ts +6 -7
- package/dist/picker.d.ts.map +1 -1
- package/dist/picker.js +88 -115
- package/dist/picker.js.map +1 -1
- package/dist/picking-manager.d.ts +8 -0
- package/dist/picking-manager.d.ts.map +1 -1
- package/dist/picking-manager.js +46 -19
- package/dist/picking-manager.js.map +1 -1
- package/dist/pipeline.d.ts +3 -7
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +27 -31
- package/dist/pipeline.js.map +1 -1
- package/dist/point-picker.d.ts +5 -1
- package/dist/point-picker.d.ts.map +1 -1
- package/dist/point-picker.js +49 -9
- package/dist/point-picker.js.map +1 -1
- package/dist/pointcloud/point-cloud-handle-ids.d.ts +22 -0
- package/dist/pointcloud/point-cloud-handle-ids.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-handle-ids.js +31 -0
- package/dist/pointcloud/point-cloud-handle-ids.js.map +1 -0
- package/dist/pointcloud/point-cloud-node.d.ts +14 -6
- package/dist/pointcloud/point-cloud-node.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-node.js.map +1 -1
- package/dist/pointcloud/point-cloud-pick-sources.d.ts +47 -0
- package/dist/pointcloud/point-cloud-pick-sources.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-pick-sources.js +32 -0
- package/dist/pointcloud/point-cloud-pick-sources.js.map +1 -0
- package/dist/pointcloud/point-cloud-placement.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-placement.js +20 -5
- package/dist/pointcloud/point-cloud-placement.js.map +1 -1
- package/dist/pointcloud/point-cloud-ray-transform.d.ts +78 -4
- package/dist/pointcloud/point-cloud-ray-transform.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-ray-transform.js +31 -84
- package/dist/pointcloud/point-cloud-ray-transform.js.map +1 -1
- package/dist/pointcloud/point-cloud-renderer.d.ts +21 -19
- package/dist/pointcloud/point-cloud-renderer.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-renderer.js +46 -52
- package/dist/pointcloud/point-cloud-renderer.js.map +1 -1
- package/dist/pointcloud/point-cloud-stream-lifecycle.d.ts +44 -0
- package/dist/pointcloud/point-cloud-stream-lifecycle.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-stream-lifecycle.js +44 -0
- package/dist/pointcloud/point-cloud-stream-lifecycle.js.map +1 -0
- package/dist/pointcloud/point-cloud-uniforms.d.ts +5 -0
- package/dist/pointcloud/point-cloud-uniforms.d.ts.map +1 -1
- package/dist/pointcloud/point-cloud-uniforms.js +55 -44
- package/dist/pointcloud/point-cloud-uniforms.js.map +1 -1
- package/dist/pointcloud/point-cloud-visibility.d.ts +10 -0
- package/dist/pointcloud/point-cloud-visibility.d.ts.map +1 -0
- package/dist/pointcloud/point-cloud-visibility.js +18 -0
- package/dist/pointcloud/point-cloud-visibility.js.map +1 -0
- package/dist/pointcloud/point-pipeline.d.ts +4 -9
- package/dist/pointcloud/point-pipeline.d.ts.map +1 -1
- package/dist/pointcloud/point-pipeline.js +4 -9
- package/dist/pointcloud/point-pipeline.js.map +1 -1
- package/dist/pointcloud/point-shader.wgsl.d.ts +1 -21
- package/dist/pointcloud/point-shader.wgsl.d.ts.map +1 -1
- package/dist/pointcloud/point-shader.wgsl.js +25 -5
- package/dist/pointcloud/point-shader.wgsl.js.map +1 -1
- package/dist/post-pass-chain.d.ts +38 -0
- package/dist/post-pass-chain.d.ts.map +1 -0
- package/dist/post-pass-chain.js +105 -0
- package/dist/post-pass-chain.js.map +1 -0
- package/dist/raycast-engine.d.ts +7 -5
- package/dist/raycast-engine.d.ts.map +1 -1
- package/dist/raycast-engine.js +17 -20
- package/dist/raycast-engine.js.map +1 -1
- package/dist/raycast-point-cloud-query.d.ts +1 -1
- package/dist/raycast-point-cloud-query.d.ts.map +1 -1
- package/dist/reference-image-pipeline.d.ts +1 -1
- package/dist/reference-image-pipeline.d.ts.map +1 -1
- package/dist/reference-image-pipeline.js +25 -7
- package/dist/reference-image-pipeline.js.map +1 -1
- package/dist/reference-images.d.ts +1 -1
- package/dist/reference-images.d.ts.map +1 -1
- package/dist/reference-images.js +13 -5
- package/dist/reference-images.js.map +1 -1
- package/dist/relative-to-eye.d.ts +146 -0
- package/dist/relative-to-eye.d.ts.map +1 -0
- package/dist/relative-to-eye.js +326 -0
- package/dist/relative-to-eye.js.map +1 -0
- package/dist/render-section-draw.d.ts +11 -0
- package/dist/render-section-draw.d.ts.map +1 -1
- package/dist/render-section-draw.js +6 -3
- package/dist/render-section-draw.js.map +1 -1
- package/dist/renderer-color-readback.d.ts +50 -0
- package/dist/renderer-color-readback.d.ts.map +1 -0
- package/dist/renderer-color-readback.js +145 -0
- package/dist/renderer-color-readback.js.map +1 -0
- package/dist/renderer-overlays.d.ts +20 -10
- package/dist/renderer-overlays.d.ts.map +1 -1
- package/dist/renderer-overlays.js +44 -34
- package/dist/renderer-overlays.js.map +1 -1
- package/dist/renderer-screenshot.d.ts +4 -0
- package/dist/renderer-screenshot.d.ts.map +1 -0
- package/dist/renderer-screenshot.js +17 -0
- package/dist/renderer-screenshot.js.map +1 -0
- package/dist/renderer-symbolic-overlays.d.ts +4 -2
- package/dist/renderer-symbolic-overlays.d.ts.map +1 -1
- package/dist/renderer-symbolic-overlays.js +33 -13
- package/dist/renderer-symbolic-overlays.js.map +1 -1
- package/dist/renderer-viewport.d.ts +45 -0
- package/dist/renderer-viewport.d.ts.map +1 -1
- package/dist/renderer-viewport.js +44 -0
- package/dist/renderer-viewport.js.map +1 -1
- package/dist/rte-clip-space.d.ts +12 -0
- package/dist/rte-clip-space.d.ts.map +1 -0
- package/dist/rte-clip-space.js +22 -0
- package/dist/rte-clip-space.js.map +1 -0
- package/dist/rte-frustum.d.ts +24 -0
- package/dist/rte-frustum.d.ts.map +1 -0
- package/dist/rte-frustum.js +45 -0
- package/dist/rte-frustum.js.map +1 -0
- package/dist/scene-batch-upload.d.ts.map +1 -1
- package/dist/scene-batch-upload.js +14 -38
- package/dist/scene-batch-upload.js.map +1 -1
- package/dist/scene-device-recovery.d.ts.map +1 -1
- package/dist/scene-device-recovery.js +5 -9
- package/dist/scene-device-recovery.js.map +1 -1
- package/dist/scene-finalize-regroup.d.ts +54 -0
- package/dist/scene-finalize-regroup.d.ts.map +1 -0
- package/dist/scene-finalize-regroup.js +136 -0
- package/dist/scene-finalize-regroup.js.map +1 -0
- package/dist/scene-instance-bounds.d.ts +12 -0
- package/dist/scene-instance-bounds.d.ts.map +1 -0
- package/dist/scene-instance-bounds.js +48 -0
- package/dist/scene-instance-bounds.js.map +1 -0
- package/dist/scene-instance-materialization.d.ts +4 -1
- package/dist/scene-instance-materialization.d.ts.map +1 -1
- package/dist/scene-instance-materialization.js +21 -6
- package/dist/scene-instance-materialization.js.map +1 -1
- package/dist/scene-instance-translation.d.ts +17 -0
- package/dist/scene-instance-translation.d.ts.map +1 -0
- package/dist/scene-instance-translation.js +50 -0
- package/dist/scene-instance-translation.js.map +1 -0
- package/dist/scene-instance-types.d.ts +6 -0
- package/dist/scene-instance-types.d.ts.map +1 -1
- package/dist/scene-model-translation.d.ts +2 -0
- package/dist/scene-model-translation.d.ts.map +1 -1
- package/dist/scene-model-translation.js +1 -1
- package/dist/scene-model-translation.js.map +1 -1
- package/dist/scene-rect-select.d.ts +11 -1
- package/dist/scene-rect-select.d.ts.map +1 -1
- package/dist/scene-rect-select.js +7 -4
- package/dist/scene-rect-select.js.map +1 -1
- package/dist/scene.d.ts +27 -20
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +109 -238
- package/dist/scene.js.map +1 -1
- package/dist/section-2d-lift.d.ts +10 -2
- package/dist/section-2d-lift.d.ts.map +1 -1
- package/dist/section-2d-lift.js +14 -6
- package/dist/section-2d-lift.js.map +1 -1
- package/dist/section-2d-line-buffer.d.ts +12 -4
- package/dist/section-2d-line-buffer.d.ts.map +1 -1
- package/dist/section-2d-line-buffer.js +59 -33
- package/dist/section-2d-line-buffer.js.map +1 -1
- package/dist/section-2d-overlay.d.ts +18 -72
- package/dist/section-2d-overlay.d.ts.map +1 -1
- package/dist/section-2d-overlay.js +72 -103
- package/dist/section-2d-overlay.js.map +1 -1
- package/dist/section-2d-types.d.ts +38 -0
- package/dist/section-2d-types.d.ts.map +1 -0
- package/dist/section-2d-types.js +6 -0
- package/dist/section-2d-types.js.map +1 -0
- package/dist/section-cap-pipelines.d.ts +6 -0
- package/dist/section-cap-pipelines.d.ts.map +1 -0
- package/dist/section-cap-pipelines.js +87 -0
- package/dist/section-cap-pipelines.js.map +1 -0
- package/dist/section-plane-geometry.d.ts +24 -0
- package/dist/section-plane-geometry.d.ts.map +1 -0
- package/dist/section-plane-geometry.js +93 -0
- package/dist/section-plane-geometry.js.map +1 -0
- package/dist/section-plane.d.ts +26 -24
- package/dist/section-plane.d.ts.map +1 -1
- package/dist/section-plane.js +57 -182
- package/dist/section-plane.js.map +1 -1
- package/dist/shaders/ao.wgsl.d.ts +2 -0
- package/dist/shaders/ao.wgsl.d.ts.map +1 -0
- package/dist/shaders/ao.wgsl.js +234 -0
- package/dist/shaders/ao.wgsl.js.map +1 -0
- package/dist/shaders/color-transfer.wgsl.d.ts +28 -0
- package/dist/shaders/color-transfer.wgsl.d.ts.map +1 -0
- package/dist/shaders/color-transfer.wgsl.js +55 -0
- package/dist/shaders/color-transfer.wgsl.js.map +1 -0
- package/dist/shaders/depth-reconstruct.wgsl.d.ts +16 -0
- package/dist/shaders/depth-reconstruct.wgsl.d.ts.map +1 -0
- package/dist/shaders/depth-reconstruct.wgsl.js +69 -0
- package/dist/shaders/depth-reconstruct.wgsl.js.map +1 -0
- package/dist/shaders/edges.wgsl.d.ts +2 -0
- package/dist/shaders/edges.wgsl.d.ts.map +1 -0
- package/dist/shaders/edges.wgsl.js +158 -0
- package/dist/shaders/edges.wgsl.js.map +1 -0
- package/dist/shaders/main-rte-shadow.wgsl.d.ts +4 -0
- package/dist/shaders/main-rte-shadow.wgsl.d.ts.map +1 -0
- package/dist/shaders/main-rte-shadow.wgsl.js +54 -0
- package/dist/shaders/main-rte-shadow.wgsl.js.map +1 -0
- package/dist/shaders/main.wgsl.d.ts +1 -6
- package/dist/shaders/main.wgsl.d.ts.map +1 -1
- package/dist/shaders/main.wgsl.js +183 -228
- package/dist/shaders/main.wgsl.js.map +1 -1
- package/dist/shaders/relative-to-eye.wgsl.d.ts +12 -0
- package/dist/shaders/relative-to-eye.wgsl.d.ts.map +1 -0
- package/dist/shaders/relative-to-eye.wgsl.js +40 -0
- package/dist/shaders/relative-to-eye.wgsl.js.map +1 -0
- package/dist/shaders/section-2d-overlay.wgsl.d.ts +28 -12
- package/dist/shaders/section-2d-overlay.wgsl.d.ts.map +1 -1
- package/dist/shaders/section-2d-overlay.wgsl.js +40 -13
- package/dist/shaders/section-2d-overlay.wgsl.js.map +1 -1
- package/dist/shaders/shadow.wgsl.d.ts +1 -1
- package/dist/shaders/shadow.wgsl.d.ts.map +1 -1
- package/dist/shaders/shadow.wgsl.js +25 -7
- package/dist/shaders/shadow.wgsl.js.map +1 -1
- package/dist/shaders/sky.wgsl.d.ts +1 -11
- package/dist/shaders/sky.wgsl.d.ts.map +1 -1
- package/dist/shaders/sky.wgsl.js +17 -19
- package/dist/shaders/sky.wgsl.js.map +1 -1
- package/dist/shaders/specular.wgsl.d.ts +34 -0
- package/dist/shaders/specular.wgsl.d.ts.map +1 -0
- package/dist/shaders/specular.wgsl.js +134 -0
- package/dist/shaders/specular.wgsl.js.map +1 -0
- package/dist/shaders/symbolic-overlay.wgsl.d.ts +2 -9
- package/dist/shaders/symbolic-overlay.wgsl.d.ts.map +1 -1
- package/dist/shaders/symbolic-overlay.wgsl.js +88 -17
- package/dist/shaders/symbolic-overlay.wgsl.js.map +1 -1
- package/dist/shaders/textured.wgsl.d.ts.map +1 -1
- package/dist/shaders/textured.wgsl.js +11 -9
- package/dist/shaders/textured.wgsl.js.map +1 -1
- package/dist/shadow-light-matrix.d.ts +7 -0
- package/dist/shadow-light-matrix.d.ts.map +1 -1
- package/dist/shadow-light-matrix.js +11 -0
- package/dist/shadow-light-matrix.js.map +1 -1
- package/dist/shadow-occluder-batches.d.ts +10 -0
- package/dist/shadow-occluder-batches.d.ts.map +1 -0
- package/dist/shadow-occluder-batches.js +39 -0
- package/dist/shadow-occluder-batches.js.map +1 -0
- package/dist/shadow-occluders.d.ts.map +1 -1
- package/dist/shadow-occluders.js +4 -0
- package/dist/shadow-occluders.js.map +1 -1
- package/dist/shadow-pass.d.ts +5 -51
- package/dist/shadow-pass.d.ts.map +1 -1
- package/dist/shadow-pass.js +49 -45
- package/dist/shadow-pass.js.map +1 -1
- package/dist/shadow-types.d.ts +39 -0
- package/dist/shadow-types.d.ts.map +1 -0
- package/dist/shadow-types.js +15 -0
- package/dist/shadow-types.js.map +1 -0
- package/dist/symbolic-overlay-geometry.d.ts +7 -0
- package/dist/symbolic-overlay-geometry.d.ts.map +1 -0
- package/dist/symbolic-overlay-geometry.js +43 -0
- package/dist/symbolic-overlay-geometry.js.map +1 -0
- package/dist/symbolic-overlay-pipelines.d.ts +24 -36
- package/dist/symbolic-overlay-pipelines.d.ts.map +1 -1
- package/dist/symbolic-overlay-pipelines.js +175 -182
- package/dist/symbolic-overlay-pipelines.js.map +1 -1
- package/dist/symbolic-text-atlas.d.ts +21 -0
- package/dist/symbolic-text-atlas.d.ts.map +1 -1
- package/dist/symbolic-text-atlas.js +29 -1
- package/dist/symbolic-text-atlas.js.map +1 -1
- package/dist/types.d.ts +20 -26
- package/dist/types.d.ts.map +1 -1
- package/dist/visual-enhancement.d.ts +30 -1
- package/dist/visual-enhancement.d.ts.map +1 -1
- package/dist/visual-enhancement.js +44 -12
- package/dist/visual-enhancement.js.map +1 -1
- package/package.json +3 -3
- package/dist/post-processor.d.ts +0 -60
- package/dist/post-processor.d.ts.map +0 -1
- package/dist/post-processor.js +0 -353
- package/dist/post-processor.js.map +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Bounded, post-pass color-frame readback used by strict hardware witnesses. */
|
|
2
|
+
/** A central, actual-color crop copied from the presented production color target. */
|
|
3
|
+
export interface RendererColorFrame {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
rgba: Uint8ClampedArray;
|
|
7
|
+
}
|
|
8
|
+
interface ColorFrameCopy {
|
|
9
|
+
buffer: GPUBuffer;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
bytesPerRow: number;
|
|
13
|
+
bgra: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface PendingRendererColorFrame {
|
|
16
|
+
encoded: boolean;
|
|
17
|
+
skippedFrames: number;
|
|
18
|
+
promise: Promise<RendererColorFrame | null>;
|
|
19
|
+
resolve: (frame: RendererColorFrame | null) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface RendererColorFrameCapture {
|
|
22
|
+
pending: PendingRendererColorFrame;
|
|
23
|
+
sourceTexture: GPUTexture;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
format: GPUTextureFormat;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Appends a color copy after every production pass, so the bytes describe the
|
|
30
|
+
* exact submitted frame instead of compositor or scene-residency state.
|
|
31
|
+
*/
|
|
32
|
+
export declare function encodeRendererColorFrameReadback(device: GPUDevice, encoder: GPUCommandEncoder, texture: GPUTexture, frameWidth: number, frameHeight: number, format: GPUTextureFormat): ColorFrameCopy;
|
|
33
|
+
/** Maps and normalizes an encoded color copy. Call only after its command buffer submitted. */
|
|
34
|
+
export declare function resolveRendererColorFrameReadback(copy: ColorFrameCopy): Promise<RendererColorFrame | null>;
|
|
35
|
+
/** Queue one bounded readback for a renderer host, coalescing concurrent callers. */
|
|
36
|
+
export declare function requestRendererColorFrame(host: object, available: boolean, requestRender: () => void): Promise<RendererColorFrame | null>;
|
|
37
|
+
/** Cancels on terminal device loss, render error, or renderer teardown. */
|
|
38
|
+
export declare function cancelRendererColorFrame(host: object): void;
|
|
39
|
+
/** Re-request up to three transient context/resize skips, never an endless frame loop. */
|
|
40
|
+
export declare function retryRendererColorFrame(host: object, requestRender: () => void): void;
|
|
41
|
+
/** Binds one pending request to the copy-capable production canvas texture. */
|
|
42
|
+
export declare function beginRendererColorFrameCapture(host: object, sourceTexture: GPUTexture, width: number, height: number, format: GPUTextureFormat): RendererColorFrameCapture | null;
|
|
43
|
+
/** Encodes a color copy before the frame command buffer is submitted. */
|
|
44
|
+
export declare function encodeRendererColorFrameCapture(device: GPUDevice, encoder: GPUCommandEncoder, capture: RendererColorFrameCapture): ColorFrameCopy;
|
|
45
|
+
/** Settles the requester once its submitted canvas copy maps. */
|
|
46
|
+
export declare function settleRendererColorFrameCapture(host: object, capture: RendererColorFrameCapture, copy: ColorFrameCopy): void;
|
|
47
|
+
/** Frees a copy whose command buffer could not be submitted. */
|
|
48
|
+
export declare function discardRendererColorFrameReadback(copy: ColorFrameCopy | null): void;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=renderer-color-readback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-color-readback.d.ts","sourceRoot":"","sources":["../src/renderer-color-readback.ts"],"names":[],"mappings":"AAIA,iFAAiF;AAEjF,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,yBAAyB,CAAC;IACnC,aAAa,E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Ac,GACnB,IAAI,CAMN;AAED,gEAAgE;AAChE,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAEnF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/** Keep debug/readback work bounded even for a full-screen 8K production viewport. */
|
|
5
|
+
const MAX_COLOR_FRAME_DIMENSION = 512;
|
|
6
|
+
const PIXEL_BYTES = 4;
|
|
7
|
+
const COPY_ROW_ALIGNMENT = 256;
|
|
8
|
+
const MAX_COLOR_FRAME_CAPTURE_SKIPS = 3;
|
|
9
|
+
const pendingCaptures = new WeakMap();
|
|
10
|
+
function captureDimensions(width, height) {
|
|
11
|
+
const capturedWidth = Math.min(width, MAX_COLOR_FRAME_DIMENSION);
|
|
12
|
+
const capturedHeight = Math.min(height, MAX_COLOR_FRAME_DIMENSION);
|
|
13
|
+
return {
|
|
14
|
+
x: Math.floor((width - capturedWidth) / 2),
|
|
15
|
+
y: Math.floor((height - capturedHeight) / 2),
|
|
16
|
+
width: capturedWidth,
|
|
17
|
+
height: capturedHeight,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Appends a color copy after every production pass, so the bytes describe the
|
|
22
|
+
* exact submitted frame instead of compositor or scene-residency state.
|
|
23
|
+
*/
|
|
24
|
+
export function encodeRendererColorFrameReadback(device, encoder, texture, frameWidth, frameHeight, format) {
|
|
25
|
+
const region = captureDimensions(frameWidth, frameHeight);
|
|
26
|
+
const bytesPerRow = Math.ceil((region.width * PIXEL_BYTES) / COPY_ROW_ALIGNMENT) * COPY_ROW_ALIGNMENT;
|
|
27
|
+
const buffer = device.createBuffer({
|
|
28
|
+
size: bytesPerRow * region.height,
|
|
29
|
+
usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ,
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
encoder.copyTextureToBuffer({ texture, origin: { x: region.x, y: region.y, z: 0 } }, { buffer, bytesPerRow, rowsPerImage: region.height }, { width: region.width, height: region.height, depthOrArrayLayers: 1 });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
buffer.destroy();
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
return { buffer, width: region.width, height: region.height, bytesPerRow, bgra: format.startsWith('bgra') };
|
|
39
|
+
}
|
|
40
|
+
/** Maps and normalizes an encoded color copy. Call only after its command buffer submitted. */
|
|
41
|
+
export async function resolveRendererColorFrameReadback(copy) {
|
|
42
|
+
let mapped = false;
|
|
43
|
+
try {
|
|
44
|
+
// GPUMapMode.READ = 1. The package's browser typings intentionally do not
|
|
45
|
+
// require the runtime global to exist in Node-only renderer tests.
|
|
46
|
+
await copy.buffer.mapAsync(1);
|
|
47
|
+
mapped = true;
|
|
48
|
+
const source = new Uint8Array(copy.buffer.getMappedRange());
|
|
49
|
+
const rgba = new Uint8ClampedArray(copy.width * copy.height * PIXEL_BYTES);
|
|
50
|
+
for (let row = 0; row < copy.height; row++)
|
|
51
|
+
for (let column = 0; column < copy.width; column++) {
|
|
52
|
+
const from = row * copy.bytesPerRow + column * PIXEL_BYTES;
|
|
53
|
+
const to = (row * copy.width + column) * PIXEL_BYTES;
|
|
54
|
+
rgba[to] = copy.bgra ? source[from + 2] : source[from];
|
|
55
|
+
rgba[to + 1] = source[from + 1];
|
|
56
|
+
rgba[to + 2] = copy.bgra ? source[from] : source[from + 2];
|
|
57
|
+
rgba[to + 3] = source[from + 3];
|
|
58
|
+
}
|
|
59
|
+
return { width: copy.width, height: copy.height, rgba };
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.warn('[Renderer] Color-frame readback failed:', error);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
if (mapped)
|
|
67
|
+
copy.buffer.unmap();
|
|
68
|
+
copy.buffer.destroy();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Queue one bounded readback for a renderer host, coalescing concurrent callers. */
|
|
72
|
+
export function requestRendererColorFrame(host, available, requestRender) {
|
|
73
|
+
if (!available)
|
|
74
|
+
return Promise.resolve(null);
|
|
75
|
+
const existing = pendingCaptures.get(host);
|
|
76
|
+
if (existing)
|
|
77
|
+
return existing.promise;
|
|
78
|
+
let resolve;
|
|
79
|
+
const promise = new Promise((finish) => { resolve = finish; });
|
|
80
|
+
pendingCaptures.set(host, { encoded: false, skippedFrames: 0, promise, resolve });
|
|
81
|
+
try {
|
|
82
|
+
requestRender();
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
// A synchronous host failure must not strand the coalescing entry: a
|
|
86
|
+
// later caller needs to be able to request a fresh frame.
|
|
87
|
+
pendingCaptures.delete(host);
|
|
88
|
+
resolve(null);
|
|
89
|
+
return Promise.reject(error);
|
|
90
|
+
}
|
|
91
|
+
return promise;
|
|
92
|
+
}
|
|
93
|
+
/** Cancels on terminal device loss, render error, or renderer teardown. */
|
|
94
|
+
export function cancelRendererColorFrame(host) {
|
|
95
|
+
const pending = pendingCaptures.get(host);
|
|
96
|
+
if (!pending)
|
|
97
|
+
return;
|
|
98
|
+
pendingCaptures.delete(host);
|
|
99
|
+
pending.resolve(null);
|
|
100
|
+
}
|
|
101
|
+
/** Re-request up to three transient context/resize skips, never an endless frame loop. */
|
|
102
|
+
export function retryRendererColorFrame(host, requestRender) {
|
|
103
|
+
const pending = pendingCaptures.get(host);
|
|
104
|
+
if (!pending || pending.encoded)
|
|
105
|
+
return;
|
|
106
|
+
if (pending.skippedFrames >= MAX_COLOR_FRAME_CAPTURE_SKIPS) {
|
|
107
|
+
cancelRendererColorFrame(host);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
pending.skippedFrames++;
|
|
111
|
+
requestRender();
|
|
112
|
+
}
|
|
113
|
+
/** Binds one pending request to the copy-capable production canvas texture. */
|
|
114
|
+
export function beginRendererColorFrameCapture(host, sourceTexture, width, height, format) {
|
|
115
|
+
const pending = pendingCaptures.get(host);
|
|
116
|
+
if (!pending || pending.encoded)
|
|
117
|
+
return null;
|
|
118
|
+
return {
|
|
119
|
+
pending,
|
|
120
|
+
sourceTexture,
|
|
121
|
+
width,
|
|
122
|
+
height,
|
|
123
|
+
format,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Encodes a color copy before the frame command buffer is submitted. */
|
|
127
|
+
export function encodeRendererColorFrameCapture(device, encoder, capture) {
|
|
128
|
+
const copy = encodeRendererColorFrameReadback(device, encoder, capture.sourceTexture, capture.width, capture.height, capture.format);
|
|
129
|
+
capture.pending.encoded = true;
|
|
130
|
+
return copy;
|
|
131
|
+
}
|
|
132
|
+
/** Settles the requester once its submitted canvas copy maps. */
|
|
133
|
+
export function settleRendererColorFrameCapture(host, capture, copy) {
|
|
134
|
+
void resolveRendererColorFrameReadback(copy).then((frame) => {
|
|
135
|
+
if (pendingCaptures.get(host) !== capture.pending)
|
|
136
|
+
return;
|
|
137
|
+
pendingCaptures.delete(host);
|
|
138
|
+
capture.pending.resolve(frame);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/** Frees a copy whose command buffer could not be submitted. */
|
|
142
|
+
export function discardRendererColorFrameReadback(copy) {
|
|
143
|
+
copy?.buffer.destroy();
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=renderer-color-readback.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-color-readback.js","sourceRoot":"","sources":["../src/renderer-color-readback.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkC/D,sFAAsF;AACtF,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MA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B,CAAC"}
|
|
@@ -39,12 +39,15 @@
|
|
|
39
39
|
import type { Camera } from './camera.js';
|
|
40
40
|
import { type CutPolygon2D, type DrawingLine2D, type LineOverlayChannel } from './section-2d-overlay.js';
|
|
41
41
|
import type { SymbolicFillInput, SymbolicTextInput } from './symbolic-overlay-pipelines.js';
|
|
42
|
-
import { type ClashSolidInput } from './clash-solid-pipeline.js';
|
|
43
42
|
import { type ModelBounds } from './render-section-draw.js';
|
|
43
|
+
import type { RelativeToEyeFrame } from './relative-to-eye.js';
|
|
44
44
|
import type { RenderOptions } from './types.js';
|
|
45
45
|
import type { DeviceRecoveryOmission } from './device-recovery.js';
|
|
46
|
+
import { type LineVertices } from './section-2d-line-buffer.js';
|
|
47
|
+
import type { OverlayTheme } from './overlay-theme.js';
|
|
48
|
+
import { type ThemedClashSolidInput } from './overlay-theme-uniforms.js';
|
|
46
49
|
/**
|
|
47
|
-
* The slice of `Renderer` the overlays need. Deliberately
|
|
50
|
+
* The slice of `Renderer` the overlays need. Deliberately narrow:
|
|
48
51
|
* the overlays own their GPU objects outright, and borrow only the model-bounds
|
|
49
52
|
* bookkeeping that the rest of the renderer also owns.
|
|
50
53
|
*/
|
|
@@ -53,6 +56,8 @@ export interface OverlayHost {
|
|
|
53
56
|
getModelBounds(): ModelBounds | null;
|
|
54
57
|
/** Grow (or seed) the model AABB from a flat `[x,y,z,...]` buffer. */
|
|
55
58
|
expandModelBoundsWithFlatVertices(positions: Float32Array, stride: number): void;
|
|
59
|
+
/** Fold f32-local overlay vertices through their source f64 anchor. */
|
|
60
|
+
expandModelBoundsWithAnchoredLineVertices(positions: Float32Array, origin: readonly [number, number, number], stride: number): void;
|
|
56
61
|
/** Push the current model AABB to the camera's near/far fit. */
|
|
57
62
|
syncCameraSceneBounds(): void;
|
|
58
63
|
/** Mark the viewport dirty for the next animation frame. */
|
|
@@ -65,14 +70,19 @@ export interface OverlayDrawContext {
|
|
|
65
70
|
/** The bounds this frame resolved the section slider against. */
|
|
66
71
|
modelBounds: ModelBounds | null;
|
|
67
72
|
camera: Camera;
|
|
73
|
+
/** Viewport in CSS px (buffer / `pixelRatio`, see `SectionDrawContext`), as glyph sizes are. */
|
|
68
74
|
canvasWidth: number;
|
|
69
75
|
canvasHeight: number;
|
|
76
|
+
pixelRatio?: number;
|
|
77
|
+
relativeToEyeFrame?: RelativeToEyeFrame;
|
|
78
|
+
rteViewProj?: Float32Array;
|
|
79
|
+
rteCamera?: readonly [number, number, number];
|
|
70
80
|
}
|
|
71
81
|
export declare class RendererOverlays {
|
|
72
82
|
private readonly host;
|
|
73
83
|
private sectionPlaneRenderer;
|
|
74
84
|
private section2DOverlayRenderer;
|
|
75
|
-
private
|
|
85
|
+
private readonly themeApplier;
|
|
76
86
|
private readonly symbolic;
|
|
77
87
|
private clashSolidPipeline;
|
|
78
88
|
constructor(host: OverlayHost);
|
|
@@ -103,26 +113,26 @@ export declare class RendererOverlays {
|
|
|
103
113
|
}): void;
|
|
104
114
|
/** See `Renderer.clearSection2DOverlay` for the published contract. */
|
|
105
115
|
clearSection2DOverlay(): void;
|
|
106
|
-
/** See `Renderer.
|
|
107
|
-
|
|
116
|
+
/** See `Renderer.setOverlayTheme` for the published contract. */
|
|
117
|
+
setTheme(theme: OverlayTheme): void;
|
|
108
118
|
/** See `Renderer.setLineOverlay` for the published contract. */
|
|
109
|
-
setLineOverlay(channel: LineOverlayChannel, vertices:
|
|
119
|
+
setLineOverlay(channel: LineOverlayChannel, vertices: LineVertices | null): void;
|
|
110
120
|
/** See `Renderer.setClashOverlapBox` for the published contract. */
|
|
111
121
|
setClashOverlapBox(box: {
|
|
112
122
|
min: [number, number, number];
|
|
113
123
|
max: [number, number, number];
|
|
114
|
-
color
|
|
124
|
+
color?: [number, number, number, number];
|
|
115
125
|
} | null): void;
|
|
116
126
|
/**
|
|
117
127
|
* See `Renderer.setClashContactLines` for the published contract. Shares the
|
|
118
128
|
* clash-box line buffer, so only one of this / setClashOverlapBox shows.
|
|
119
129
|
*/
|
|
120
130
|
setClashContactLines(lines: {
|
|
121
|
-
vertices:
|
|
122
|
-
color
|
|
131
|
+
vertices: LineVertices;
|
|
132
|
+
color?: [number, number, number, number];
|
|
123
133
|
} | null): void;
|
|
124
134
|
/** See `Renderer.setClashIntersectionSolid` for the published contract. */
|
|
125
|
-
setClashIntersectionSolid(input:
|
|
135
|
+
setClashIntersectionSolid(input: ThemedClashSolidInput | null): void;
|
|
126
136
|
/** See `Renderer.uploadAnnotationFills3D` for the published contract. */
|
|
127
137
|
uploadAnnotationFills3D(fills: readonly SymbolicFillInput[]): void;
|
|
128
138
|
/** See `Renderer.uploadAnnotationTexts3D` for the published contract. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-overlays.d.ts","sourceRoot":"","sources":["../src/renderer-overlays.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAGH,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"renderer-overlays.d.ts","sourceRoot":"","sources":["../src/renderer-overlays.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAGH,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAI5F,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC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,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAKnC,gEAAgE;IAChE,cAAc,CAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI;IA0BhF,oEAAoE;IACpE,kBAAkB,CACd,GAAG,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,GACvH,IAAI;IAYP;;;OAGG;IACH,oBAAoB,CAChB,KAAK,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,GACnF,IAAI;IAYP,2EAA2E;IAC3E,yBAAyB,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI;IAMpE,yEAAyE;IACzE,uBAAuB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI;IAIlE,yEAAyE;IACzE,uBAAuB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI;IAIlE,qEAAqE;IACrE,mBAAmB,IAAI,OAAO;CAGjC"}
|
|
@@ -5,13 +5,15 @@ import { SectionPlaneRenderer } from './section-plane.js';
|
|
|
5
5
|
import { Section2DOverlayRenderer, LINE_OVERLAY_CHANNELS, } from './section-2d-overlay.js';
|
|
6
6
|
import { SymbolicOverlays } from './renderer-symbolic-overlays.js';
|
|
7
7
|
import { ClashSolidPipeline } from './clash-solid-pipeline.js';
|
|
8
|
-
import {
|
|
8
|
+
import { anchoredAabbEdgeLineList } from './aabb-edges.js';
|
|
9
9
|
import { projectedBoundsRange } from './render-section-plane.js';
|
|
10
10
|
import { drawSectionOverlays } from './render-section-draw.js';
|
|
11
|
+
import { lineVertexFloatCount } from './section-2d-line-buffer.js';
|
|
12
|
+
import { OverlayThemeApplier } from './overlay-theme-uniforms.js';
|
|
11
13
|
/**
|
|
12
14
|
* Whether setting a channel grows the scene AABB.
|
|
13
15
|
*
|
|
14
|
-
* The one behavioural difference between the
|
|
16
|
+
* The one behavioural difference between the line-overlay channels, and the reason
|
|
15
17
|
* `setLineOverlay` is a table lookup rather than a plain forward. The
|
|
16
18
|
* per-channel rationale is on `Renderer.setLineOverlay`, which is what
|
|
17
19
|
* consumers read in the emitted `.d.ts`; it is not repeated here.
|
|
@@ -19,30 +21,31 @@ import { drawSectionOverlays } from './render-section-draw.js';
|
|
|
19
21
|
* The rule is "does this content DEFINE the model's extent, so that a file
|
|
20
22
|
* containing only it must still be framable". It is NOT "is it behind a
|
|
21
23
|
* visibility toggle" — annotations sit behind `ifcAnnotationsVisible` too and
|
|
22
|
-
* they DO expand. Anyone adding a
|
|
24
|
+
* they DO expand. Anyone adding a channel should answer the first
|
|
23
25
|
* question, not the second.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
27
|
+
* IfcGrid and IfcAnnotation content used to share one buffer feeding
|
|
28
|
+
* `setLineOverlay('annotation', ...)`, so an annotations-off / grid-on
|
|
29
|
+
* session could reach `annotation` carrying only grid lines and inflate the
|
|
30
|
+
* bounds that `grid: false` exists to protect (#3359). Fixed:
|
|
31
|
+
* `apps/viewer/src/hooks/symbolic-line-channels.ts` keeps the two channels
|
|
32
|
+
* separate and uploads each to its like-named channel, so this table's
|
|
33
|
+
* per-channel keying now matches the content it is keyed by.
|
|
32
34
|
*/
|
|
33
35
|
const CHANNEL_EXPANDS_MODEL_BOUNDS = {
|
|
34
36
|
annotation: true,
|
|
35
37
|
alignment: true,
|
|
36
38
|
grid: false,
|
|
37
39
|
dxf: false,
|
|
40
|
+
// A LandXML source may consist entirely of authored terrain lines.
|
|
41
|
+
terrain: true,
|
|
38
42
|
};
|
|
39
43
|
export class RendererOverlays {
|
|
40
44
|
host;
|
|
41
45
|
sectionPlaneRenderer = null;
|
|
42
46
|
section2DOverlayRenderer = null;
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
overlayLineColor = [0, 0, 0, 1];
|
|
47
|
+
// The overlay theme (#5484) — see overlay-theme-uniforms.ts.
|
|
48
|
+
themeApplier = new OverlayThemeApplier();
|
|
46
49
|
symbolic;
|
|
47
50
|
clashSolidPipeline = null;
|
|
48
51
|
constructor(host) {
|
|
@@ -69,8 +72,8 @@ export class RendererOverlays {
|
|
|
69
72
|
init(device, format, sampleCount) {
|
|
70
73
|
this.sectionPlaneRenderer = new SectionPlaneRenderer(device, format, sampleCount);
|
|
71
74
|
this.section2DOverlayRenderer = new Section2DOverlayRenderer(device, format, sampleCount);
|
|
72
|
-
// Re-apply any
|
|
73
|
-
this.
|
|
75
|
+
// Re-apply any theme set before this (re)creation so it isn't lost.
|
|
76
|
+
this.themeApplier.reapply(this.sectionPlaneRenderer, this.section2DOverlayRenderer);
|
|
74
77
|
this.symbolic.init(device, format, sampleCount);
|
|
75
78
|
this.clashSolidPipeline = new ClashSolidPipeline(device, format, sampleCount);
|
|
76
79
|
}
|
|
@@ -105,19 +108,19 @@ export class RendererOverlays {
|
|
|
105
108
|
//
|
|
106
109
|
// Order: fills (background) → lines (outlines on top) →
|
|
107
110
|
// texts (labels above everything).
|
|
108
|
-
this.symbolic.drawFills(pass, viewProj);
|
|
111
|
+
this.symbolic.drawFills(pass, viewProj, ctx.rteViewProj, ctx.rteCamera);
|
|
109
112
|
// `LINE_OVERLAY_CHANNELS` is in draw order: annotation, alignment,
|
|
110
|
-
// grid, DXF. All
|
|
113
|
+
// grid, DXF, LandXML. All share the overlay colour and the line pipeline,
|
|
111
114
|
// so the order only decides who wins a depth tie.
|
|
112
115
|
const overlay = this.section2DOverlayRenderer;
|
|
113
116
|
if (overlay) {
|
|
114
117
|
for (const channel of LINE_OVERLAY_CHANNELS) {
|
|
115
118
|
if (overlay.hasLineOverlay(channel)) {
|
|
116
|
-
overlay.drawLineOverlay(pass, viewProj, channel);
|
|
119
|
+
overlay.drawLineOverlay(pass, viewProj, channel, ctx.rteViewProj, ctx.rteCamera);
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
if (overlay.hasClashBoxLines3D()) {
|
|
120
|
-
overlay.drawClashBoxLines3D(pass, viewProj);
|
|
123
|
+
overlay.drawClashBoxLines3D(pass, viewProj, ctx.rteViewProj, ctx.rteCamera);
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
// Drawn after the box/contact lines and — crucially — after every
|
|
@@ -125,9 +128,9 @@ export class RendererOverlays {
|
|
|
125
128
|
// overlap volume shows opaque through both ghosted parents rather
|
|
126
129
|
// than being buried inside them.
|
|
127
130
|
if (this.clashSolidPipeline?.hasGeometry()) {
|
|
128
|
-
this.clashSolidPipeline.render(pass, viewProj);
|
|
131
|
+
this.clashSolidPipeline.render(pass, viewProj, ctx.rteViewProj, ctx.rteCamera);
|
|
129
132
|
}
|
|
130
|
-
this.symbolic.drawTexts(pass, viewProj, ctx.canvasWidth, ctx.canvasHeight, camera);
|
|
133
|
+
this.symbolic.drawTexts(pass, viewProj, ctx.canvasWidth, ctx.canvasHeight, camera, ctx.rteViewProj, ctx.rteCamera);
|
|
131
134
|
}
|
|
132
135
|
/** See `Renderer.uploadSection2DOverlay` for the published contract. */
|
|
133
136
|
uploadSection2DOverlay(polygons, lines, axis, position, // 0-100 percentage
|
|
@@ -182,12 +185,9 @@ export class RendererOverlays {
|
|
|
182
185
|
this.host.requestRender();
|
|
183
186
|
}
|
|
184
187
|
}
|
|
185
|
-
/** See `Renderer.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
// re-creation) keeps the colour — init() re-applies this.overlayLineColor.
|
|
189
|
-
this.overlayLineColor = color;
|
|
190
|
-
this.section2DOverlayRenderer?.setOverlayLineColor(color);
|
|
188
|
+
/** See `Renderer.setOverlayTheme` for the published contract. */
|
|
189
|
+
setTheme(theme) {
|
|
190
|
+
this.themeApplier.set(theme, this.sectionPlaneRenderer, this.section2DOverlayRenderer, this.clashSolidPipeline);
|
|
191
191
|
this.host.requestRender();
|
|
192
192
|
}
|
|
193
193
|
/** See `Renderer.setLineOverlay` for the published contract. */
|
|
@@ -195,12 +195,22 @@ export class RendererOverlays {
|
|
|
195
195
|
if (!this.section2DOverlayRenderer)
|
|
196
196
|
return;
|
|
197
197
|
this.section2DOverlayRenderer.setLineOverlay(channel, vertices);
|
|
198
|
-
if (
|
|
198
|
+
if (CHANNEL_EXPANDS_MODEL_BOUNDS[channel] && vertices) {
|
|
199
199
|
// Mirrors the point-cloud upload path (`addPointClouds`,
|
|
200
200
|
// `setPointClouds`): without `syncCameraSceneBounds` the frustum
|
|
201
201
|
// excludes the cluster and it is clipped away even when the camera
|
|
202
202
|
// points straight at it. See CHANNEL_EXPANDS_MODEL_BOUNDS.
|
|
203
|
-
|
|
203
|
+
if (vertices instanceof Float32Array) {
|
|
204
|
+
this.host.expandModelBoundsWithFlatVertices(vertices, 3);
|
|
205
|
+
}
|
|
206
|
+
else if ('localVertices' in vertices) {
|
|
207
|
+
this.host.expandModelBoundsWithAnchoredLineVertices(vertices.localVertices, vertices.origin, 3);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
for (const partition of vertices) {
|
|
211
|
+
this.host.expandModelBoundsWithAnchoredLineVertices(partition.localVertices, partition.origin, 3);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
204
214
|
this.host.syncCameraSceneBounds();
|
|
205
215
|
}
|
|
206
216
|
// Rendering is dirty-flag gated (#2442): a channel that changed has to
|
|
@@ -218,8 +228,8 @@ export class RendererOverlays {
|
|
|
218
228
|
this.host.requestRender();
|
|
219
229
|
return;
|
|
220
230
|
}
|
|
221
|
-
this.section2DOverlayRenderer.setClashBoxLineColor(box.color);
|
|
222
|
-
this.section2DOverlayRenderer.uploadClashBoxLines3D(
|
|
231
|
+
this.section2DOverlayRenderer.setClashBoxLineColor(this.themeApplier.clashLineColor(box.color));
|
|
232
|
+
this.section2DOverlayRenderer.uploadClashBoxLines3D(anchoredAabbEdgeLineList(box.min, box.max));
|
|
223
233
|
this.host.requestRender();
|
|
224
234
|
}
|
|
225
235
|
/**
|
|
@@ -229,12 +239,12 @@ export class RendererOverlays {
|
|
|
229
239
|
setClashContactLines(lines) {
|
|
230
240
|
if (!this.section2DOverlayRenderer)
|
|
231
241
|
return;
|
|
232
|
-
if (!lines || lines.vertices
|
|
242
|
+
if (!lines || lineVertexFloatCount(lines.vertices) === 0) {
|
|
233
243
|
this.section2DOverlayRenderer.clearClashBoxLines3D();
|
|
234
244
|
this.host.requestRender();
|
|
235
245
|
return;
|
|
236
246
|
}
|
|
237
|
-
this.section2DOverlayRenderer.setClashBoxLineColor(lines.color);
|
|
247
|
+
this.section2DOverlayRenderer.setClashBoxLineColor(this.themeApplier.clashLineColor(lines.color));
|
|
238
248
|
this.section2DOverlayRenderer.uploadClashBoxLines3D(lines.vertices);
|
|
239
249
|
this.host.requestRender();
|
|
240
250
|
}
|
|
@@ -242,7 +252,7 @@ export class RendererOverlays {
|
|
|
242
252
|
setClashIntersectionSolid(input) {
|
|
243
253
|
if (!this.clashSolidPipeline)
|
|
244
254
|
return;
|
|
245
|
-
this.clashSolidPipeline.upload(input);
|
|
255
|
+
this.clashSolidPipeline.upload(this.themeApplier.clashSolid(input));
|
|
246
256
|
this.host.requestRender();
|
|
247
257
|
}
|
|
248
258
|
/** See `Renderer.uploadAnnotationFills3D` for the published contract. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-overlays.js","sourceRoot":"","sources":["../src/renderer-overlays.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA0C/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,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AC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAClG,IAAI,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,2EAA2E;IAC3E,yBAAyB,CAAC,KAAmC;QACzD,IAAI,CAAC,IAAI,CAAC,kBAAkB;YAAE,OAAO;QACrC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED,yEAAyE;IACzE,uBAAuB,CAAC,KAAmC;QACvD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,yEAAyE;IACzE,uBAAuB,CAAC,KAAmC;QACvD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,qEAAqE;IACrE,mBAAmB;QACf,OAAO,IAAI,CAAC,wBAAwB,EAAE,WAAW,EAAE,IAAI,KAAK,CAAC;IACjE,CAAC;CACJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WebGPUDevice } from './device.js';
|
|
2
|
+
/** Capture a fully submitted presentation canvas, reporting expected device failures. */
|
|
3
|
+
export declare function captureRendererScreenshot(deviceHost: WebGPUDevice, canvas: HTMLCanvasElement): Promise<string | null>;
|
|
4
|
+
//# sourceMappingURL=renderer-screenshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-screenshot.d.ts","sourceRoot":"","sources":["../src/renderer-screenshot.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,yFAAyF;AACzF,wBAAsB,yBAAyB,CAAC,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS3H"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/** Capture a fully submitted presentation canvas, reporting expected device failures. */
|
|
5
|
+
export async function captureRendererScreenshot(deviceHost, canvas) {
|
|
6
|
+
if (!deviceHost.isInitialized())
|
|
7
|
+
return null;
|
|
8
|
+
try {
|
|
9
|
+
await deviceHost.getDevice().queue.onSubmittedWorkDone();
|
|
10
|
+
return canvas.toDataURL('image/png');
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
console.error('[Renderer] Screenshot capture failed:', error);
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=renderer-screenshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-screenshot.js","sourceRoot":"","sources":["../src/renderer-screenshot.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAI/D,yFAAyF;AACzF,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,UAAwB,EAAE,MAAyB;IACjG,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;QAAE,OAAO,IAAI,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC;QACzD,OAAO,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -19,6 +19,8 @@ import { type SymbolicFillInput, type SymbolicTextInput } from './symbolic-overl
|
|
|
19
19
|
*/
|
|
20
20
|
export interface SymbolicOverlayHost {
|
|
21
21
|
expandModelBoundsWithFlatVertices(positions: Float32Array, stride: number): void;
|
|
22
|
+
/** Fold f32-local symbolic data through its f64 RTE anchor. */
|
|
23
|
+
expandModelBoundsWithAnchoredLineVertices(positions: Float32Array, origin: readonly [number, number, number], stride: number): void;
|
|
22
24
|
syncCameraSceneBounds(): void;
|
|
23
25
|
requestRender(): void;
|
|
24
26
|
}
|
|
@@ -42,9 +44,9 @@ export declare class SymbolicOverlays {
|
|
|
42
44
|
*/
|
|
43
45
|
destroy(): void;
|
|
44
46
|
/** Background layer: painted before the 3D line overlays. */
|
|
45
|
-
drawFills(pass: GPURenderPassEncoder, viewProj: Float32Array): void;
|
|
47
|
+
drawFills(pass: GPURenderPassEncoder, viewProj: Float32Array, rteViewProj?: Float32Array, rteCamera?: readonly [number, number, number]): void;
|
|
46
48
|
/** Label layer: painted after everything else. */
|
|
47
|
-
drawTexts(pass: GPURenderPassEncoder, viewProj: Float32Array, canvasWidth: number, canvasHeight: number, camera: Camera): void;
|
|
49
|
+
drawTexts(pass: GPURenderPassEncoder, viewProj: Float32Array, canvasWidth: number, canvasHeight: number, camera: Camera, rteViewProj?: Float32Array, rteCamera?: readonly [number, number, number]): void;
|
|
48
50
|
/**
|
|
49
51
|
* See `Renderer.uploadAnnotationFills3D` for the published contract.
|
|
50
52
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer-symbolic-overlays.d.ts","sourceRoot":"","sources":["../src/renderer-symbolic-overlays.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACzB,MAAM,iCAAiC,CAAC;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