@luma.gl/engine 10.0.0-alpha.9 → 10.0.0-beta.2
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/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +185 -0
- package/dist/animation/deform-positions.d.ts +1 -1
- package/dist/animation/deform-positions.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.cjs +10 -0
- package/dist/animation/node-animation-binding.d.ts +1 -1
- package/dist/animation/node-animation-binding.d.ts.map +1 -1
- package/dist/animation/node-animation-binding.js +10 -0
- package/dist/animation/node-animation-binding.js.map +1 -1
- package/dist/animation/skin.cjs +4 -4
- package/dist/animation/skin.d.ts +1 -1
- package/dist/animation/skin.d.ts.map +1 -1
- package/dist/animation/skin.js +1 -1
- package/dist/animation/skin.js.map +1 -1
- package/dist/animation/texture-transform.cjs +7 -7
- package/dist/animation/texture-transform.js +1 -1
- package/dist/animation/texture-transform.js.map +1 -1
- package/dist/arrow/arrow-mesh-types.d.ts +1 -1
- package/dist/arrow/arrow-mesh-types.d.ts.map +1 -1
- package/dist/arrow/index.cjs.map +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.cjs +2 -2
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.d.ts +1 -1
- package/dist/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.js +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.cjs +14 -15
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.d.ts.map +1 -1
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js +23 -18
- package/dist/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.js.map +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.cjs +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js +1 -1
- package/dist/arrow/renderers/text/renderers/arrow-text-shaders.js.map +1 -1
- package/dist/audio/audio-controller.cjs +6 -6
- package/dist/audio/audio-controller.d.ts +1 -1
- package/dist/audio/audio-controller.d.ts.map +1 -1
- package/dist/audio/audio-controller.js +1 -1
- package/dist/audio/audio-controller.js.map +1 -1
- package/dist/audio/audio-environment.cjs +6 -6
- package/dist/audio/audio-environment.d.ts +1 -1
- package/dist/audio/audio-environment.d.ts.map +1 -1
- package/dist/audio/audio-environment.js +1 -1
- package/dist/audio/audio-environment.js.map +1 -1
- package/dist/compute/computation.cjs +1 -1
- package/dist/compute/computation.d.ts +1 -1
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +1 -1
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/swap.d.ts +2 -2
- package/dist/compute/swap.d.ts.map +1 -1
- package/dist/compute/swap.js.map +1 -1
- package/dist/debug/pixel-data-utils.d.ts +1 -1
- package/dist/debug/pixel-data-utils.d.ts.map +1 -1
- package/dist/dist.dev.js +1087 -570
- package/dist/dist.min.js +74 -67
- package/dist/dynamic-texture/video-texture.cjs +1 -1
- package/dist/dynamic-texture/video-texture.d.ts +3 -3
- package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/video-texture.js +1 -1
- package/dist/dynamic-texture/video-texture.js.map +1 -1
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js +2 -1
- package/dist/effects/passes/postprocessing/fxaa/fxaa.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/denoise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/huesaturation.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/noise.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/sepia.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vibrance.js.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.d.ts.map +1 -1
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js +2 -0
- package/dist/effects/passes/postprocessing/image-adjust-filters/vignette.js.map +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts +1 -1
- package/dist/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts +1 -1
- package/dist/effects/passes/screen-space/clustered-volumetric-lighting.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.cjs +4 -4
- package/dist/effects/passes/screen-space/gtao.d.ts +1 -1
- package/dist/effects/passes/screen-space/gtao.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/gtao.js +1 -1
- package/dist/effects/passes/screen-space/gtao.js.map +1 -1
- package/dist/effects/passes/screen-space/height-fog.d.ts +1 -1
- package/dist/effects/passes/screen-space/height-fog.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts +1 -1
- package/dist/effects/passes/screen-space/screen-space-global-illumination.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts +1 -1
- package/dist/effects/passes/screen-space/screen-space-reflections.d.ts.map +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts +1 -1
- package/dist/effects/passes/screen-space/ssr-camera-temporal.d.ts.map +1 -1
- package/dist/experimental/controls/index.cjs +0 -3
- package/dist/experimental/controls/index.cjs.map +2 -2
- package/dist/experimental/controls/index.d.ts +0 -2
- package/dist/experimental/controls/index.d.ts.map +1 -1
- package/dist/experimental/controls/index.js +0 -1
- package/dist/experimental/controls/index.js.map +1 -1
- package/dist/experimental/webxr/webxr-input.d.ts +1 -1
- package/dist/experimental/webxr/webxr-input.d.ts.map +1 -1
- package/dist/experimental-controls.cjs +21 -0
- package/dist/experimental-controls.d.ts +2 -0
- package/dist/experimental-controls.d.ts.map +1 -0
- package/dist/experimental-controls.js +5 -0
- package/dist/experimental-controls.js.map +1 -0
- package/dist/experimental-materials.cjs +21 -0
- package/dist/experimental-materials.d.ts +2 -0
- package/dist/experimental-materials.d.ts.map +1 -0
- package/dist/experimental-materials.js +5 -0
- package/dist/experimental-materials.js.map +1 -0
- package/dist/experimental-textures.cjs +21 -0
- package/dist/experimental-textures.d.ts +2 -0
- package/dist/experimental-textures.d.ts.map +1 -0
- package/dist/experimental-textures.js +5 -0
- package/dist/experimental-textures.js.map +1 -0
- package/dist/{experimental/controls/orbit-controls.cjs → experimental-webxr.cjs} +5 -11
- package/dist/experimental-webxr.d.ts +2 -0
- package/dist/experimental-webxr.d.ts.map +1 -0
- package/dist/experimental-webxr.js +5 -0
- package/dist/experimental-webxr.js.map +1 -0
- package/dist/geometry/edge-geometry.d.ts +1 -1
- package/dist/geometry/edge-geometry.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.cjs +18 -17
- package/dist/geometry/geometry-primitives.d.ts +2 -2
- package/dist/geometry/geometry-primitives.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.js +3 -2
- package/dist/geometry/geometry-primitives.js.map +1 -1
- package/dist/geometry/geometry-table.d.ts +1 -1
- package/dist/geometry/geometry-table.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.cjs +6 -6
- package/dist/geometry/geometry-utils.d.ts +2 -2
- package/dist/geometry/geometry-utils.d.ts.map +1 -1
- package/dist/geometry/geometry-utils.js +1 -1
- package/dist/geometry/geometry-utils.js.map +1 -1
- package/dist/geometry/geometry.cjs +2 -2
- package/dist/geometry/geometry.d.ts +4 -3
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +1 -1
- package/dist/geometry/geometry.js.map +1 -1
- package/dist/geometry/gpu-geometry.d.ts +1 -1
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts +1 -1
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -1
- package/dist/geometry/ring-geometry.cjs +6 -6
- package/dist/geometry/ring-geometry.d.ts +1 -1
- package/dist/geometry/ring-geometry.d.ts.map +1 -1
- package/dist/geometry/ring-geometry.js +2 -2
- package/dist/geometry/ring-geometry.js.map +1 -1
- package/dist/gltf/gltf/animations/animations.d.ts +1 -1
- package/dist/gltf/gltf/animations/animations.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.cjs +3 -0
- package/dist/gltf/gltf/create-gltf-model.d.ts +1 -1
- package/dist/gltf/gltf/create-gltf-model.d.ts.map +1 -1
- package/dist/gltf/gltf/create-gltf-model.js +4 -0
- package/dist/gltf/gltf/create-gltf-model.js.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.cjs +80 -12
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts +8 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.d.ts.map +1 -1
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js +82 -14
- package/dist/gltf/gltf/create-scenegraph-from-gltf.js.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts +2 -1
- package/dist/gltf/gltf/gltf-animated-crowd.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-animated-crowd.js.map +1 -1
- package/dist/gltf/gltf/gltf-billboard.cjs +6 -1
- package/dist/gltf/gltf/gltf-billboard.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-billboard.js +6 -1
- package/dist/gltf/gltf/gltf-billboard.js.map +1 -1
- package/dist/gltf/gltf/gltf-extension-support.cjs +2 -2
- package/dist/gltf/gltf/gltf-extension-support.js +2 -2
- package/dist/gltf/gltf/gltf-extension-support.js.map +1 -1
- package/dist/gltf/gltf/gltf-instancing.cjs +2 -2
- package/dist/gltf/gltf/gltf-instancing.d.ts +1 -1
- package/dist/gltf/gltf/gltf-instancing.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-instancing.js +1 -1
- package/dist/gltf/gltf/gltf-instancing.js.map +1 -1
- package/dist/gltf/gltf/gltf-lightmap.cjs +2 -2
- package/dist/gltf/gltf/gltf-lightmap.d.ts +1 -1
- package/dist/gltf/gltf/gltf-lightmap.d.ts.map +1 -1
- package/dist/gltf/gltf/gltf-lightmap.js +1 -1
- package/dist/gltf/gltf/gltf-lightmap.js.map +1 -1
- package/dist/gltf/index.cjs +2 -0
- package/dist/gltf/index.cjs.map +3 -3
- package/dist/gltf/index.d.ts +1 -1
- package/dist/gltf/index.d.ts.map +1 -1
- package/dist/gltf/index.js +1 -1
- package/dist/gltf/index.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-animations.cjs +8 -5
- package/dist/gltf/parsers/parse-gltf-animations.js +20 -5
- package/dist/gltf/parsers/parse-gltf-animations.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.cjs +41 -77
- package/dist/gltf/parsers/parse-gltf-lights.d.ts +6 -2
- package/dist/gltf/parsers/parse-gltf-lights.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf-lights.js +35 -92
- package/dist/gltf/parsers/parse-gltf-lights.js.map +1 -1
- package/dist/gltf/parsers/parse-gltf-metadata.cjs +60 -0
- package/dist/gltf/parsers/parse-gltf-metadata.d.ts +5 -0
- package/dist/gltf/parsers/parse-gltf-metadata.d.ts.map +1 -0
- package/dist/gltf/parsers/parse-gltf-metadata.js +39 -0
- package/dist/gltf/parsers/parse-gltf-metadata.js.map +1 -0
- package/dist/gltf/parsers/parse-gltf.cjs +4 -1
- package/dist/gltf/parsers/parse-gltf.d.ts +10 -2
- package/dist/gltf/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-gltf.js +3 -0
- package/dist/gltf/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.cjs +40 -30
- package/dist/gltf/parsers/parse-pbr-material.d.ts +7 -2
- package/dist/gltf/parsers/parse-pbr-material.d.ts.map +1 -1
- package/dist/gltf/parsers/parse-pbr-material.js +18 -6
- package/dist/gltf/parsers/parse-pbr-material.js.map +1 -1
- package/dist/gltf/pbr/pbr-environment.cjs +21 -3
- package/dist/gltf/pbr/pbr-environment.d.ts +3 -0
- package/dist/gltf/pbr/pbr-environment.d.ts.map +1 -1
- package/dist/gltf/pbr/pbr-environment.js +19 -1
- package/dist/gltf/pbr/pbr-environment.js.map +1 -1
- package/dist/gltf/pbr/pbr-material.d.ts +3 -3
- package/dist/gltf/pbr/pbr-material.d.ts.map +1 -1
- package/dist/gltf/physics/export-state.cjs +8 -8
- package/dist/gltf/physics/export-state.js +1 -1
- package/dist/gltf/physics/export-state.js.map +1 -1
- package/dist/gltf/physics/index.cjs.map +2 -2
- package/dist/gltf/physics/mesh-snapshot.cjs +3 -3
- package/dist/gltf/physics/mesh-snapshot.js +1 -1
- package/dist/gltf/physics/mesh-snapshot.js.map +1 -1
- package/dist/gltf/physics/node-collision-geometry.cjs +3 -3
- package/dist/gltf/physics/node-collision-geometry.js +1 -1
- package/dist/gltf/physics/node-collision-geometry.js.map +1 -1
- package/dist/gltf/physics/parse-gltf-physics.cjs +10 -10
- package/dist/gltf/physics/parse-gltf-physics.js +1 -1
- package/dist/gltf/physics/parse-gltf-physics.js.map +1 -1
- package/dist/gltf/physics/parse-physics-joints.cjs +3 -3
- package/dist/gltf/physics/parse-physics-joints.d.ts +1 -1
- package/dist/gltf/physics/parse-physics-joints.d.ts.map +1 -1
- package/dist/gltf/physics/parse-physics-joints.js +1 -1
- package/dist/gltf/physics/parse-physics-joints.js.map +1 -1
- package/dist/gltf/physics/property-bindings.cjs +4 -4
- package/dist/gltf/physics/property-bindings.js +1 -1
- package/dist/gltf/physics/property-bindings.js.map +1 -1
- package/dist/gltf/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-json-schema.js +1 -0
- package/dist/gltf/types/gltf-json-schema.js.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.d.ts.map +1 -1
- package/dist/gltf/types/gltf-postprocessed-schema.js +1 -0
- package/dist/gltf/types/gltf-postprocessed-schema.js.map +1 -1
- package/dist/graph/models/index.cjs.map +2 -2
- package/dist/graph/models/path/path-attribute-model.cjs +4 -1
- package/dist/graph/models/path/path-attribute-model.d.ts +3 -1
- package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-attribute-model.js +6 -1
- package/dist/graph/models/path/path-attribute-model.js.map +1 -1
- package/dist/graph/models/path/path-storage-model.cjs +12 -9
- package/dist/graph/models/path/path-storage-model.d.ts +4 -2
- package/dist/graph/models/path/path-storage-model.d.ts.map +1 -1
- package/dist/graph/models/path/path-storage-model.js +8 -3
- package/dist/graph/models/path/path-storage-model.js.map +1 -1
- package/dist/graph/models/polygon/polygon-attribute-model.cjs +4 -4
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-attribute-model.js +1 -1
- package/dist/graph/models/polygon/polygon-shaders.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-storage-model.cjs +4 -4
- package/dist/graph/models/polygon/polygon-storage-model.d.ts +1 -1
- package/dist/graph/models/polygon/polygon-storage-model.js +1 -1
- package/dist/graph/physics/index.cjs.map +2 -2
- package/dist/graph/physics/index.d.ts +1 -1
- package/dist/graph/physics/index.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller-geometry.cjs +8 -8
- package/dist/graph/physics/physics-controller-geometry.js +2 -2
- package/dist/graph/physics/physics-controller-geometry.js.map +1 -1
- package/dist/graph/physics/physics-controller.cjs +106 -0
- package/dist/graph/physics/physics-controller.d.ts +41 -3
- package/dist/graph/physics/physics-controller.d.ts.map +1 -1
- package/dist/graph/physics/physics-controller.js +106 -0
- package/dist/graph/physics/physics-controller.js.map +1 -1
- package/dist/graph/physics/physics-scenegraph.cjs +4 -4
- package/dist/graph/physics/physics-scenegraph.d.ts +1 -1
- package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -1
- package/dist/graph/physics/physics-scenegraph.js +1 -1
- package/dist/graph/physics/physics-scenegraph.js.map +1 -1
- package/dist/graph/physics/scenegraph-instance.cjs +16 -2
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-instance.js +17 -1
- package/dist/graph/physics/scenegraph-instance.js.map +1 -1
- package/dist/graph/physics/scenegraph-motion.cjs +7 -7
- package/dist/graph/physics/scenegraph-motion.d.ts +1 -1
- package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-motion.js +1 -1
- package/dist/graph/physics/scenegraph-motion.js.map +1 -1
- package/dist/graph/physics/scenegraph-properties.cjs +3 -3
- package/dist/graph/physics/scenegraph-properties.js +1 -1
- package/dist/graph/physics/scenegraph-properties.js.map +1 -1
- package/dist/graph/physics/scenegraph-publication.cjs +5 -5
- package/dist/graph/physics/scenegraph-publication.d.ts +1 -1
- package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -1
- package/dist/graph/physics/scenegraph-publication.js +1 -1
- package/dist/graph/physics/scenegraph-publication.js.map +1 -1
- package/dist/graph/tables/gpu-table-model.cjs +2 -2
- package/dist/graph/tables/gpu-table-model.d.ts +2 -1
- package/dist/graph/tables/gpu-table-model.d.ts.map +1 -1
- package/dist/graph/tables/gpu-table-model.js +2 -2
- package/dist/graph/tables/gpu-table-model.js.map +1 -1
- package/dist/graph/tables/index.cjs.map +2 -2
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lighting/ambient-occlusion-pass.cjs +126 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts +32 -0
- package/dist/lighting/ambient-occlusion-pass.d.ts.map +1 -0
- package/dist/lighting/ambient-occlusion-pass.js +108 -0
- package/dist/lighting/ambient-occlusion-pass.js.map +1 -0
- package/dist/lighting/clustered-light-grid.cjs +378 -0
- package/dist/lighting/clustered-light-grid.d.ts +94 -0
- package/dist/lighting/clustered-light-grid.d.ts.map +1 -0
- package/dist/lighting/clustered-light-grid.js +370 -0
- package/dist/lighting/clustered-light-grid.js.map +1 -0
- package/dist/lighting/contact-shadow-composite.cjs +80 -0
- package/dist/lighting/contact-shadow-composite.d.ts +6 -0
- package/dist/lighting/contact-shadow-composite.d.ts.map +1 -0
- package/dist/lighting/contact-shadow-composite.js +59 -0
- package/dist/lighting/contact-shadow-composite.js.map +1 -0
- package/dist/lighting/contact-shadow-pass.cjs +102 -0
- package/dist/lighting/contact-shadow-pass.d.ts +24 -0
- package/dist/lighting/contact-shadow-pass.d.ts.map +1 -0
- package/dist/lighting/contact-shadow-pass.js +85 -0
- package/dist/lighting/contact-shadow-pass.js.map +1 -0
- package/dist/lighting/index.cjs +128 -0
- package/dist/lighting/index.cjs.map +6 -0
- package/dist/lighting/index.d.ts +35 -0
- package/dist/lighting/index.d.ts.map +1 -0
- package/dist/lighting/index.js +22 -0
- package/dist/lighting/index.js.map +1 -0
- package/dist/lighting/lightmap-atlas.cjs +246 -0
- package/dist/lighting/lightmap-atlas.d.ts +53 -0
- package/dist/lighting/lightmap-atlas.d.ts.map +1 -0
- package/dist/lighting/lightmap-atlas.js +279 -0
- package/dist/lighting/lightmap-atlas.js.map +1 -0
- package/dist/lighting/lightmap-baker.cjs +238 -0
- package/dist/lighting/lightmap-baker.d.ts +62 -0
- package/dist/lighting/lightmap-baker.d.ts.map +1 -0
- package/dist/lighting/lightmap-baker.js +236 -0
- package/dist/lighting/lightmap-baker.js.map +1 -0
- package/dist/lighting/lightmap-data.cjs +117 -0
- package/dist/lighting/lightmap-data.d.ts +20 -0
- package/dist/lighting/lightmap-data.d.ts.map +1 -0
- package/dist/lighting/lightmap-data.js +110 -0
- package/dist/lighting/lightmap-data.js.map +1 -0
- package/dist/lighting/lightmap-environment.cjs +61 -0
- package/dist/lighting/lightmap-environment.d.ts +18 -0
- package/dist/lighting/lightmap-environment.d.ts.map +1 -0
- package/dist/lighting/lightmap-environment.js +46 -0
- package/dist/lighting/lightmap-environment.js.map +1 -0
- package/dist/lighting/pbr-environment.cjs +45 -0
- package/dist/lighting/pbr-environment.d.ts +25 -0
- package/dist/lighting/pbr-environment.d.ts.map +1 -0
- package/dist/lighting/pbr-environment.js +30 -0
- package/dist/lighting/pbr-environment.js.map +1 -0
- package/dist/lighting/pbr-material.cjs +75 -0
- package/dist/lighting/pbr-material.d.ts +33 -0
- package/dist/lighting/pbr-material.d.ts.map +1 -0
- package/dist/lighting/pbr-material.js +52 -0
- package/dist/lighting/pbr-material.js.map +1 -0
- package/dist/lighting/pbr-model.cjs +579 -0
- package/dist/lighting/pbr-model.d.ts +45 -0
- package/dist/lighting/pbr-model.d.ts.map +1 -0
- package/dist/lighting/pbr-model.js +545 -0
- package/dist/lighting/pbr-model.js.map +1 -0
- package/dist/lighting/pbr-surface-pass.cjs +116 -0
- package/dist/lighting/pbr-surface-pass.d.ts +35 -0
- package/dist/lighting/pbr-surface-pass.d.ts.map +1 -0
- package/dist/lighting/pbr-surface-pass.js +98 -0
- package/dist/lighting/pbr-surface-pass.js.map +1 -0
- package/dist/lighting/prefiltered-environment.cjs +275 -0
- package/dist/lighting/prefiltered-environment.d.ts +56 -0
- package/dist/lighting/prefiltered-environment.d.ts.map +1 -0
- package/dist/lighting/prefiltered-environment.js +264 -0
- package/dist/lighting/prefiltered-environment.js.map +1 -0
- package/dist/lighting/reflection-probe.cjs +321 -0
- package/dist/lighting/reflection-probe.d.ts +78 -0
- package/dist/lighting/reflection-probe.d.ts.map +1 -0
- package/dist/lighting/reflection-probe.js +298 -0
- package/dist/lighting/reflection-probe.js.map +1 -0
- package/dist/lighting/shadow-map-renderer.cjs +631 -0
- package/dist/lighting/shadow-map-renderer.d.ts +92 -0
- package/dist/lighting/shadow-map-renderer.d.ts.map +1 -0
- package/dist/lighting/shadow-map-renderer.js +622 -0
- package/dist/lighting/shadow-map-renderer.js.map +1 -0
- package/dist/lighting/shadow-quality.cjs +58 -0
- package/dist/lighting/shadow-quality.d.ts +13 -0
- package/dist/lighting/shadow-quality.d.ts.map +1 -0
- package/dist/lighting/shadow-quality.js +37 -0
- package/dist/lighting/shadow-quality.js.map +1 -0
- package/dist/material/material.cjs +3 -0
- package/dist/material/material.d.ts +2 -0
- package/dist/material/material.d.ts.map +1 -1
- package/dist/material/material.js +3 -0
- package/dist/material/material.js.map +1 -1
- package/dist/model/gpu-vector-model.cjs +20 -3
- package/dist/model/gpu-vector-model.d.ts +20 -2
- package/dist/model/gpu-vector-model.d.ts.map +1 -1
- package/dist/model/gpu-vector-model.js +21 -3
- package/dist/model/gpu-vector-model.js.map +1 -1
- package/dist/model/model.d.ts +1 -1
- package/dist/model/model.d.ts.map +1 -1
- package/dist/models/light-model-utils.cjs +4 -4
- package/dist/models/light-model-utils.d.ts +3 -2
- package/dist/models/light-model-utils.d.ts.map +1 -1
- package/dist/models/light-model-utils.js +3 -3
- package/dist/models/light-model-utils.js.map +1 -1
- package/dist/modules/picking/color-picking.d.ts +1 -1
- package/dist/modules/picking/index-color-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
- package/dist/modules/picking/picking.d.ts +1 -1
- package/dist/scenegraph/controllers/area-light-controller.cjs +11 -11
- package/dist/scenegraph/controllers/area-light-controller.js +1 -1
- package/dist/scenegraph/controllers/area-light-controller.js.map +1 -1
- package/dist/scenegraph/controllers/billboard-controller.cjs +28 -28
- package/dist/scenegraph/controllers/billboard-controller.d.ts +2 -1
- package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -1
- package/dist/scenegraph/controllers/billboard-controller.js +1 -1
- package/dist/scenegraph/controllers/billboard-controller.js.map +1 -1
- package/dist/scenegraph/controllers/joint-controller.cjs +5 -5
- package/dist/scenegraph/controllers/joint-controller.js +1 -1
- package/dist/scenegraph/controllers/joint-controller.js.map +1 -1
- package/dist/scenegraph/controllers/punctual-light-controller.cjs +121 -0
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts +31 -0
- package/dist/scenegraph/controllers/punctual-light-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/punctual-light-controller.js +117 -0
- package/dist/scenegraph/controllers/punctual-light-controller.js.map +1 -0
- package/dist/scenegraph/controllers/skin-controller.cjs +2 -2
- package/dist/scenegraph/controllers/skin-controller.js +1 -1
- package/dist/scenegraph/controllers/skin-controller.js.map +1 -1
- package/dist/scenegraph/group-node.cjs +14 -14
- package/dist/scenegraph/group-node.d.ts +2 -2
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +1 -1
- package/dist/scenegraph/group-node.js.map +1 -1
- package/dist/scenegraph/model-node.d.ts +1 -1
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/physics-transforms.cjs +2 -2
- package/dist/scenegraph/physics-transforms.d.ts +1 -1
- package/dist/scenegraph/physics-transforms.d.ts.map +1 -1
- package/dist/scenegraph/physics-transforms.js +1 -1
- package/dist/scenegraph/physics-transforms.js.map +1 -1
- package/dist/scenegraph/scene-metadata.cjs +43 -0
- package/dist/scenegraph/scene-metadata.d.ts +9 -0
- package/dist/scenegraph/scene-metadata.d.ts.map +1 -0
- package/dist/scenegraph/scene-metadata.js +21 -0
- package/dist/scenegraph/scene-metadata.js.map +1 -0
- package/dist/scenegraph/scenegraph-bounds.cjs +3 -3
- package/dist/scenegraph/scenegraph-bounds.d.ts +1 -1
- package/dist/scenegraph/scenegraph-bounds.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-bounds.js +1 -1
- package/dist/scenegraph/scenegraph-bounds.js.map +1 -1
- package/dist/scenegraph/scenegraph-interaction.cjs +99 -0
- package/dist/scenegraph/scenegraph-interaction.d.ts +47 -0
- package/dist/scenegraph/scenegraph-interaction.d.ts.map +1 -0
- package/dist/scenegraph/scenegraph-interaction.js +79 -0
- package/dist/scenegraph/scenegraph-interaction.js.map +1 -0
- package/dist/scenegraph/scenegraph-node.cjs +17 -7
- package/dist/scenegraph/scenegraph-node.d.ts +12 -1
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/scenegraph/scenegraph-node.js +11 -1
- package/dist/scenegraph/scenegraph-node.js.map +1 -1
- package/dist/scenegraph/transform-source.d.ts +1 -1
- package/dist/scenegraph/transform-source.d.ts.map +1 -1
- package/dist/text/experimental.cjs.map +1 -1
- package/dist/text/fonts/atlas/text-utils.cjs +1 -1
- package/dist/text/fonts/atlas/text-utils.js +1 -1
- package/dist/text/fonts/atlas/text-utils.js.map +1 -1
- package/dist/text/fonts/index.cjs.map +1 -1
- package/dist/text/index.cjs +2 -0
- package/dist/text/index.cjs.map +2 -2
- package/dist/text/index.d.ts +1 -1
- package/dist/text/index.d.ts.map +1 -1
- package/dist/text/index.js +1 -1
- package/dist/text/index.js.map +1 -1
- package/dist/text/text-2d/index.cjs +3 -0
- package/dist/text/text-2d/index.d.ts +1 -0
- package/dist/text/text-2d/index.d.ts.map +1 -1
- package/dist/text/text-2d/index.js +1 -0
- package/dist/text/text-2d/index.js.map +1 -1
- package/dist/text/text-2d/model-utils/text-code-point-source.cjs +41 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.d.ts +8 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.d.ts.map +1 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.js +23 -0
- package/dist/text/text-2d/model-utils/text-code-point-source.js.map +1 -0
- package/dist/text/text-2d/models/text-attribute-model.cjs +4 -1
- package/dist/text/text-2d/models/text-attribute-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-attribute-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-attribute-model.js +6 -1
- package/dist/text/text-2d/models/text-attribute-model.js.map +1 -1
- package/dist/text/text-2d/models/text-dictionary-model.cjs +4 -1
- package/dist/text/text-2d/models/text-dictionary-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-dictionary-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-dictionary-model.js +6 -1
- package/dist/text/text-2d/models/text-dictionary-model.js.map +1 -1
- package/dist/text/text-2d/models/text-storage-model.cjs +4 -1
- package/dist/text/text-2d/models/text-storage-model.d.ts +3 -1
- package/dist/text/text-2d/models/text-storage-model.d.ts.map +1 -1
- package/dist/text/text-2d/models/text-storage-model.js +6 -1
- package/dist/text/text-2d/models/text-storage-model.js.map +1 -1
- package/dist/text/text-3d/extrude.cjs +15 -15
- package/dist/text/text-3d/extrude.js +1 -1
- package/dist/text/text-3d/extrude.js.map +1 -1
- package/dist/text/text-3d/index.cjs.map +2 -2
- package/dist/text/text-3d/paths/curves.cjs +5 -5
- package/dist/text/text-3d/paths/curves.d.ts +1 -1
- package/dist/text/text-3d/paths/curves.d.ts.map +1 -1
- package/dist/text/text-3d/paths/curves.js +1 -1
- package/dist/text/text-3d/paths/curves.js.map +1 -1
- package/dist/text/text-3d/paths/path.cjs +5 -5
- package/dist/text/text-3d/paths/path.d.ts +1 -1
- package/dist/text/text-3d/paths/path.d.ts.map +1 -1
- package/dist/text/text-3d/paths/path.js +1 -1
- package/dist/text/text-3d/paths/path.js.map +1 -1
- package/dist/text/text-3d/paths/shape-path.d.ts +1 -1
- package/dist/text/text-3d/paths/shape-path.d.ts.map +1 -1
- package/dist/text/text-3d/paths/shape-utils.cjs +2 -2
- package/dist/text/text-3d/paths/shape-utils.d.ts +1 -1
- package/dist/text/text-3d/paths/shape-utils.d.ts.map +1 -1
- package/dist/text/text-3d/paths/shape-utils.js +1 -1
- package/dist/text/text-3d/paths/shape-utils.js.map +1 -1
- package/licenses/cesium.txt +207 -0
- package/licenses/deck-community.txt +19 -0
- package/licenses/deck.txt +19 -0
- package/licenses/glfx.txt +19 -0
- package/licenses/gltf-loader-ts.txt +21 -0
- package/licenses/magenta-font.txt +13 -0
- package/licenses/nvidia-fxaa.txt +25 -0
- package/licenses/philogl.txt +19 -0
- package/licenses/spark.txt +21 -0
- package/licenses/three.txt +21 -0
- package/package.json +21 -13
- package/src/animation/deform-positions.ts +1 -1
- package/src/animation/node-animation-binding.ts +18 -1
- package/src/animation/skin.ts +2 -1
- package/src/animation/texture-transform.ts +1 -1
- package/src/arrow/arrow-geometry.ts +1 -1
- package/src/arrow/arrow-mesh-types.ts +1 -1
- package/src/arrow/renderers/path/conversion/arrow-path-storage-gpu-vectors.ts +1 -1
- package/src/arrow/renderers/polygon/renderers/arrow-polygon-renderer.ts +1 -1
- package/src/arrow/renderers/splats/conversion/make-gpu-splat-data-from-gltf.ts +24 -20
- package/src/arrow/renderers/text/renderers/arrow-text-shaders.ts +1 -1
- package/src/audio/audio-controller.ts +1 -1
- package/src/audio/audio-environment.ts +1 -1
- package/src/compute/computation.ts +2 -2
- package/src/compute/swap.ts +2 -2
- package/src/debug/pixel-data-utils.ts +1 -1
- package/src/dynamic-texture/video-texture.ts +9 -3
- package/src/effects/passes/postprocessing/fxaa/fxaa.ts +2 -1
- package/src/effects/passes/postprocessing/image-adjust-filters/brightnesscontrast.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/denoise.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/huesaturation.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/noise.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/sepia.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vibrance.ts +2 -0
- package/src/effects/passes/postprocessing/image-adjust-filters/vignette.ts +2 -0
- package/src/effects/passes/screen-space/camera-reprojection-temporal-antialiasing.ts +1 -1
- package/src/effects/passes/screen-space/clustered-volumetric-lighting.ts +1 -1
- package/src/effects/passes/screen-space/gtao.ts +1 -1
- package/src/effects/passes/screen-space/height-fog.ts +1 -1
- package/src/effects/passes/screen-space/screen-space-global-illumination.ts +1 -1
- package/src/effects/passes/screen-space/screen-space-reflections.ts +1 -1
- package/src/effects/passes/screen-space/ssr-camera-temporal.ts +1 -1
- package/src/experimental/controls/index.ts +0 -2
- package/src/experimental/webxr/webxr-input.ts +1 -1
- package/{dist/experimental/controls/orbit-controls.js → src/experimental-controls.ts} +2 -2
- package/src/experimental-materials.ts +5 -0
- package/src/experimental-textures.ts +5 -0
- package/src/experimental-webxr.ts +5 -0
- package/src/geometry/edge-geometry.ts +2 -2
- package/src/geometry/geometry-primitives.ts +6 -3
- package/src/geometry/geometry-table.ts +1 -1
- package/src/geometry/geometry-utils.ts +3 -3
- package/src/geometry/geometry.ts +7 -7
- package/src/geometry/gpu-geometry.ts +1 -1
- package/src/geometry/gpu-vector-geometry-adapter.ts +1 -1
- package/src/geometry/ring-geometry.ts +2 -2
- package/src/gltf/gltf/animations/animations.ts +8 -1
- package/src/gltf/gltf/create-gltf-model.ts +5 -1
- package/src/gltf/gltf/create-scenegraph-from-gltf.ts +98 -17
- package/src/gltf/gltf/gltf-animated-crowd.ts +2 -1
- package/src/gltf/gltf/gltf-billboard.ts +6 -1
- package/src/gltf/gltf/gltf-extension-support.ts +2 -2
- package/src/gltf/gltf/gltf-instancing.ts +1 -1
- package/src/gltf/gltf/gltf-lightmap.ts +1 -1
- package/src/gltf/index.ts +1 -0
- package/src/gltf/parsers/parse-gltf-animations.ts +22 -8
- package/src/gltf/parsers/parse-gltf-lights.ts +43 -131
- package/src/gltf/parsers/parse-gltf-metadata.ts +40 -0
- package/src/gltf/parsers/parse-gltf.ts +11 -2
- package/src/gltf/parsers/parse-pbr-material.ts +36 -8
- package/src/gltf/pbr/pbr-environment.ts +27 -1
- package/src/gltf/pbr/pbr-material.ts +8 -3
- package/src/gltf/physics/export-state.ts +1 -1
- package/src/gltf/physics/mesh-snapshot.ts +1 -1
- package/src/gltf/physics/node-collision-geometry.ts +1 -1
- package/src/gltf/physics/parse-gltf-physics.ts +1 -1
- package/src/gltf/physics/parse-physics-joints.ts +1 -1
- package/src/gltf/physics/property-bindings.ts +1 -1
- package/src/gltf/types/gltf-json-schema.ts +1 -0
- package/src/gltf/types/gltf-postprocessed-schema.ts +1 -0
- package/src/graph/models/path/path-attribute-model.ts +10 -1
- package/src/graph/models/path/path-storage-model.ts +13 -4
- package/src/graph/models/polygon/polygon-attribute-model.ts +1 -1
- package/src/graph/models/polygon/polygon-storage-model.ts +1 -1
- package/src/graph/physics/index.ts +1 -0
- package/src/graph/physics/physics-controller-geometry.ts +2 -2
- package/src/graph/physics/physics-controller.ts +155 -2
- package/src/graph/physics/physics-scenegraph.ts +1 -1
- package/src/graph/physics/scenegraph-instance.ts +27 -1
- package/src/graph/physics/scenegraph-motion.ts +1 -1
- package/src/graph/physics/scenegraph-properties.ts +1 -1
- package/src/graph/physics/scenegraph-publication.ts +1 -1
- package/src/graph/tables/gpu-table-model.ts +3 -2
- package/src/index.ts +17 -0
- package/src/lighting/ambient-occlusion-pass.ts +131 -0
- package/src/lighting/clustered-light-grid.ts +481 -0
- package/src/lighting/contact-shadow-composite.ts +67 -0
- package/src/lighting/contact-shadow-pass.ts +108 -0
- package/src/lighting/index.ts +125 -0
- package/src/lighting/lightmap-atlas.ts +348 -0
- package/src/lighting/lightmap-baker.ts +306 -0
- package/src/lighting/lightmap-data.ts +138 -0
- package/src/lighting/lightmap-environment.ts +70 -0
- package/src/lighting/pbr-environment.ts +55 -0
- package/src/lighting/pbr-material.ts +85 -0
- package/src/lighting/pbr-model.ts +608 -0
- package/src/lighting/pbr-surface-pass.ts +122 -0
- package/src/lighting/prefiltered-environment.ts +354 -0
- package/src/lighting/reflection-probe.ts +361 -0
- package/src/lighting/shadow-map-renderer.ts +918 -0
- package/src/lighting/shadow-quality.ts +50 -0
- package/src/material/material.ts +3 -0
- package/src/model/gpu-vector-model.ts +42 -4
- package/src/model/model.ts +1 -1
- package/src/models/light-model-utils.ts +5 -3
- package/src/modules/picking/legacy-picking-manager.ts +1 -1
- package/src/modules/picking/picking-uniforms.ts +1 -1
- package/src/scenegraph/controllers/area-light-controller.ts +1 -1
- package/src/scenegraph/controllers/billboard-controller.ts +2 -1
- package/src/scenegraph/controllers/joint-controller.ts +1 -1
- package/src/scenegraph/controllers/punctual-light-controller.ts +172 -0
- package/src/scenegraph/controllers/skin-controller.ts +1 -1
- package/src/scenegraph/group-node.ts +2 -2
- package/src/scenegraph/model-node.ts +1 -1
- package/src/scenegraph/physics-transforms.ts +1 -1
- package/src/scenegraph/scene-metadata.ts +23 -0
- package/src/scenegraph/scenegraph-bounds.ts +2 -2
- package/src/scenegraph/scenegraph-interaction.ts +131 -0
- package/src/scenegraph/scenegraph-node.ts +14 -1
- package/src/scenegraph/transform-source.ts +1 -1
- package/src/splats/README.md +1 -1
- package/src/text/fonts/atlas/text-utils.ts +1 -1
- package/src/text/index.ts +1 -0
- package/src/text/text-2d/index.ts +1 -0
- package/src/text/text-2d/model-utils/text-code-point-source.ts +34 -0
- package/src/text/text-2d/models/text-attribute-model.ts +10 -1
- package/src/text/text-2d/models/text-dictionary-model.ts +10 -1
- package/src/text/text-2d/models/text-storage-model.ts +10 -1
- package/src/text/text-3d/extrude.ts +1 -1
- package/src/text/text-3d/font.ts +1 -1
- package/src/text/text-3d/paths/curves.ts +1 -1
- package/src/text/text-3d/paths/path.ts +1 -1
- package/src/text/text-3d/paths/shape-path.ts +1 -1
- package/src/text/text-3d/paths/shape-utils.ts +2 -2
- package/dist/experimental/controls/orbit-controls.d.ts +0 -3
- package/dist/experimental/controls/orbit-controls.d.ts.map +0 -1
- package/dist/experimental/controls/orbit-controls.js.map +0 -1
- package/src/experimental/controls/orbit-controls.ts +0 -6
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
3
|
+
|
|
4
|
+
import {assert, Texture, type Device, type Framebuffer, type RenderPass} from '@luma.gl/core';
|
|
5
|
+
|
|
6
|
+
export type PBRSurfacePassProps = {width: number; height: number};
|
|
7
|
+
|
|
8
|
+
export type PBRSurfaceRenderView = PBRSurfacePassProps & {
|
|
9
|
+
framebuffer: Framebuffer;
|
|
10
|
+
renderPass: RenderPass;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type PBRSurfaceRenderOptions = {
|
|
14
|
+
/** Create or upload per-object uniform storage before the render pass begins. */
|
|
15
|
+
prepareSurfaces?: (view: Omit<PBRSurfaceRenderView, 'renderPass'>) => void;
|
|
16
|
+
/** Record caller-selected surface model draws. The pass is ended by the owner. */
|
|
17
|
+
drawSurfaces: (view: PBRSurfaceRenderView) => void;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type SurfaceResources = PBRSurfacePassProps & {
|
|
21
|
+
normalTexture: Texture;
|
|
22
|
+
depthTexture: Texture;
|
|
23
|
+
framebuffer: Framebuffer;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Owns a single-sample camera depth/normal target, without scene traversal or submission. */
|
|
27
|
+
export class PBRSurfacePass {
|
|
28
|
+
readonly device: Device;
|
|
29
|
+
private resources: SurfaceResources;
|
|
30
|
+
private destroyed = false;
|
|
31
|
+
|
|
32
|
+
constructor(device: Device, props: PBRSurfacePassProps) {
|
|
33
|
+
this.device = device;
|
|
34
|
+
this.resources = createSurfaceResources(device, props);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
get width(): number {
|
|
38
|
+
return this.resources.width;
|
|
39
|
+
}
|
|
40
|
+
get height(): number {
|
|
41
|
+
return this.resources.height;
|
|
42
|
+
}
|
|
43
|
+
/** Borrowed rgba8unorm encoded view normals; alpha zero denotes background. */
|
|
44
|
+
get normalTexture(): Texture {
|
|
45
|
+
return this.resources.normalTexture;
|
|
46
|
+
}
|
|
47
|
+
/** Borrowed depth32float hardware depth in [0,1], cleared to one. */
|
|
48
|
+
get depthTexture(): Texture {
|
|
49
|
+
return this.resources.depthTexture;
|
|
50
|
+
}
|
|
51
|
+
get framebuffer(): Framebuffer {
|
|
52
|
+
return this.resources.framebuffer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Replaces and destroys old attachments only when dimensions change. Rebind consumers afterward. */
|
|
56
|
+
resize(props: PBRSurfacePassProps): void {
|
|
57
|
+
// A destroyed surface pass cannot be reused.
|
|
58
|
+
assert(!this.destroyed);
|
|
59
|
+
if (props.width === this.width && props.height === this.height) return;
|
|
60
|
+
const resources = createSurfaceResources(this.device, props);
|
|
61
|
+
destroySurfaceResources(this.resources);
|
|
62
|
+
this.resources = resources;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Records camera-surface draws and ends the pass even if a callback throws. Never submits. */
|
|
66
|
+
render(options: PBRSurfaceRenderOptions): void {
|
|
67
|
+
// A destroyed surface pass cannot be reused.
|
|
68
|
+
assert(!this.destroyed);
|
|
69
|
+
const view = {width: this.width, height: this.height, framebuffer: this.framebuffer};
|
|
70
|
+
options.prepareSurfaces?.(view);
|
|
71
|
+
const renderPass = this.device.beginRenderPass({
|
|
72
|
+
framebuffer: this.framebuffer,
|
|
73
|
+
clearColor: [0.5, 0.5, 1, 0],
|
|
74
|
+
clearDepth: 1
|
|
75
|
+
});
|
|
76
|
+
try {
|
|
77
|
+
renderPass.setParameters({viewport: [0, 0, this.width, this.height]});
|
|
78
|
+
options.drawSurfaces({...view, renderPass});
|
|
79
|
+
} finally {
|
|
80
|
+
renderPass.end();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
destroy(): void {
|
|
85
|
+
if (this.destroyed) return;
|
|
86
|
+
this.destroyed = true;
|
|
87
|
+
destroySurfaceResources(this.resources);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function createSurfaceResources(device: Device, props: PBRSurfacePassProps): SurfaceResources {
|
|
92
|
+
const {width, height} = props;
|
|
93
|
+
// Surface targets require positive integer dimensions; the device validates its own limits.
|
|
94
|
+
assert(Number.isInteger(width) && width > 0 && Number.isInteger(height) && height > 0);
|
|
95
|
+
let normalTexture: Texture | undefined;
|
|
96
|
+
let depthTexture: Texture | undefined;
|
|
97
|
+
let framebuffer: Framebuffer | undefined;
|
|
98
|
+
try {
|
|
99
|
+
const usage = Texture.RENDER_ATTACHMENT | Texture.SAMPLE | Texture.COPY_SRC;
|
|
100
|
+
const sampler = {minFilter: 'nearest', magFilter: 'nearest'} as const;
|
|
101
|
+
normalTexture = device.createTexture({width, height, format: 'rgba8unorm', usage, sampler});
|
|
102
|
+
depthTexture = device.createTexture({width, height, format: 'depth32float', usage, sampler});
|
|
103
|
+
framebuffer = device.createFramebuffer({
|
|
104
|
+
width,
|
|
105
|
+
height,
|
|
106
|
+
colorAttachments: [normalTexture],
|
|
107
|
+
depthStencilAttachment: depthTexture
|
|
108
|
+
});
|
|
109
|
+
return {width, height, normalTexture, depthTexture, framebuffer};
|
|
110
|
+
} catch (error) {
|
|
111
|
+
framebuffer?.destroy();
|
|
112
|
+
depthTexture?.destroy();
|
|
113
|
+
normalTexture?.destroy();
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function destroySurfaceResources(resources: SurfaceResources): void {
|
|
119
|
+
resources.framebuffer.destroy();
|
|
120
|
+
resources.depthTexture.destroy();
|
|
121
|
+
resources.normalTexture.destroy();
|
|
122
|
+
}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
assert,
|
|
7
|
+
type Device,
|
|
8
|
+
type Framebuffer,
|
|
9
|
+
Texture,
|
|
10
|
+
type TextureFormatColor,
|
|
11
|
+
type TextureView
|
|
12
|
+
} from '@luma.gl/core';
|
|
13
|
+
import {getPBREnvironmentBindings} from './pbr-environment';
|
|
14
|
+
import {ClipSpace} from '../models/clip-space';
|
|
15
|
+
import {ShaderInputs} from '../shader-inputs';
|
|
16
|
+
import {
|
|
17
|
+
PBR_ENVIRONMENT_FRAGMENT_GLSL,
|
|
18
|
+
PBR_ENVIRONMENT_FRAGMENT_WGSL,
|
|
19
|
+
pbrEnvironmentFilter
|
|
20
|
+
} from '@luma.gl/shaders';
|
|
21
|
+
|
|
22
|
+
/** Source and quality controls for preparing a portable physically based lighting environment. */
|
|
23
|
+
export type PrefilteredEnvironmentOptions = {
|
|
24
|
+
/** Caller-owned linear HDR or sRGB equirectangular source texture. */
|
|
25
|
+
source: Texture;
|
|
26
|
+
/** Source color encoding. HDR and floating-point sources are linear by default. */
|
|
27
|
+
sourceEncoding?: 'linear' | 'srgb';
|
|
28
|
+
/** Base dimension of the GGX-prefiltered specular cubemap. Defaults to 64 pixels. */
|
|
29
|
+
size?: number;
|
|
30
|
+
/** Dimension of the cosine-weighted diffuse irradiance cubemap. Defaults to 16 pixels. */
|
|
31
|
+
irradianceSize?: number;
|
|
32
|
+
/** Dimension of the integrated split-sum BRDF lookup texture. Defaults to 128 pixels. */
|
|
33
|
+
brdfLUTSize?: number;
|
|
34
|
+
/** Number of importance samples for each destination texel. Defaults to 64. */
|
|
35
|
+
sampleCount?: number;
|
|
36
|
+
/** Renderable and filterable output format. Defaults to rgba16float; LDR fallback is explicit. */
|
|
37
|
+
format?: TextureFormatColor;
|
|
38
|
+
/** Borrow a compatible split-sum lookup. Its lifetime remains caller-owned. */
|
|
39
|
+
brdfLUTTexture?: Texture;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Generated linear-light textures. Diffuse stores irradiance divided by pi. */
|
|
43
|
+
export type PrefilteredEnvironmentTextures = {
|
|
44
|
+
diffuseTexture: Texture;
|
|
45
|
+
specularTexture: Texture;
|
|
46
|
+
brdfLUTTexture: Texture;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** Owns generated resources independently of the generator and source texture. */
|
|
50
|
+
export class PrefilteredEnvironment {
|
|
51
|
+
readonly textures: PrefilteredEnvironmentTextures;
|
|
52
|
+
readonly ownsBrdfLUTTexture: boolean;
|
|
53
|
+
private destroyed = false;
|
|
54
|
+
|
|
55
|
+
constructor(textures: PrefilteredEnvironmentTextures, ownsBrdfLUTTexture = true) {
|
|
56
|
+
this.textures = textures;
|
|
57
|
+
this.ownsBrdfLUTTexture = ownsBrdfLUTTexture;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Returns the texture bindings declared by the IBL shader module. */
|
|
61
|
+
getBindings() {
|
|
62
|
+
return getPBREnvironmentBindings(this.textures);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
destroy(): void {
|
|
66
|
+
if (this.destroyed) return;
|
|
67
|
+
this.destroyed = true;
|
|
68
|
+
this.textures.diffuseTexture.destroy();
|
|
69
|
+
this.textures.specularTexture.destroy();
|
|
70
|
+
if (this.ownsBrdfLUTTexture) this.textures.brdfLUTTexture.destroy();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Reusable WebGL/WebGPU equirectangular-to-IBL importance-sampling pipeline. */
|
|
75
|
+
export class PrefilteredEnvironmentGenerator {
|
|
76
|
+
readonly device: Device;
|
|
77
|
+
|
|
78
|
+
private model: ClipSpace | undefined;
|
|
79
|
+
private modelFormat: TextureFormatColor | undefined;
|
|
80
|
+
|
|
81
|
+
constructor(device: Device) {
|
|
82
|
+
this.device = device;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Integrates all six cube faces, every roughness mip, diffuse irradiance, and the BRDF LUT. */
|
|
86
|
+
prepare(options: PrefilteredEnvironmentOptions): PrefilteredEnvironment {
|
|
87
|
+
// Equirectangular environment sources require ordinary two-dimensional texture coordinates.
|
|
88
|
+
assert(
|
|
89
|
+
options.source.dimension === '2d' &&
|
|
90
|
+
options.source.device === this.device &&
|
|
91
|
+
!options.source.destroyed
|
|
92
|
+
);
|
|
93
|
+
const size = Math.max(1, Math.floor(options.size ?? 64));
|
|
94
|
+
const irradianceSize = Math.max(1, Math.floor(options.irradianceSize ?? 16));
|
|
95
|
+
const brdfLUTSize = Math.max(1, Math.floor(options.brdfLUTSize ?? 128));
|
|
96
|
+
const sampleCount = Math.max(1, Math.min(Math.floor(options.sampleCount ?? 64), 1024));
|
|
97
|
+
const format = options.format ?? 'rgba16float';
|
|
98
|
+
const capabilities = this.device.getTextureFormatCapabilities(format);
|
|
99
|
+
// Never silently clip HDR radiance to an unorm format.
|
|
100
|
+
assert(capabilities.render && capabilities.filter && !format.endsWith('-srgb'));
|
|
101
|
+
if (options.brdfLUTTexture) {
|
|
102
|
+
// Borrowed LUTs must use the same device and the documented split-sum convention.
|
|
103
|
+
assert(
|
|
104
|
+
options.brdfLUTTexture.device === this.device &&
|
|
105
|
+
!options.brdfLUTTexture.destroyed &&
|
|
106
|
+
options.brdfLUTTexture.dimension === '2d'
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
const mipLevels = this.device.getMipLevelCount(size, size);
|
|
110
|
+
|
|
111
|
+
const allocatedTextures: Texture[] = [];
|
|
112
|
+
const framebuffers: Framebuffer[] = [];
|
|
113
|
+
const views: TextureView[] = [];
|
|
114
|
+
const allocateTexture = (properties: Parameters<typeof createEnvironmentTexture>[1]) => {
|
|
115
|
+
const texture = createEnvironmentTexture(this.device, properties);
|
|
116
|
+
allocatedTextures.push(texture);
|
|
117
|
+
return texture;
|
|
118
|
+
};
|
|
119
|
+
try {
|
|
120
|
+
const specularTexture = allocateTexture({
|
|
121
|
+
id: 'pbr-environment-specular',
|
|
122
|
+
dimension: 'cube',
|
|
123
|
+
size,
|
|
124
|
+
mipLevels,
|
|
125
|
+
format
|
|
126
|
+
});
|
|
127
|
+
const diffuseTexture = allocateTexture({
|
|
128
|
+
id: 'pbr-environment-diffuse',
|
|
129
|
+
dimension: 'cube',
|
|
130
|
+
size: irradianceSize,
|
|
131
|
+
mipLevels: 1,
|
|
132
|
+
format
|
|
133
|
+
});
|
|
134
|
+
const brdfLUTTexture =
|
|
135
|
+
options.brdfLUTTexture ??
|
|
136
|
+
allocateTexture({
|
|
137
|
+
id: 'pbr-environment-brdf-lut',
|
|
138
|
+
dimension: '2d',
|
|
139
|
+
size: brdfLUTSize,
|
|
140
|
+
mipLevels: 1,
|
|
141
|
+
format
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const model = this.getFilterModel(format);
|
|
145
|
+
const sourceEncoding =
|
|
146
|
+
options.sourceEncoding === 'srgb' && !options.source.format.endsWith('-srgb') ? 1 : 0;
|
|
147
|
+
|
|
148
|
+
for (let mipLevel = 0; mipLevel < mipLevels; mipLevel++) {
|
|
149
|
+
const mipSize = Math.max(1, size >> mipLevel);
|
|
150
|
+
const roughness = mipLevels > 1 ? mipLevel / (mipLevels - 1) : 0;
|
|
151
|
+
for (let face = 0; face < 6; face++) {
|
|
152
|
+
this.drawEnvironmentView({
|
|
153
|
+
texture: specularTexture,
|
|
154
|
+
size: mipSize,
|
|
155
|
+
mipLevel,
|
|
156
|
+
face,
|
|
157
|
+
roughness,
|
|
158
|
+
mode: 0,
|
|
159
|
+
source: options.source,
|
|
160
|
+
sourceEncoding,
|
|
161
|
+
sampleCount,
|
|
162
|
+
model,
|
|
163
|
+
framebuffers,
|
|
164
|
+
views
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
for (let face = 0; face < 6; face++) {
|
|
170
|
+
this.drawEnvironmentView({
|
|
171
|
+
texture: diffuseTexture,
|
|
172
|
+
size: irradianceSize,
|
|
173
|
+
mipLevel: 0,
|
|
174
|
+
face,
|
|
175
|
+
roughness: 1,
|
|
176
|
+
mode: 1,
|
|
177
|
+
source: options.source,
|
|
178
|
+
sourceEncoding,
|
|
179
|
+
sampleCount,
|
|
180
|
+
model,
|
|
181
|
+
framebuffers,
|
|
182
|
+
views
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (!options.brdfLUTTexture)
|
|
187
|
+
this.drawEnvironmentView({
|
|
188
|
+
texture: brdfLUTTexture,
|
|
189
|
+
size: brdfLUTSize,
|
|
190
|
+
mipLevel: 0,
|
|
191
|
+
face: 0,
|
|
192
|
+
roughness: 0,
|
|
193
|
+
mode: 2,
|
|
194
|
+
source: options.source,
|
|
195
|
+
sourceEncoding,
|
|
196
|
+
sampleCount,
|
|
197
|
+
model,
|
|
198
|
+
framebuffers,
|
|
199
|
+
views
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
// Queue order makes subsequent sampling safe; this is not a GPU completion wait.
|
|
203
|
+
this.device.submit();
|
|
204
|
+
|
|
205
|
+
return new PrefilteredEnvironment(
|
|
206
|
+
{
|
|
207
|
+
diffuseTexture,
|
|
208
|
+
specularTexture,
|
|
209
|
+
brdfLUTTexture
|
|
210
|
+
},
|
|
211
|
+
!options.brdfLUTTexture
|
|
212
|
+
);
|
|
213
|
+
} catch (error) {
|
|
214
|
+
for (const texture of allocatedTextures) texture.destroy();
|
|
215
|
+
throw error;
|
|
216
|
+
} finally {
|
|
217
|
+
for (const framebuffer of framebuffers) {
|
|
218
|
+
framebuffer.destroy();
|
|
219
|
+
}
|
|
220
|
+
for (const view of views) {
|
|
221
|
+
view.destroy();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** Releases the reusable integration pipeline without destroying generated environments. */
|
|
227
|
+
destroy(): void {
|
|
228
|
+
this.model?.destroy();
|
|
229
|
+
this.model = undefined;
|
|
230
|
+
this.modelFormat = undefined;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
private getFilterModel(format: TextureFormatColor): ClipSpace {
|
|
234
|
+
if (this.model && this.modelFormat !== format) {
|
|
235
|
+
this.model.destroy();
|
|
236
|
+
this.model = undefined;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (!this.model) {
|
|
240
|
+
this.model = new ClipSpace(this.device, {
|
|
241
|
+
id: 'pbr-environment-integration-model',
|
|
242
|
+
fs: PBR_ENVIRONMENT_FRAGMENT_GLSL,
|
|
243
|
+
source: PBR_ENVIRONMENT_FRAGMENT_WGSL,
|
|
244
|
+
modules: [pbrEnvironmentFilter],
|
|
245
|
+
shaderInputs: new ShaderInputs({pbrEnvironmentFilter}),
|
|
246
|
+
colorAttachmentFormats: [format],
|
|
247
|
+
parameters: {depthWriteEnabled: false}
|
|
248
|
+
});
|
|
249
|
+
this.modelFormat = format;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return this.model;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
private drawEnvironmentView(options: {
|
|
256
|
+
texture: Texture;
|
|
257
|
+
size: number;
|
|
258
|
+
mipLevel: number;
|
|
259
|
+
face: number;
|
|
260
|
+
roughness: number;
|
|
261
|
+
mode: number;
|
|
262
|
+
source: Texture;
|
|
263
|
+
sourceEncoding: number;
|
|
264
|
+
sampleCount: number;
|
|
265
|
+
model: ClipSpace;
|
|
266
|
+
framebuffers: Framebuffer[];
|
|
267
|
+
views: TextureView[];
|
|
268
|
+
}): void {
|
|
269
|
+
const view = options.texture.createView({
|
|
270
|
+
id: `${options.texture.id}-${options.face}-${options.mipLevel}`,
|
|
271
|
+
dimension: '2d',
|
|
272
|
+
baseMipLevel: options.mipLevel,
|
|
273
|
+
mipLevelCount: 1,
|
|
274
|
+
baseArrayLayer: options.face,
|
|
275
|
+
arrayLayerCount: 1
|
|
276
|
+
});
|
|
277
|
+
options.views.push(view);
|
|
278
|
+
|
|
279
|
+
const framebuffer = this.device.createFramebuffer({
|
|
280
|
+
id: `${view.id}-framebuffer`,
|
|
281
|
+
width: options.size,
|
|
282
|
+
height: options.size,
|
|
283
|
+
colorAttachments: [view],
|
|
284
|
+
depthStencilAttachment: null
|
|
285
|
+
});
|
|
286
|
+
options.framebuffers.push(framebuffer);
|
|
287
|
+
|
|
288
|
+
options.model.shaderInputs.setProps({
|
|
289
|
+
pbrEnvironmentFilter: {
|
|
290
|
+
face: options.face,
|
|
291
|
+
roughness: options.roughness,
|
|
292
|
+
mode: options.mode,
|
|
293
|
+
sampleCount: options.sampleCount,
|
|
294
|
+
sourceEncoding: options.sourceEncoding,
|
|
295
|
+
pbrEnvironmentSource: options.source
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
options.model.predraw(this.device.commandEncoder);
|
|
299
|
+
|
|
300
|
+
const renderPass = this.device.beginRenderPass({
|
|
301
|
+
id: `${view.id}-integration`,
|
|
302
|
+
framebuffer,
|
|
303
|
+
clearColor: [0, 0, 0, 1],
|
|
304
|
+
clearDepth: false
|
|
305
|
+
});
|
|
306
|
+
try {
|
|
307
|
+
options.model.draw(renderPass);
|
|
308
|
+
} finally {
|
|
309
|
+
renderPass.end();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Prepares one caller-owned lighting environment without retaining the integration pipeline. */
|
|
315
|
+
export function createPrefilteredEnvironment(
|
|
316
|
+
device: Device,
|
|
317
|
+
options: PrefilteredEnvironmentOptions
|
|
318
|
+
): PrefilteredEnvironment {
|
|
319
|
+
const generator = new PrefilteredEnvironmentGenerator(device);
|
|
320
|
+
try {
|
|
321
|
+
return generator.prepare(options);
|
|
322
|
+
} finally {
|
|
323
|
+
generator.destroy();
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function createEnvironmentTexture(
|
|
328
|
+
device: Device,
|
|
329
|
+
options: {
|
|
330
|
+
id: string;
|
|
331
|
+
dimension: '2d' | 'cube';
|
|
332
|
+
size: number;
|
|
333
|
+
mipLevels: number;
|
|
334
|
+
format: TextureFormatColor;
|
|
335
|
+
}
|
|
336
|
+
): Texture {
|
|
337
|
+
return device.createTexture({
|
|
338
|
+
id: options.id,
|
|
339
|
+
dimension: options.dimension,
|
|
340
|
+
width: options.size,
|
|
341
|
+
height: options.size,
|
|
342
|
+
depth: options.dimension === 'cube' ? 6 : 1,
|
|
343
|
+
mipLevels: options.mipLevels,
|
|
344
|
+
format: options.format,
|
|
345
|
+
usage: Texture.SAMPLE | Texture.RENDER | Texture.COPY_SRC,
|
|
346
|
+
sampler: {
|
|
347
|
+
minFilter: 'linear',
|
|
348
|
+
magFilter: 'linear',
|
|
349
|
+
mipmapFilter: 'linear',
|
|
350
|
+
addressModeU: 'clamp-to-edge',
|
|
351
|
+
addressModeV: 'clamp-to-edge'
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|