@babylonjs/core 7.32.0 → 7.32.1
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/Behaviors/Cameras/autoRotationBehavior.js +1 -0
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Cameras/camera.d.ts +5 -2
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Decorators/nodeDecorator.d.ts +9 -1
- package/Decorators/nodeDecorator.js +8 -0
- package/Decorators/nodeDecorator.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +40 -53
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +20 -8
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.debugging.js +16 -7
- package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +43 -44
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +8 -6
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -3
- package/Engines/WebGPU/webgpuHardwareTexture.js +12 -9
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +25 -19
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +5 -3
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +6 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +6 -1
- package/Engines/constants.js +6 -1
- package/Engines/constants.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +7 -0
- package/Engines/renderTargetWrapper.js +15 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +3 -1
- package/Engines/webgpuEngine.js +9 -8
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.d.ts +62 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +171 -0
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.d.ts +51 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +127 -0
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.d.ts +67 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +187 -0
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +232 -0
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.d.ts +47 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +113 -0
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.d.ts +41 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +79 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +119 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +451 -0
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +63 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +154 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.d.ts +59 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js +131 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.d.ts +49 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js +107 -0
- package/FrameGraph/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +50 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +125 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +71 -0
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +34 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +59 -0
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/elbowBlock.d.ts +28 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js +47 -0
- package/FrameGraph/Node/Blocks/elbowBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +17 -0
- package/FrameGraph/Node/Blocks/index.js +18 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -0
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +94 -0
- package/FrameGraph/Node/Blocks/inputBlock.js +270 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/outputBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/outputBlock.js +51 -0
- package/FrameGraph/Node/Blocks/outputBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +110 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +78 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraph.d.ts +196 -0
- package/FrameGraph/Node/nodeRenderGraph.js +614 -0
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +190 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +495 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +143 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +275 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js +35 -0
- package/FrameGraph/Node/nodeRenderGraphBuildState.js.map +1 -0
- package/FrameGraph/Passes/cullPass.d.ts +28 -0
- package/FrameGraph/Passes/cullPass.js +38 -0
- package/FrameGraph/Passes/cullPass.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +14 -0
- package/FrameGraph/Passes/pass.js +20 -0
- package/FrameGraph/Passes/pass.js.map +1 -0
- package/FrameGraph/Passes/renderPass.d.ts +49 -0
- package/FrameGraph/Passes/renderPass.js +72 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/blackAndWhiteTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +21 -0
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +54 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +114 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js +24 -0
- package/FrameGraph/Tasks/PostProcesses/blurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.d.ts +30 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +35 -0
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +26 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.d.ts +12 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +29 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +65 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +134 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/extractHighlightsTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +41 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +64 -0
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +28 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js +52 -0
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +145 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +259 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +66 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +127 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +34 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +42 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.d.ts +12 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js +23 -0
- package/FrameGraph/Tasks/Texture/copyToBackbufferColorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +26 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +31 -0
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +22 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +34 -0
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -0
- package/FrameGraph/frameGraph.d.ts +143 -0
- package/FrameGraph/frameGraph.js +275 -0
- package/FrameGraph/frameGraph.js.map +1 -0
- package/FrameGraph/frameGraphContext.d.ts +5 -0
- package/FrameGraph/frameGraphContext.js +6 -0
- package/FrameGraph/frameGraphContext.js.map +1 -0
- package/FrameGraph/frameGraphObjectList.d.ts +15 -0
- package/FrameGraph/frameGraphObjectList.js +7 -0
- package/FrameGraph/frameGraphObjectList.js.map +1 -0
- package/FrameGraph/frameGraphRenderContext.d.ts +110 -0
- package/FrameGraph/frameGraphRenderContext.js +237 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -0
- package/FrameGraph/frameGraphTask.d.ts +49 -0
- package/FrameGraph/frameGraphTask.js +117 -0
- package/FrameGraph/frameGraphTask.js.map +1 -0
- package/FrameGraph/frameGraphTextureManager.d.ts +50 -0
- package/FrameGraph/frameGraphTextureManager.js +277 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -0
- package/FrameGraph/frameGraphTypes.d.ts +59 -0
- package/FrameGraph/frameGraphTypes.js +9 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -0
- package/FrameGraph/index.d.ts +28 -0
- package/FrameGraph/index.js +30 -0
- package/FrameGraph/index.js.map +1 -0
- package/Gamepads/gamepadSceneComponent.d.ts +0 -1
- package/Gamepads/gamepadSceneComponent.js +1 -7
- package/Gamepads/gamepadSceneComponent.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +7 -0
- package/Gizmos/boundingBoxGizmo.js +19 -6
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +3 -1
- package/Inputs/scene.inputManager.js +20 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/layer.d.ts +1 -1
- package/Layers/layer.js +1 -1
- package/Layers/layer.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +4 -0
- package/Materials/PBR/pbrBaseMaterial.js +8 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/dynamicTexture.d.ts +32 -2
- package/Materials/Textures/dynamicTexture.js +13 -18
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js +0 -6
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +20 -8
- package/Materials/Textures/multiRenderTarget.js +2 -0
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +8 -1
- package/Materials/Textures/renderTargetTexture.js +28 -10
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +20 -2
- package/Materials/Textures/textureCreationOptions.js +20 -1
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/effectRenderer.d.ts +132 -14
- package/Materials/effectRenderer.js +229 -33
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialHelper.functions.js +2 -0
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +122 -0
- package/Materials/materialHelper.geometryrendering.js +259 -0
- package/Materials/materialHelper.geometryrendering.js.map +1 -0
- package/Materials/standardMaterial.d.ts +4 -0
- package/Materials/standardMaterial.js +8 -0
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +22 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +39 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Misc/copyTextureToTexture.d.ts +3 -2
- package/Misc/copyTextureToTexture.js +11 -5
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/PostProcesses/blackAndWhitePostProcess.d.ts +5 -3
- package/PostProcesses/blackAndWhitePostProcess.js +24 -19
- package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
- package/PostProcesses/bloomEffect.d.ts +7 -5
- package/PostProcesses/bloomEffect.js +49 -23
- package/PostProcesses/bloomEffect.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.d.ts +5 -5
- package/PostProcesses/bloomMergePostProcess.js +28 -19
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +7 -43
- package/PostProcesses/blurPostProcess.js +47 -185
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.d.ts +13 -6
- package/PostProcesses/circleOfConfusionPostProcess.js +59 -38
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -6
- package/PostProcesses/depthOfFieldBlurPostProcess.js +14 -11
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.d.ts +5 -2
- package/PostProcesses/depthOfFieldEffect.js +53 -45
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.d.ts +0 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js +18 -12
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.d.ts +8 -4
- package/PostProcesses/extractHighlightsPostProcess.js +35 -22
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +6 -0
- package/PostProcesses/index.js +6 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +15 -70
- package/PostProcesses/postProcess.js +80 -97
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinBlackAndWhitePostProcess.d.ts +28 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js +50 -0
- package/PostProcesses/thinBlackAndWhitePostProcess.js.map +1 -0
- package/PostProcesses/thinBloomEffect.d.ts +49 -0
- package/PostProcesses/thinBloomEffect.js +59 -0
- package/PostProcesses/thinBloomEffect.js.map +1 -0
- package/PostProcesses/thinBloomMergePostProcess.d.ts +15 -0
- package/PostProcesses/thinBloomMergePostProcess.js +38 -0
- package/PostProcesses/thinBloomMergePostProcess.js.map +1 -0
- package/PostProcesses/thinBlurPostProcess.d.ts +89 -0
- package/PostProcesses/thinBlurPostProcess.js +242 -0
- package/PostProcesses/thinBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.d.ts +62 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js +81 -0
- package/PostProcesses/thinCircleOfConfusionPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.d.ts +8 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js +13 -0
- package/PostProcesses/thinDepthOfFieldBlurPostProcess.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldEffect.d.ts +70 -0
- package/PostProcesses/thinDepthOfFieldEffect.js +115 -0
- package/PostProcesses/thinDepthOfFieldEffect.js.map +1 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.d.ts +11 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js +30 -0
- package/PostProcesses/thinDepthOfFieldMergePostProcess.js.map +1 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.d.ts +30 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js +55 -0
- package/PostProcesses/thinExtractHighlightsPostProcess.js.map +1 -0
- package/Rendering/depthPeelingRenderer.js +2 -2
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +4 -4
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +75 -0
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/Shaders/ShadersInclude/prePassVertex.js +1 -2
- package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
- package/Shaders/circleOfConfusion.fragment.js +9 -1
- package/Shaders/circleOfConfusion.fragment.js.map +1 -1
- package/Shaders/colorCorrection.fragment.js +1 -0
- package/Shaders/colorCorrection.fragment.js.map +1 -1
- package/Shaders/default.fragment.js +17 -25
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +4 -6
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.d.ts +1 -0
- package/Shaders/pbr.fragment.js +2 -74
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +3 -3
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +100 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/prePassVertex.js +1 -2
- package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
- package/ShadersWGSL/background.vertex.js +1 -1
- package/ShadersWGSL/background.vertex.js.map +1 -1
- package/ShadersWGSL/circleOfConfusion.fragment.js +10 -2
- package/ShadersWGSL/circleOfConfusion.fragment.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +20 -31
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/default.vertex.js +4 -5
- package/ShadersWGSL/default.vertex.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js +1 -1
- package/ShadersWGSL/glowMapGeneration.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.d.ts +1 -0
- package/ShadersWGSL/pbr.fragment.js +2 -100
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.js +4 -2
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/XR/features/WebXRRawCameraAccess.js +1 -1
- package/XR/features/WebXRRawCameraAccess.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +19 -2
- package/scene.js +110 -13
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +0 -1
- package/sceneComponent.js +0 -1
- package/sceneComponent.js.map +1 -1
- package/types.d.ts +12 -0
- package/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebXRRawCameraAccess.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/features/WebXRRawCameraAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,eAAe,EAAyB,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAanE;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,oBAAoB;IAiD1D;;;;OAIG;IACH,YACI,iBAAsC,EACtB,UAAwC,EAAE;QAE1D,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAFT,YAAO,GAAP,OAAO,CAA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;;AAjJD;;GAEG;AACoB,yBAAI,GAAG,gBAAgB,CAAC,iBAAiB,AAArC,CAAsC;AAEjE;;;;GAIG;AACoB,4BAAO,GAAG,CAAC,AAAJ,CAAK;AA0IvC,oBAAoB,CAAC,eAAe,CAChC,oBAAoB,CAAC,IAAI,EACzB,CAAC,gBAAgB,EAAE,OAAO,EAAE,EAAE;IAC1B,OAAO,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC,EACD,oBAAoB,CAAC,OAAO,EAC5B,KAAK,CACR,CAAC","sourcesContent":["import { WebXRFeatureName, WebXRFeaturesManager } from \"../webXRFeaturesManager\";\r\nimport type { WebXRSessionManager } from \"../webXRSessionManager\";\r\nimport { WebXRAbstractFeature } from \"./WebXRAbstractFeature\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebGLHardwareTexture } from \"../../Engines/WebGL/webGLHardwareTexture\";\r\nimport { InternalTexture, InternalTextureSource } from \"../../Materials/Textures/internalTexture\";\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport type { ThinEngine } from \"../../Engines\";\r\n\r\n/**\r\n * Options for raw camera access\r\n */\r\nexport interface IWebXRRawCameraAccessOptions {\r\n /**\r\n * Keep the created textures and metadata when detaching the feature.\r\n */\r\n doNotDisposeOnDetach?: boolean;\r\n}\r\n\r\n/**\r\n * WebXR Feature for WebXR raw camera access\r\n * @since 6.31.0\r\n * @see https://immersive-web.github.io/raw-camera-access/\r\n */\r\nexport class WebXRRawCameraAccess extends WebXRAbstractFeature {\r\n private _cachedInternalTextures: InternalTexture[] = [];\r\n /**\r\n * This is an array of camera views\r\n * Note that mostly the array will contain a single view\r\n * If you want to know the order of the views, use the `viewIndex` array\r\n */\r\n public texturesData: BaseTexture[] = [];\r\n /**\r\n * If needed, this array will contain the eye definition of each texture in `texturesArray`\r\n */\r\n public viewIndex: string[] = [];\r\n\r\n /**\r\n * If needed, this array will contain the camera's intrinsics\r\n * You can use this data to convert from camera space to screen space and vice versa\r\n */\r\n public cameraIntrinsics: {\r\n u0: number;\r\n v0: number;\r\n ax: number;\r\n ay: number;\r\n gamma: number;\r\n width: number;\r\n height: number;\r\n viewportX: number;\r\n viewportY: number;\r\n }[] = [];\r\n\r\n /**\r\n * An observable that will notify when the camera's textures are updated\r\n */\r\n public onTexturesUpdatedObservable: Observable<BaseTexture[]> = new Observable();\r\n\r\n private _glBinding?: XRWebGLBinding;\r\n private _glContext: WebGLRenderingContext;\r\n\r\n /**\r\n * The module's name\r\n */\r\n public static readonly Name = WebXRFeatureName.RAW_CAMERA_ACCESS;\r\n\r\n /**\r\n * The (Babylon) version of this module.\r\n * This is an integer representing the implementation version.\r\n * This number does not correspond to the WebXR specs version\r\n */\r\n public static readonly Version = 1;\r\n\r\n /**\r\n * Creates a new instance of the feature\r\n * @param _xrSessionManager the WebXRSessionManager\r\n * @param options options for the Feature\r\n */\r\n constructor(\r\n _xrSessionManager: WebXRSessionManager,\r\n public readonly options: IWebXRRawCameraAccessOptions = {}\r\n ) {\r\n super(_xrSessionManager);\r\n this.xrNativeFeatureName = \"camera-access\";\r\n }\r\n\r\n public override attach(force?: boolean | undefined): boolean {\r\n if (!super.attach(force)) {\r\n return false;\r\n }\r\n\r\n this._glContext = (this._xrSessionManager.scene.getEngine() as ThinEngine)._gl;\r\n this._glBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext);\r\n\r\n return true;\r\n }\r\n\r\n public override detach(): boolean {\r\n if (!super.detach()) {\r\n return false;\r\n }\r\n this._glBinding = undefined;\r\n if (!this.options.doNotDisposeOnDetach) {\r\n this._cachedInternalTextures.forEach((t) => t.dispose());\r\n this.texturesData.forEach((t) => t.dispose());\r\n this._cachedInternalTextures.length = 0;\r\n this.texturesData.length = 0;\r\n this.cameraIntrinsics.length = 0;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Dispose this feature and all of the resources attached\r\n */\r\n public override dispose(): void {\r\n super.dispose();\r\n this.onTexturesUpdatedObservable.clear();\r\n }\r\n\r\n /**\r\n * @see https://github.com/immersive-web/raw-camera-access/blob/main/explainer.md\r\n * @param view the XRView to update\r\n * @param index the index of the view in the views array\r\n */\r\n private _updateCameraIntrinsics(view: XRView, index: number): void {\r\n const cameraViewport = {\r\n width: view.camera!.width,\r\n height: view.camera!.height,\r\n x: 0,\r\n y: 0,\r\n };\r\n const p = view.projectionMatrix;\r\n\r\n // Principal point in pixels (typically at or near the center of the viewport)\r\n const u0 = ((1 - p[8]) * cameraViewport.width) / 2 + cameraViewport.x;\r\n const v0 = ((1 - p[9]) * cameraViewport.height) / 2 + cameraViewport.y;\r\n\r\n // Focal lengths in pixels (these are equal for square pixels)\r\n const ax = (cameraViewport.width / 2) * p[0];\r\n const ay = (cameraViewport.height / 2) * p[5];\r\n\r\n // Skew factor in pixels (nonzero for rhomboid pixels)\r\n const gamma = (cameraViewport.width / 2) * p[4];\r\n this.cameraIntrinsics[index] = {\r\n u0,\r\n v0,\r\n ax,\r\n ay,\r\n gamma,\r\n width: cameraViewport.width,\r\n height: cameraViewport.height,\r\n viewportX: cameraViewport.x,\r\n viewportY: cameraViewport.y,\r\n };\r\n }\r\n\r\n private _updateInternalTextures(view: XRView, index = 0): boolean {\r\n if (!view.camera) {\r\n return false;\r\n }\r\n this.viewIndex[index] = view.eye;\r\n const lp = this._glBinding?.getCameraImage(view.camera);\r\n\r\n if (!this._cachedInternalTextures[index]) {\r\n const internalTexture = new InternalTexture(this._xrSessionManager.scene.getEngine(), InternalTextureSource.Unknown, true);\r\n internalTexture.invertY = false;\r\n internalTexture.format = Constants.TEXTUREFORMAT_RGBA;\r\n internalTexture.generateMipMaps = true;\r\n internalTexture.type = Constants.TEXTURETYPE_FLOAT;\r\n internalTexture.samplingMode = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR;\r\n internalTexture.width = view.camera.width;\r\n internalTexture.height = view.camera.height;\r\n internalTexture._cachedWrapU = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n internalTexture._cachedWrapV = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n internalTexture._hardwareTexture = new WebGLHardwareTexture(lp, this._glContext);\r\n this._cachedInternalTextures[index] = internalTexture;\r\n // create the base texture\r\n const texture = new BaseTexture(this._xrSessionManager.scene);\r\n texture.name = `WebXR Raw Camera Access (${index})`;\r\n texture._texture = this._cachedInternalTextures[index];\r\n this.texturesData[index] = texture;\r\n // get the camera intrinsics\r\n this._updateCameraIntrinsics(view, index);\r\n } else {\r\n // make sure the webgl texture is updated. Should happen automatically\r\n this._cachedInternalTextures[index]._hardwareTexture?.set(lp);\r\n }\r\n this._cachedInternalTextures[index].isReady = true;\r\n return true;\r\n }\r\n\r\n protected _onXRFrame(_xrFrame: XRFrame): void {\r\n const referenceSPace = this._xrSessionManager.referenceSpace;\r\n\r\n const pose = _xrFrame.getViewerPose(referenceSPace);\r\n if (!pose || !pose.views) {\r\n return;\r\n }\r\n let updated = true;\r\n pose.views.forEach((view, index) => {\r\n updated = updated && this._updateInternalTextures(view, index);\r\n });\r\n if (updated) {\r\n this.onTexturesUpdatedObservable.notifyObservers(this.texturesData);\r\n }\r\n }\r\n}\r\n\r\nWebXRFeaturesManager.AddWebXRFeature(\r\n WebXRRawCameraAccess.Name,\r\n (xrSessionManager, options) => {\r\n return () => new WebXRRawCameraAccess(xrSessionManager, options);\r\n },\r\n WebXRRawCameraAccess.Version,\r\n false\r\n);\r\n"]}
|
|
1
|
+
{"version":3,"file":"WebXRRawCameraAccess.js","sourceRoot":"","sources":["../../../../../dev/core/src/XR/features/WebXRRawCameraAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,E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,CAAC,KAAK,EAAE;YACtB,OAAO;SACV;QACD,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC/B,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC,uBAAuB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,EAAE;YACT,IAAI,CAAC,2BAA2B,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACvE;IACL,CAAC;;AAjJD;;GAEG;AACoB,yBAAI,GAAG,gBAAgB,CAAC,iBAAiB,AAArC,CAAsC;AAEjE;;;;GAIG;AACoB,4BAAO,GAAG,CAAC,AAAJ,CAAK;AA0IvC,oBAAoB,CAAC,eAAe,CAChC,oBAAoB,CAAC,IAAI,EACzB,CAAC,gBAAgB,EAAE,OAAO,EAAE,EAAE;IAC1B,OAAO,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC,EACD,oBAAoB,CAAC,OAAO,EAC5B,KAAK,CACR,CAAC","sourcesContent":["import { WebXRFeatureName, WebXRFeaturesManager } from \"../webXRFeaturesManager\";\r\nimport type { WebXRSessionManager } from \"../webXRSessionManager\";\r\nimport { WebXRAbstractFeature } from \"./WebXRAbstractFeature\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebGLHardwareTexture } from \"../../Engines/WebGL/webGLHardwareTexture\";\r\nimport { InternalTexture, InternalTextureSource } from \"../../Materials/Textures/internalTexture\";\r\nimport { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport type { ThinEngine } from \"../../Engines\";\r\n\r\n/**\r\n * Options for raw camera access\r\n */\r\nexport interface IWebXRRawCameraAccessOptions {\r\n /**\r\n * Keep the created textures and metadata when detaching the feature.\r\n */\r\n doNotDisposeOnDetach?: boolean;\r\n}\r\n\r\n/**\r\n * WebXR Feature for WebXR raw camera access\r\n * @since 6.31.0\r\n * @see https://immersive-web.github.io/raw-camera-access/\r\n */\r\nexport class WebXRRawCameraAccess extends WebXRAbstractFeature {\r\n private _cachedInternalTextures: InternalTexture[] = [];\r\n /**\r\n * This is an array of camera views\r\n * Note that mostly the array will contain a single view\r\n * If you want to know the order of the views, use the `viewIndex` array\r\n */\r\n public texturesData: BaseTexture[] = [];\r\n /**\r\n * If needed, this array will contain the eye definition of each texture in `texturesArray`\r\n */\r\n public viewIndex: string[] = [];\r\n\r\n /**\r\n * If needed, this array will contain the camera's intrinsics\r\n * You can use this data to convert from camera space to screen space and vice versa\r\n */\r\n public cameraIntrinsics: {\r\n u0: number;\r\n v0: number;\r\n ax: number;\r\n ay: number;\r\n gamma: number;\r\n width: number;\r\n height: number;\r\n viewportX: number;\r\n viewportY: number;\r\n }[] = [];\r\n\r\n /**\r\n * An observable that will notify when the camera's textures are updated\r\n */\r\n public onTexturesUpdatedObservable: Observable<BaseTexture[]> = new Observable();\r\n\r\n private _glBinding?: XRWebGLBinding;\r\n private _glContext: WebGLRenderingContext;\r\n\r\n /**\r\n * The module's name\r\n */\r\n public static readonly Name = WebXRFeatureName.RAW_CAMERA_ACCESS;\r\n\r\n /**\r\n * The (Babylon) version of this module.\r\n * This is an integer representing the implementation version.\r\n * This number does not correspond to the WebXR specs version\r\n */\r\n public static readonly Version = 1;\r\n\r\n /**\r\n * Creates a new instance of the feature\r\n * @param _xrSessionManager the WebXRSessionManager\r\n * @param options options for the Feature\r\n */\r\n constructor(\r\n _xrSessionManager: WebXRSessionManager,\r\n public readonly options: IWebXRRawCameraAccessOptions = {}\r\n ) {\r\n super(_xrSessionManager);\r\n this.xrNativeFeatureName = \"camera-access\";\r\n }\r\n\r\n public override attach(force?: boolean | undefined): boolean {\r\n if (!super.attach(force)) {\r\n return false;\r\n }\r\n\r\n this._glContext = (this._xrSessionManager.scene.getEngine() as ThinEngine)._gl;\r\n this._glBinding = new XRWebGLBinding(this._xrSessionManager.session, this._glContext);\r\n\r\n return true;\r\n }\r\n\r\n public override detach(): boolean {\r\n if (!super.detach()) {\r\n return false;\r\n }\r\n this._glBinding = undefined;\r\n if (!this.options.doNotDisposeOnDetach) {\r\n this._cachedInternalTextures.forEach((t) => t.dispose());\r\n this.texturesData.forEach((t) => t.dispose());\r\n this._cachedInternalTextures.length = 0;\r\n this.texturesData.length = 0;\r\n this.cameraIntrinsics.length = 0;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Dispose this feature and all of the resources attached\r\n */\r\n public override dispose(): void {\r\n super.dispose();\r\n this.onTexturesUpdatedObservable.clear();\r\n }\r\n\r\n /**\r\n * @see https://github.com/immersive-web/raw-camera-access/blob/main/explainer.md\r\n * @param view the XRView to update\r\n * @param index the index of the view in the views array\r\n */\r\n private _updateCameraIntrinsics(view: XRView, index: number): void {\r\n const cameraViewport = {\r\n width: view.camera!.width,\r\n height: view.camera!.height,\r\n x: 0,\r\n y: 0,\r\n };\r\n const p = view.projectionMatrix;\r\n\r\n // Principal point in pixels (typically at or near the center of the viewport)\r\n const u0 = ((1 - p[8]) * cameraViewport.width) / 2 + cameraViewport.x;\r\n const v0 = ((1 - p[9]) * cameraViewport.height) / 2 + cameraViewport.y;\r\n\r\n // Focal lengths in pixels (these are equal for square pixels)\r\n const ax = (cameraViewport.width / 2) * p[0];\r\n const ay = (cameraViewport.height / 2) * p[5];\r\n\r\n // Skew factor in pixels (nonzero for rhomboid pixels)\r\n const gamma = (cameraViewport.width / 2) * p[4];\r\n this.cameraIntrinsics[index] = {\r\n u0,\r\n v0,\r\n ax,\r\n ay,\r\n gamma,\r\n width: cameraViewport.width,\r\n height: cameraViewport.height,\r\n viewportX: cameraViewport.x,\r\n viewportY: cameraViewport.y,\r\n };\r\n }\r\n\r\n private _updateInternalTextures(view: XRView, index = 0): boolean {\r\n if (!view.camera) {\r\n return false;\r\n }\r\n this.viewIndex[index] = view.eye;\r\n const lp = this._glBinding?.getCameraImage(view.camera);\r\n\r\n if (!this._cachedInternalTextures[index]) {\r\n const internalTexture = new InternalTexture(this._xrSessionManager.scene.getEngine(), InternalTextureSource.Unknown, true);\r\n internalTexture.invertY = false;\r\n internalTexture.format = Constants.TEXTUREFORMAT_RGBA;\r\n internalTexture.generateMipMaps = true;\r\n internalTexture.type = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n internalTexture.samplingMode = Constants.TEXTURE_LINEAR_LINEAR_MIPLINEAR;\r\n internalTexture.width = view.camera.width;\r\n internalTexture.height = view.camera.height;\r\n internalTexture._cachedWrapU = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n internalTexture._cachedWrapV = Constants.TEXTURE_WRAP_ADDRESSMODE;\r\n internalTexture._hardwareTexture = new WebGLHardwareTexture(lp, this._glContext);\r\n this._cachedInternalTextures[index] = internalTexture;\r\n // create the base texture\r\n const texture = new BaseTexture(this._xrSessionManager.scene);\r\n texture.name = `WebXR Raw Camera Access (${index})`;\r\n texture._texture = this._cachedInternalTextures[index];\r\n this.texturesData[index] = texture;\r\n // get the camera intrinsics\r\n this._updateCameraIntrinsics(view, index);\r\n } else {\r\n // make sure the webgl texture is updated. Should happen automatically\r\n this._cachedInternalTextures[index]._hardwareTexture?.set(lp);\r\n }\r\n this._cachedInternalTextures[index].isReady = true;\r\n return true;\r\n }\r\n\r\n protected _onXRFrame(_xrFrame: XRFrame): void {\r\n const referenceSPace = this._xrSessionManager.referenceSpace;\r\n\r\n const pose = _xrFrame.getViewerPose(referenceSPace);\r\n if (!pose || !pose.views) {\r\n return;\r\n }\r\n let updated = true;\r\n pose.views.forEach((view, index) => {\r\n updated = updated && this._updateInternalTextures(view, index);\r\n });\r\n if (updated) {\r\n this.onTexturesUpdatedObservable.notifyObservers(this.texturesData);\r\n }\r\n }\r\n}\r\n\r\nWebXRFeaturesManager.AddWebXRFeature(\r\n WebXRRawCameraAccess.Name,\r\n (xrSessionManager, options) => {\r\n return () => new WebXRRawCameraAccess(xrSessionManager, options);\r\n },\r\n WebXRRawCameraAccess.Version,\r\n false\r\n);\r\n"]}
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dev/core/src/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Actions/index\";\r\nexport * from \"./Animations/index\";\r\nexport * from \"./assetContainer\";\r\nexport * from \"./Audio/index\";\r\nexport * from \"./BakedVertexAnimation/index\";\r\nexport * from \"./Behaviors/index\";\r\nexport * from \"./Bones/index\";\r\nexport * from \"./Buffers/index\";\r\nexport * from \"./Cameras/index\";\r\nexport * from \"./Collisions/index\";\r\nexport * from \"./Compute/index\";\r\nexport * from \"./Culling/index\";\r\nexport * from \"./Debug/index\";\r\nexport * from \"./DeviceInput/index\";\r\nexport * from \"./Engines/index\";\r\nexport * from \"./Events/index\";\r\nexport * from \"./Gamepads/index\";\r\nexport * from \"./Gizmos/index\";\r\nexport * from \"./Helpers/index\";\r\nexport * from \"./Instrumentation/index\";\r\nexport * from \"./Layers/index\";\r\nexport * from \"./LensFlares/index\";\r\nexport * from \"./Lights/index\";\r\nexport * from \"./Loading/index\";\r\nexport * from \"./Materials/index\";\r\nexport * from \"./Maths/index\";\r\nexport * from \"./Meshes/index\";\r\nexport * from \"./Morph/index\";\r\nexport * from \"./Navigation/index\";\r\nexport * from \"./node\";\r\nexport * from \"./Offline/index\";\r\nexport * from \"./Particles/index\";\r\nexport * from \"./Physics/index\";\r\nexport * from \"./PostProcesses/index\";\r\nexport * from \"./Probes/index\";\r\nexport * from \"./Rendering/index\";\r\nexport * from \"./scene\";\r\nexport * from \"./sceneComponent\";\r\nexport * from \"./Sprites/index\";\r\nexport * from \"./States/index\";\r\nexport * from \"./Misc/index\";\r\nexport * from \"./XR/index\";\r\nexport * from \"./types\";\r\nexport * from \"./Compat/index\";\r\nexport * from \"./FlowGraph/index\";\r\nexport * from \"./ObjectModel/index\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../dev/core/src/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Actions/index\";\r\nexport * from \"./Animations/index\";\r\nexport * from \"./assetContainer\";\r\nexport * from \"./Audio/index\";\r\nexport * from \"./BakedVertexAnimation/index\";\r\nexport * from \"./Behaviors/index\";\r\nexport * from \"./Bones/index\";\r\nexport * from \"./Buffers/index\";\r\nexport * from \"./Cameras/index\";\r\nexport * from \"./Collisions/index\";\r\nexport * from \"./Compute/index\";\r\nexport * from \"./Culling/index\";\r\nexport * from \"./Debug/index\";\r\nexport * from \"./DeviceInput/index\";\r\nexport * from \"./Engines/index\";\r\nexport * from \"./Events/index\";\r\nexport * from \"./Gamepads/index\";\r\nexport * from \"./Gizmos/index\";\r\nexport * from \"./Helpers/index\";\r\nexport * from \"./Instrumentation/index\";\r\nexport * from \"./Layers/index\";\r\nexport * from \"./LensFlares/index\";\r\nexport * from \"./Lights/index\";\r\nexport * from \"./Loading/index\";\r\nexport * from \"./Materials/index\";\r\nexport * from \"./Maths/index\";\r\nexport * from \"./Meshes/index\";\r\nexport * from \"./Morph/index\";\r\nexport * from \"./Navigation/index\";\r\nexport * from \"./node\";\r\nexport * from \"./Offline/index\";\r\nexport * from \"./Particles/index\";\r\nexport * from \"./Physics/index\";\r\nexport * from \"./PostProcesses/index\";\r\nexport * from \"./Probes/index\";\r\nexport * from \"./Rendering/index\";\r\nexport * from \"./scene\";\r\nexport * from \"./sceneComponent\";\r\nexport * from \"./Sprites/index\";\r\nexport * from \"./States/index\";\r\nexport * from \"./Misc/index\";\r\nexport * from \"./XR/index\";\r\nexport * from \"./types\";\r\nexport * from \"./Compat/index\";\r\nexport * from \"./FlowGraph/index\";\r\nexport * from \"./ObjectModel/index\";\r\nexport * from \"./FrameGraph/index\";\r\n"]}
|
package/package.json
CHANGED
package/scene.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ import type { Node } from "./node";
|
|
|
53
53
|
import type { Animation } from "./Animations/animation";
|
|
54
54
|
import type { Animatable } from "./Animations/animatable.core";
|
|
55
55
|
import type { AbstractEngine } from "./Engines/abstractEngine";
|
|
56
|
+
import type { FrameGraph } from "./FrameGraph/frameGraph";
|
|
56
57
|
import type { IAssetContainer } from "./IAssetContainer";
|
|
57
58
|
import type { EffectLayer } from "./Layers/effectLayer";
|
|
58
59
|
import type { Sound } from "./Audio/sound";
|
|
@@ -155,10 +156,16 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
155
156
|
* Gets or sets a boolean that indicates if the scene must clear the depth and stencil buffers before rendering a frame
|
|
156
157
|
*/
|
|
157
158
|
autoClearDepthAndStencil: boolean;
|
|
159
|
+
private _clearColor;
|
|
160
|
+
/**
|
|
161
|
+
* Observable triggered when the performance priority is changed
|
|
162
|
+
*/
|
|
163
|
+
onClearColorChangedObservable: Observable<Color4>;
|
|
158
164
|
/**
|
|
159
165
|
* Defines the color used to clear the render buffer (Default is (0.2, 0.2, 0.3, 1.0))
|
|
160
166
|
*/
|
|
161
|
-
clearColor: Color4;
|
|
167
|
+
get clearColor(): Color4;
|
|
168
|
+
set clearColor(value: Color4);
|
|
162
169
|
/**
|
|
163
170
|
* Defines the color used to simulate the ambient color (Default is (0, 0, 0))
|
|
164
171
|
*/
|
|
@@ -867,6 +874,13 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
867
874
|
*/
|
|
868
875
|
set texturesEnabled(value: boolean);
|
|
869
876
|
get texturesEnabled(): boolean;
|
|
877
|
+
private _frameGraph;
|
|
878
|
+
private _currentCustomRenderFunction?;
|
|
879
|
+
/**
|
|
880
|
+
* Gets or sets the frame graph used to render the scene. If set, the scene will use the frame graph to render the scene instead of the default render loop.
|
|
881
|
+
*/
|
|
882
|
+
get frameGraph(): Nullable<FrameGraph>;
|
|
883
|
+
set frameGraph(value: Nullable<FrameGraph>);
|
|
870
884
|
/**
|
|
871
885
|
* Gets or sets a boolean indicating if physic engines are enabled on this scene
|
|
872
886
|
*/
|
|
@@ -2019,6 +2033,8 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
2019
2033
|
unfreezeActiveMeshes(): Scene;
|
|
2020
2034
|
private _executeActiveContainerCleanup;
|
|
2021
2035
|
private _evaluateActiveMeshes;
|
|
2036
|
+
/** @internal */
|
|
2037
|
+
_prepareSkeleton(mesh: AbstractMesh): void;
|
|
2022
2038
|
private _activeMesh;
|
|
2023
2039
|
/**
|
|
2024
2040
|
* Update the transform matrix to update from the current active camera
|
|
@@ -2058,7 +2074,8 @@ export declare class Scene implements IAnimatable, IClipPlanesHolder, IAssetCont
|
|
|
2058
2074
|
/**
|
|
2059
2075
|
* If this function is defined it will take precedence over the standard render() function.
|
|
2060
2076
|
*/
|
|
2061
|
-
customRenderFunction?: () => void;
|
|
2077
|
+
customRenderFunction?: (updateCameras: boolean, ignoreAnimations: boolean) => void;
|
|
2078
|
+
private _renderWithFrameGraph;
|
|
2062
2079
|
/**
|
|
2063
2080
|
* Render the scene
|
|
2064
2081
|
* @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default)
|
package/scene.js
CHANGED
|
@@ -61,6 +61,18 @@ export class Scene {
|
|
|
61
61
|
static CollisionCoordinatorFactory() {
|
|
62
62
|
throw _WarnImport("DefaultCollisionCoordinator");
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Defines the color used to clear the render buffer (Default is (0.2, 0.2, 0.3, 1.0))
|
|
66
|
+
*/
|
|
67
|
+
get clearColor() {
|
|
68
|
+
return this._clearColor;
|
|
69
|
+
}
|
|
70
|
+
set clearColor(value) {
|
|
71
|
+
if (value !== this._clearColor) {
|
|
72
|
+
this._clearColor = value;
|
|
73
|
+
this.onClearColorChangedObservable.notifyObservers(this._clearColor);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
64
76
|
/**
|
|
65
77
|
* Default image processing configuration used either in the rendering
|
|
66
78
|
* Forward main pass or through the imageProcessingPostProcess if present.
|
|
@@ -531,6 +543,26 @@ export class Scene {
|
|
|
531
543
|
get texturesEnabled() {
|
|
532
544
|
return this._texturesEnabled;
|
|
533
545
|
}
|
|
546
|
+
/**
|
|
547
|
+
* Gets or sets the frame graph used to render the scene. If set, the scene will use the frame graph to render the scene instead of the default render loop.
|
|
548
|
+
*/
|
|
549
|
+
get frameGraph() {
|
|
550
|
+
return this._frameGraph;
|
|
551
|
+
}
|
|
552
|
+
set frameGraph(value) {
|
|
553
|
+
if (this._frameGraph) {
|
|
554
|
+
this._frameGraph = value;
|
|
555
|
+
if (!value) {
|
|
556
|
+
this.customRenderFunction = this._currentCustomRenderFunction;
|
|
557
|
+
}
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
this._frameGraph = value;
|
|
561
|
+
if (value) {
|
|
562
|
+
this._currentCustomRenderFunction = this.customRenderFunction;
|
|
563
|
+
this.customRenderFunction = this._renderWithFrameGraph;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
534
566
|
/**
|
|
535
567
|
* Gets or sets a boolean indicating if skeletons are enabled on this scene
|
|
536
568
|
*/
|
|
@@ -627,10 +659,11 @@ export class Scene {
|
|
|
627
659
|
* Gets or sets a boolean that indicates if the scene must clear the depth and stencil buffers before rendering a frame
|
|
628
660
|
*/
|
|
629
661
|
this.autoClearDepthAndStencil = true;
|
|
662
|
+
this._clearColor = new Color4(0.2, 0.2, 0.3, 1.0);
|
|
630
663
|
/**
|
|
631
|
-
*
|
|
664
|
+
* Observable triggered when the performance priority is changed
|
|
632
665
|
*/
|
|
633
|
-
this.
|
|
666
|
+
this.onClearColorChangedObservable = new Observable();
|
|
634
667
|
/**
|
|
635
668
|
* Defines the color used to simulate the ambient color (Default is (0, 0, 0))
|
|
636
669
|
*/
|
|
@@ -1063,6 +1096,7 @@ export class Scene {
|
|
|
1063
1096
|
this._unObserveActiveCameras = null;
|
|
1064
1097
|
// Textures
|
|
1065
1098
|
this._texturesEnabled = true;
|
|
1099
|
+
this._frameGraph = null;
|
|
1066
1100
|
// Physics
|
|
1067
1101
|
/**
|
|
1068
1102
|
* Gets or sets a boolean indicating if physic engines are enabled on this scene
|
|
@@ -3438,16 +3472,23 @@ export class Scene {
|
|
|
3438
3472
|
this.onAfterParticlesRenderingObservable.notifyObservers(this);
|
|
3439
3473
|
}
|
|
3440
3474
|
}
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3475
|
+
/** @internal */
|
|
3476
|
+
_prepareSkeleton(mesh) {
|
|
3477
|
+
if (!this._skeletonsEnabled || !mesh.skeleton) {
|
|
3478
|
+
return;
|
|
3479
|
+
}
|
|
3480
|
+
if (this._activeSkeletons.pushNoDuplicate(mesh.skeleton)) {
|
|
3481
|
+
mesh.skeleton.prepare();
|
|
3482
|
+
this._activeBones.addCount(mesh.skeleton.bones.length, false);
|
|
3483
|
+
}
|
|
3484
|
+
if (!mesh.computeBonesUsingShaders) {
|
|
3485
|
+
if (this._softwareSkinnedMeshes.pushNoDuplicate(mesh) && this.frameGraph) {
|
|
3486
|
+
mesh.applySkeleton(mesh.skeleton);
|
|
3449
3487
|
}
|
|
3450
3488
|
}
|
|
3489
|
+
}
|
|
3490
|
+
_activeMesh(sourceMesh, mesh) {
|
|
3491
|
+
this._prepareSkeleton(mesh);
|
|
3451
3492
|
let forcePush = sourceMesh.hasInstances || sourceMesh.isAnInstance || this.dispatchAllSubMeshesOfActiveMeshes || this._skipFrustumClipping || mesh.alwaysSelectAsActiveMesh;
|
|
3452
3493
|
if (mesh && mesh.subMeshes && mesh.subMeshes.length > 0) {
|
|
3453
3494
|
const subMeshes = this.getActiveSubMeshCandidates(mesh);
|
|
@@ -3505,7 +3546,7 @@ export class Scene {
|
|
|
3505
3546
|
}
|
|
3506
3547
|
else if (!rtt.skipInitialClear && !camera.isRightCamera) {
|
|
3507
3548
|
if (this.autoClear) {
|
|
3508
|
-
this._engine.clear(rtt.clearColor || this.
|
|
3549
|
+
this._engine.clear(rtt.clearColor || this._clearColor, !rtt._cleared, true, true);
|
|
3509
3550
|
}
|
|
3510
3551
|
rtt._cleared = true;
|
|
3511
3552
|
}
|
|
@@ -3755,7 +3796,7 @@ export class Scene {
|
|
|
3755
3796
|
}
|
|
3756
3797
|
_clear() {
|
|
3757
3798
|
if (this.autoClearDepthAndStencil || this.autoClear) {
|
|
3758
|
-
this._engine.clear(this.
|
|
3799
|
+
this._engine.clear(this._clearColor, this.autoClear || this.forceWireframe || this.forcePointsCloud, this.autoClearDepthAndStencil, this.autoClearDepthAndStencil);
|
|
3759
3800
|
}
|
|
3760
3801
|
}
|
|
3761
3802
|
_checkCameraRenderTarget(camera) {
|
|
@@ -3783,6 +3824,61 @@ export class Scene {
|
|
|
3783
3824
|
mesh.resetDrawCache(passId);
|
|
3784
3825
|
}
|
|
3785
3826
|
}
|
|
3827
|
+
_renderWithFrameGraph(updateCameras = true, ignoreAnimations = false) {
|
|
3828
|
+
this.activeCamera = null;
|
|
3829
|
+
this._activeParticleSystems.reset();
|
|
3830
|
+
this._activeSkeletons.reset();
|
|
3831
|
+
// Update Cameras
|
|
3832
|
+
if (updateCameras) {
|
|
3833
|
+
for (const camera of this.cameras) {
|
|
3834
|
+
camera.update();
|
|
3835
|
+
if (camera.cameraRigMode !== 0) {
|
|
3836
|
+
// rig cameras
|
|
3837
|
+
for (let index = 0; index < camera._rigCameras.length; index++) {
|
|
3838
|
+
camera._rigCameras[index].update();
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
// We must keep these steps because the procedural texture component relies on them.
|
|
3844
|
+
// TODO: move the procedural texture component to the frame graph.
|
|
3845
|
+
for (const step of this._beforeClearStage) {
|
|
3846
|
+
step.action();
|
|
3847
|
+
}
|
|
3848
|
+
// Process meshes
|
|
3849
|
+
const meshes = this.getActiveMeshCandidates();
|
|
3850
|
+
const len = meshes.length;
|
|
3851
|
+
for (let i = 0; i < len; i++) {
|
|
3852
|
+
const mesh = meshes.data[i];
|
|
3853
|
+
if (mesh.isBlocked) {
|
|
3854
|
+
continue;
|
|
3855
|
+
}
|
|
3856
|
+
this._totalVertices.addCount(mesh.getTotalVertices(), false);
|
|
3857
|
+
if (!mesh.isReady() || !mesh.isEnabled() || mesh.scaling.hasAZeroComponent) {
|
|
3858
|
+
continue;
|
|
3859
|
+
}
|
|
3860
|
+
mesh.computeWorldMatrix();
|
|
3861
|
+
if (mesh.actionManager && mesh.actionManager.hasSpecificTriggers2(12, 13)) {
|
|
3862
|
+
this._meshesForIntersections.pushNoDuplicate(mesh);
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
// Animate Particle systems
|
|
3866
|
+
if (this.particlesEnabled) {
|
|
3867
|
+
for (let particleIndex = 0; particleIndex < this.particleSystems.length; particleIndex++) {
|
|
3868
|
+
const particleSystem = this.particleSystems[particleIndex];
|
|
3869
|
+
if (!particleSystem.isStarted() || !particleSystem.emitter) {
|
|
3870
|
+
continue;
|
|
3871
|
+
}
|
|
3872
|
+
const emitter = particleSystem.emitter;
|
|
3873
|
+
if (!emitter.position || emitter.isEnabled()) {
|
|
3874
|
+
this._activeParticleSystems.push(particleSystem);
|
|
3875
|
+
particleSystem.animate();
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
// Render the graph
|
|
3880
|
+
this.frameGraph?.execute();
|
|
3881
|
+
}
|
|
3786
3882
|
/**
|
|
3787
3883
|
* Render the scene
|
|
3788
3884
|
* @param updateCameras defines a boolean indicating if cameras must update according to their inputs (true by default)
|
|
@@ -3852,7 +3948,7 @@ export class Scene {
|
|
|
3852
3948
|
if (this.customRenderFunction) {
|
|
3853
3949
|
this._renderId++;
|
|
3854
3950
|
this._engine.currentRenderPassId = 0;
|
|
3855
|
-
this.customRenderFunction();
|
|
3951
|
+
this.customRenderFunction(updateCameras, ignoreAnimations);
|
|
3856
3952
|
}
|
|
3857
3953
|
else {
|
|
3858
3954
|
const engine = this.getEngine();
|
|
@@ -4138,6 +4234,7 @@ export class Scene {
|
|
|
4138
4234
|
this.onKeyboardObservable.clear();
|
|
4139
4235
|
this.onActiveCameraChanged.clear();
|
|
4140
4236
|
this.onScenePerformancePriorityChangedObservable.clear();
|
|
4237
|
+
this.onClearColorChangedObservable.clear();
|
|
4141
4238
|
this._isDisposed = true;
|
|
4142
4239
|
}
|
|
4143
4240
|
_disposeList(items, callback) {
|