@babylonjs/core 7.31.2 → 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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { MaterialDefines } from "./materialDefines.js";
|
|
2
|
+
import type { Effect } from "./effect.js";
|
|
3
|
+
import type { Mesh } from "../Meshes/mesh.js";
|
|
4
|
+
import type { AbstractMesh } from "../Meshes/abstractMesh.js";
|
|
5
|
+
import { Matrix } from "../Maths/math.vector.js";
|
|
6
|
+
/**
|
|
7
|
+
* Type of clear operation to perform on a geometry texture.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum GeometryRenderingTextureClearType {
|
|
10
|
+
/**
|
|
11
|
+
* Clear the texture with zero.
|
|
12
|
+
*/
|
|
13
|
+
Zero = 0,
|
|
14
|
+
/**
|
|
15
|
+
* Clear the texture with one.
|
|
16
|
+
*/
|
|
17
|
+
One = 1,
|
|
18
|
+
/**
|
|
19
|
+
* Clear the texture with the maximum view Z value.
|
|
20
|
+
*/
|
|
21
|
+
MaxViewZ = 2
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for geometry rendering.
|
|
25
|
+
* A configuration is created for each rendering pass a geometry rendering is used in.
|
|
26
|
+
*/
|
|
27
|
+
export type GeometryRenderingConfiguration = {
|
|
28
|
+
/**
|
|
29
|
+
* Defines used for the geometry rendering.
|
|
30
|
+
*/
|
|
31
|
+
defines: {
|
|
32
|
+
[name: string]: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Previous world matrices for meshes.
|
|
36
|
+
*/
|
|
37
|
+
previousWorldMatrices: {
|
|
38
|
+
[index: number]: Matrix;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Previous view projection matrix.
|
|
42
|
+
*/
|
|
43
|
+
previousViewProjection: Matrix;
|
|
44
|
+
/**
|
|
45
|
+
* Current view projection matrix.
|
|
46
|
+
*/
|
|
47
|
+
currentViewProjection: Matrix;
|
|
48
|
+
/**
|
|
49
|
+
* Previous bones for skinned meshes.
|
|
50
|
+
*/
|
|
51
|
+
previousBones: {
|
|
52
|
+
[index: number]: Float32Array;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Last frame id the configuration was updated.
|
|
56
|
+
*/
|
|
57
|
+
lastUpdateFrameId: number;
|
|
58
|
+
/**
|
|
59
|
+
* List of excluded skinned meshes.
|
|
60
|
+
*/
|
|
61
|
+
excludedSkinnedMesh: AbstractMesh[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Helper class to manage geometry rendering.
|
|
65
|
+
*/
|
|
66
|
+
export declare class MaterialHelperGeometryRendering {
|
|
67
|
+
/**
|
|
68
|
+
* Descriptions of the geometry textures.
|
|
69
|
+
*/
|
|
70
|
+
static readonly GeometryTextureDescriptions: {
|
|
71
|
+
type: number;
|
|
72
|
+
name: string;
|
|
73
|
+
clearType: GeometryRenderingTextureClearType;
|
|
74
|
+
define: string;
|
|
75
|
+
defineIndex: string;
|
|
76
|
+
}[];
|
|
77
|
+
private static _Configurations;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a new geometry rendering configuration.
|
|
80
|
+
* @param renderPassId Render pass id the configuration is created for.
|
|
81
|
+
* @returns The created configuration.
|
|
82
|
+
*/
|
|
83
|
+
static CreateConfiguration(renderPassId: number): GeometryRenderingConfiguration;
|
|
84
|
+
/**
|
|
85
|
+
* Deletes a geometry rendering configuration.
|
|
86
|
+
* @param renderPassId The render pass id of the configuration to delete.
|
|
87
|
+
*/
|
|
88
|
+
static DeleteConfiguration(renderPassId: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* Gets a geometry rendering configuration.
|
|
91
|
+
* @param renderPassId The render pass id of the configuration to get.
|
|
92
|
+
* @returns The configuration.
|
|
93
|
+
*/
|
|
94
|
+
static GetConfiguration(renderPassId: number): GeometryRenderingConfiguration;
|
|
95
|
+
/**
|
|
96
|
+
* Adds uniforms and samplers for geometry rendering.
|
|
97
|
+
* @param uniforms The array of uniforms to add to.
|
|
98
|
+
* @param _samplers The array of samplers to add to.
|
|
99
|
+
*/
|
|
100
|
+
static AddUniformsAndSamplers(uniforms: string[], _samplers: string[]): void;
|
|
101
|
+
/**
|
|
102
|
+
* Marks a list of meshes as dirty for geometry rendering.
|
|
103
|
+
* @param renderPassId The render pass id the meshes are marked as dirty for.
|
|
104
|
+
* @param meshes The list of meshes to mark as dirty.
|
|
105
|
+
*/
|
|
106
|
+
static MarkAsDirty(renderPassId: number, meshes: AbstractMesh[]): void;
|
|
107
|
+
/**
|
|
108
|
+
* Prepares defines for geometry rendering.
|
|
109
|
+
* @param renderPassId The render pass id the defines are prepared for.
|
|
110
|
+
* @param mesh The mesh the defines are prepared for.
|
|
111
|
+
* @param defines The defines to update according to the geometry rendering configuration.
|
|
112
|
+
*/
|
|
113
|
+
static PrepareDefines(renderPassId: number, mesh: AbstractMesh, defines: MaterialDefines): void;
|
|
114
|
+
/**
|
|
115
|
+
* Binds geometry rendering data for a mesh.
|
|
116
|
+
* @param renderPassId The render pass id the geometry rendering data is bound for.
|
|
117
|
+
* @param effect The effect to bind the geometry rendering data to.
|
|
118
|
+
* @param mesh The mesh to bind the geometry rendering data for.
|
|
119
|
+
* @param world The world matrix of the mesh.
|
|
120
|
+
*/
|
|
121
|
+
static Bind(renderPassId: number, effect: Effect, mesh: Mesh, world: Matrix): void;
|
|
122
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
|
|
2
|
+
import { Matrix } from "../Maths/math.vector.js";
|
|
3
|
+
/**
|
|
4
|
+
* Type of clear operation to perform on a geometry texture.
|
|
5
|
+
*/
|
|
6
|
+
export var GeometryRenderingTextureClearType;
|
|
7
|
+
(function (GeometryRenderingTextureClearType) {
|
|
8
|
+
/**
|
|
9
|
+
* Clear the texture with zero.
|
|
10
|
+
*/
|
|
11
|
+
GeometryRenderingTextureClearType[GeometryRenderingTextureClearType["Zero"] = 0] = "Zero";
|
|
12
|
+
/**
|
|
13
|
+
* Clear the texture with one.
|
|
14
|
+
*/
|
|
15
|
+
GeometryRenderingTextureClearType[GeometryRenderingTextureClearType["One"] = 1] = "One";
|
|
16
|
+
/**
|
|
17
|
+
* Clear the texture with the maximum view Z value.
|
|
18
|
+
*/
|
|
19
|
+
GeometryRenderingTextureClearType[GeometryRenderingTextureClearType["MaxViewZ"] = 2] = "MaxViewZ";
|
|
20
|
+
})(GeometryRenderingTextureClearType || (GeometryRenderingTextureClearType = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Helper class to manage geometry rendering.
|
|
23
|
+
*/
|
|
24
|
+
export class MaterialHelperGeometryRendering {
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new geometry rendering configuration.
|
|
27
|
+
* @param renderPassId Render pass id the configuration is created for.
|
|
28
|
+
* @returns The created configuration.
|
|
29
|
+
*/
|
|
30
|
+
static CreateConfiguration(renderPassId) {
|
|
31
|
+
MaterialHelperGeometryRendering._Configurations[renderPassId] = {
|
|
32
|
+
defines: {},
|
|
33
|
+
previousWorldMatrices: {},
|
|
34
|
+
previousViewProjection: Matrix.Zero(),
|
|
35
|
+
currentViewProjection: Matrix.Zero(),
|
|
36
|
+
previousBones: {},
|
|
37
|
+
lastUpdateFrameId: -1,
|
|
38
|
+
excludedSkinnedMesh: [],
|
|
39
|
+
};
|
|
40
|
+
return MaterialHelperGeometryRendering._Configurations[renderPassId];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Deletes a geometry rendering configuration.
|
|
44
|
+
* @param renderPassId The render pass id of the configuration to delete.
|
|
45
|
+
*/
|
|
46
|
+
static DeleteConfiguration(renderPassId) {
|
|
47
|
+
delete MaterialHelperGeometryRendering._Configurations[renderPassId];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets a geometry rendering configuration.
|
|
51
|
+
* @param renderPassId The render pass id of the configuration to get.
|
|
52
|
+
* @returns The configuration.
|
|
53
|
+
*/
|
|
54
|
+
static GetConfiguration(renderPassId) {
|
|
55
|
+
return MaterialHelperGeometryRendering._Configurations[renderPassId];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Adds uniforms and samplers for geometry rendering.
|
|
59
|
+
* @param uniforms The array of uniforms to add to.
|
|
60
|
+
* @param _samplers The array of samplers to add to.
|
|
61
|
+
*/
|
|
62
|
+
static AddUniformsAndSamplers(uniforms, _samplers) {
|
|
63
|
+
uniforms.push("previousWorld", "previousViewProjection", "mPreviousBones");
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Marks a list of meshes as dirty for geometry rendering.
|
|
67
|
+
* @param renderPassId The render pass id the meshes are marked as dirty for.
|
|
68
|
+
* @param meshes The list of meshes to mark as dirty.
|
|
69
|
+
*/
|
|
70
|
+
static MarkAsDirty(renderPassId, meshes) {
|
|
71
|
+
for (const mesh of meshes) {
|
|
72
|
+
if (!mesh.subMeshes) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
for (const subMesh of mesh.subMeshes) {
|
|
76
|
+
subMesh._removeDrawWrapper(renderPassId);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Prepares defines for geometry rendering.
|
|
82
|
+
* @param renderPassId The render pass id the defines are prepared for.
|
|
83
|
+
* @param mesh The mesh the defines are prepared for.
|
|
84
|
+
* @param defines The defines to update according to the geometry rendering configuration.
|
|
85
|
+
*/
|
|
86
|
+
static PrepareDefines(renderPassId, mesh, defines) {
|
|
87
|
+
if (!defines._arePrePassDirty) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];
|
|
91
|
+
if (!configuration) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
defines["PREPASS"] = true;
|
|
95
|
+
defines["PREPASS_COLOR"] = false;
|
|
96
|
+
defines["PREPASS_COLOR_INDEX"] = -1;
|
|
97
|
+
let numMRT = 0;
|
|
98
|
+
for (let i = 0; i < MaterialHelperGeometryRendering.GeometryTextureDescriptions.length; i++) {
|
|
99
|
+
const geometryTextureDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[i];
|
|
100
|
+
const defineName = geometryTextureDescription.define;
|
|
101
|
+
const defineIndex = geometryTextureDescription.defineIndex;
|
|
102
|
+
const index = configuration.defines[defineIndex];
|
|
103
|
+
if (index !== undefined) {
|
|
104
|
+
defines[defineName] = true;
|
|
105
|
+
defines[defineIndex] = index;
|
|
106
|
+
numMRT++;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
defines[defineName] = false;
|
|
110
|
+
delete defines[defineIndex];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
defines["SCENE_MRT_COUNT"] = numMRT;
|
|
114
|
+
defines["BONES_VELOCITY_ENABLED"] =
|
|
115
|
+
mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && !mesh.skeleton.isUsingTextureForMatrices && configuration.excludedSkinnedMesh.indexOf(mesh) === -1;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Binds geometry rendering data for a mesh.
|
|
119
|
+
* @param renderPassId The render pass id the geometry rendering data is bound for.
|
|
120
|
+
* @param effect The effect to bind the geometry rendering data to.
|
|
121
|
+
* @param mesh The mesh to bind the geometry rendering data for.
|
|
122
|
+
* @param world The world matrix of the mesh.
|
|
123
|
+
*/
|
|
124
|
+
static Bind(renderPassId, effect, mesh, world) {
|
|
125
|
+
const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];
|
|
126
|
+
if (!configuration) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (configuration.defines["PREPASS_VELOCITY_INDEX"] !== undefined || configuration.defines["PREPASS_VELOCITY_LINEAR_INDEX"] !== undefined) {
|
|
130
|
+
if (!configuration.previousWorldMatrices[mesh.uniqueId]) {
|
|
131
|
+
configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();
|
|
132
|
+
}
|
|
133
|
+
const scene = mesh.getScene();
|
|
134
|
+
if (!configuration.previousViewProjection) {
|
|
135
|
+
configuration.previousViewProjection = scene.getTransformMatrix().clone();
|
|
136
|
+
configuration.currentViewProjection = scene.getTransformMatrix().clone();
|
|
137
|
+
}
|
|
138
|
+
const engine = scene.getEngine();
|
|
139
|
+
if (configuration.currentViewProjection.updateFlag !== scene.getTransformMatrix().updateFlag) {
|
|
140
|
+
// First update of the prepass configuration for this rendering pass
|
|
141
|
+
configuration.lastUpdateFrameId = engine.frameId;
|
|
142
|
+
configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);
|
|
143
|
+
configuration.currentViewProjection.copyFrom(scene.getTransformMatrix());
|
|
144
|
+
}
|
|
145
|
+
else if (configuration.lastUpdateFrameId !== engine.frameId) {
|
|
146
|
+
// The scene transformation did not change from the previous frame (so no camera motion), we must update previousViewProjection accordingly
|
|
147
|
+
configuration.lastUpdateFrameId = engine.frameId;
|
|
148
|
+
configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);
|
|
149
|
+
}
|
|
150
|
+
effect.setMatrix("previousWorld", configuration.previousWorldMatrices[mesh.uniqueId]);
|
|
151
|
+
effect.setMatrix("previousViewProjection", configuration.previousViewProjection);
|
|
152
|
+
configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();
|
|
153
|
+
if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {
|
|
154
|
+
const skeleton = mesh.skeleton;
|
|
155
|
+
if (!skeleton.isUsingTextureForMatrices || effect.getUniformIndex("boneTextureWidth") === -1) {
|
|
156
|
+
const matrices = skeleton.getTransformMatrices(mesh);
|
|
157
|
+
if (matrices) {
|
|
158
|
+
if (!configuration.previousBones[mesh.uniqueId]) {
|
|
159
|
+
configuration.previousBones[mesh.uniqueId] = matrices.slice();
|
|
160
|
+
}
|
|
161
|
+
effect.setMatrices("mPreviousBones", configuration.previousBones[mesh.uniqueId]);
|
|
162
|
+
configuration.previousBones[mesh.uniqueId].set(matrices);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Descriptions of the geometry textures.
|
|
171
|
+
*/
|
|
172
|
+
MaterialHelperGeometryRendering.GeometryTextureDescriptions = [
|
|
173
|
+
{
|
|
174
|
+
type: 0,
|
|
175
|
+
name: "Irradiance",
|
|
176
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
177
|
+
define: "PREPASS_IRRADIANCE",
|
|
178
|
+
defineIndex: "PREPASS_IRRADIANCE_INDEX",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 1,
|
|
182
|
+
name: "WorldPosition",
|
|
183
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
184
|
+
define: "PREPASS_POSITION",
|
|
185
|
+
defineIndex: "PREPASS_POSITION_INDEX",
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
type: 2,
|
|
189
|
+
name: "Velocity",
|
|
190
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
191
|
+
define: "PREPASS_VELOCITY",
|
|
192
|
+
defineIndex: "PREPASS_VELOCITY_INDEX",
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 3,
|
|
196
|
+
name: "Reflectivity",
|
|
197
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
198
|
+
define: "PREPASS_REFLECTIVITY",
|
|
199
|
+
defineIndex: "PREPASS_REFLECTIVITY_INDEX",
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
type: 5,
|
|
203
|
+
name: "ViewDepth",
|
|
204
|
+
clearType: 2 /* GeometryRenderingTextureClearType.MaxViewZ */,
|
|
205
|
+
define: "PREPASS_DEPTH",
|
|
206
|
+
defineIndex: "PREPASS_DEPTH_INDEX",
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
type: 6,
|
|
210
|
+
name: "ViewNormal",
|
|
211
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
212
|
+
define: "PREPASS_NORMAL",
|
|
213
|
+
defineIndex: "PREPASS_NORMAL_INDEX",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
type: 7,
|
|
217
|
+
name: "AlbedoSqrt",
|
|
218
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
219
|
+
define: "PREPASS_ALBEDO_SQRT",
|
|
220
|
+
defineIndex: "PREPASS_ALBEDO_SQRT_INDEX",
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: 8,
|
|
224
|
+
name: "WorldNormal",
|
|
225
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
226
|
+
define: "PREPASS_WORLD_NORMAL",
|
|
227
|
+
defineIndex: "PREPASS_WORLD_NORMAL_INDEX",
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
type: 9,
|
|
231
|
+
name: "LocalPosition",
|
|
232
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
233
|
+
define: "PREPASS_LOCAL_POSITION",
|
|
234
|
+
defineIndex: "PREPASS_LOCAL_POSITION_INDEX",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
type: 10,
|
|
238
|
+
name: "ScreenDepth",
|
|
239
|
+
clearType: 1 /* GeometryRenderingTextureClearType.One */,
|
|
240
|
+
define: "PREPASS_SCREENSPACE_DEPTH",
|
|
241
|
+
defineIndex: "PREPASS_SCREENSPACE_DEPTH_INDEX",
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
type: 11,
|
|
245
|
+
name: "LinearVelocity",
|
|
246
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
247
|
+
define: "PREPASS_VELOCITY_LINEAR",
|
|
248
|
+
defineIndex: "PREPASS_VELOCITY_LINEAR_INDEX",
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
type: 12,
|
|
252
|
+
name: "Albedo",
|
|
253
|
+
clearType: 0 /* GeometryRenderingTextureClearType.Zero */,
|
|
254
|
+
define: "PREPASS_ALBEDO",
|
|
255
|
+
defineIndex: "PREPASS_ALBEDO_INDEX",
|
|
256
|
+
},
|
|
257
|
+
];
|
|
258
|
+
MaterialHelperGeometryRendering._Configurations = {};
|
|
259
|
+
//# sourceMappingURL=materialHelper.geometryrendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialHelper.geometryrendering.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/materialHelper.geometryrendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gCAA+B;AAKnD,OAAO,EAAE,MAAM,EAAE,gCAA+B;AAEhD;;GAEG;AACH,MAAM,CAAN,IAAkB,iCAejB;AAfD,WAAkB,iCAAiC;IAC/C;;OAEG;IACH,yFAAQ,CAAA;IAER;;OAEG;IACH,uFAAO,CAAA;IAEP;;OAEG;IACH,iGAAY,CAAA;AAChB,CAAC,EAfiB,iCAAiC,KAAjC,iCAAiC,QAelD;AA2CD;;GAEG;AACH,MAAM,OAAO,+BAA+B;IA6FxC;;;;OAIG;IACI,MAAM,CAAC,mBAAmB,CAAC,YAAoB;QAClD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;QACrB,SAAS,gDAAwC;QACjD,MAAM,EAAE,wBAAwB;QAChC,WAAW,EAAE,8BAA8B;KAC9C;IACD;QACI,IAAI,EAAE,SAAS,CAAC,sCAAsC;QACtD,IAAI,EAAE,aAAa;QACnB,SAAS,+CAAuC;QAChD,MAAM,EAAE,2BAA2B;QACnC,WAAW,EAAE,iCAAiC;KACjD;IACD;QACI,IAAI,EAAE,SAAS,CAAC,oCAAoC;QACpD,IAAI,EAAE,gBAAgB;QACtB,SAAS,gDAAwC;QACjD,MAAM,EAAE,yBAAyB;QACjC,WAAW,EAAE,+BAA+B;KAC/C;IACD;QACI,IAAI,EAAE,SAAS,CAAC,2BAA2B;QAC3C,IAAI,EAAE,QAAQ;QACd,SAAS,gDAAwC;QACjD,MAAM,EAAE,gBAAgB;QACxB,WAAW,EAAE,sBAAsB;KACtC;CACJ,CAAC;AAEa,+CAAe,GAA+D,EAAE,CAAC","sourcesContent":["import { Constants } from \"core/Engines/constants\";\r\nimport type { MaterialDefines } from \"core/Materials/materialDefines\";\r\nimport type { Effect } from \"core/Materials/effect\";\r\nimport type { Mesh } from \"core/Meshes/mesh\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { Matrix } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Type of clear operation to perform on a geometry texture.\r\n */\r\nexport const enum GeometryRenderingTextureClearType {\r\n /**\r\n * Clear the texture with zero.\r\n */\r\n Zero = 0,\r\n\r\n /**\r\n * Clear the texture with one.\r\n */\r\n One = 1,\r\n\r\n /**\r\n * Clear the texture with the maximum view Z value.\r\n */\r\n MaxViewZ = 2,\r\n}\r\n\r\n/**\r\n * Configuration for geometry rendering.\r\n * A configuration is created for each rendering pass a geometry rendering is used in.\r\n */\r\nexport type GeometryRenderingConfiguration = {\r\n /**\r\n * Defines used for the geometry rendering.\r\n */\r\n defines: { [name: string]: number };\r\n\r\n /**\r\n * Previous world matrices for meshes.\r\n */\r\n previousWorldMatrices: { [index: number]: Matrix };\r\n\r\n /**\r\n * Previous view projection matrix.\r\n */\r\n previousViewProjection: Matrix;\r\n\r\n /**\r\n * Current view projection matrix.\r\n */\r\n currentViewProjection: Matrix;\r\n\r\n /**\r\n * Previous bones for skinned meshes.\r\n */\r\n previousBones: { [index: number]: Float32Array };\r\n\r\n /**\r\n * Last frame id the configuration was updated.\r\n */\r\n lastUpdateFrameId: number;\r\n\r\n /**\r\n * List of excluded skinned meshes.\r\n */\r\n excludedSkinnedMesh: AbstractMesh[];\r\n};\r\n\r\n/**\r\n * Helper class to manage geometry rendering.\r\n */\r\nexport class MaterialHelperGeometryRendering {\r\n /**\r\n * Descriptions of the geometry textures.\r\n */\r\n public static readonly GeometryTextureDescriptions = [\r\n {\r\n type: Constants.PREPASS_IRRADIANCE_TEXTURE_TYPE,\r\n name: \"Irradiance\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_IRRADIANCE\",\r\n defineIndex: \"PREPASS_IRRADIANCE_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_POSITION_TEXTURE_TYPE,\r\n name: \"WorldPosition\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_POSITION\",\r\n defineIndex: \"PREPASS_POSITION_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_VELOCITY_TEXTURE_TYPE,\r\n name: \"Velocity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_VELOCITY\",\r\n defineIndex: \"PREPASS_VELOCITY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE,\r\n name: \"Reflectivity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_REFLECTIVITY\",\r\n defineIndex: \"PREPASS_REFLECTIVITY_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_DEPTH_TEXTURE_TYPE,\r\n name: \"ViewDepth\",\r\n clearType: GeometryRenderingTextureClearType.MaxViewZ,\r\n define: \"PREPASS_DEPTH\",\r\n defineIndex: \"PREPASS_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_NORMAL_TEXTURE_TYPE,\r\n name: \"ViewNormal\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_NORMAL\",\r\n defineIndex: \"PREPASS_NORMAL_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_ALBEDO_SQRT_TEXTURE_TYPE,\r\n name: \"AlbedoSqrt\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_ALBEDO_SQRT\",\r\n defineIndex: \"PREPASS_ALBEDO_SQRT_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE,\r\n name: \"WorldNormal\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_WORLD_NORMAL\",\r\n defineIndex: \"PREPASS_WORLD_NORMAL_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE,\r\n name: \"LocalPosition\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_LOCAL_POSITION\",\r\n defineIndex: \"PREPASS_LOCAL_POSITION_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE,\r\n name: \"ScreenDepth\",\r\n clearType: GeometryRenderingTextureClearType.One,\r\n define: \"PREPASS_SCREENSPACE_DEPTH\",\r\n defineIndex: \"PREPASS_SCREENSPACE_DEPTH_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE,\r\n name: \"LinearVelocity\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_VELOCITY_LINEAR\",\r\n defineIndex: \"PREPASS_VELOCITY_LINEAR_INDEX\",\r\n },\r\n {\r\n type: Constants.PREPASS_ALBEDO_TEXTURE_TYPE,\r\n name: \"Albedo\",\r\n clearType: GeometryRenderingTextureClearType.Zero,\r\n define: \"PREPASS_ALBEDO\",\r\n defineIndex: \"PREPASS_ALBEDO_INDEX\",\r\n },\r\n ];\r\n\r\n private static _Configurations: { [renderPassId: number]: GeometryRenderingConfiguration } = {};\r\n\r\n /**\r\n * Creates a new geometry rendering configuration.\r\n * @param renderPassId Render pass id the configuration is created for.\r\n * @returns The created configuration.\r\n */\r\n public static CreateConfiguration(renderPassId: number) {\r\n MaterialHelperGeometryRendering._Configurations[renderPassId] = {\r\n defines: {},\r\n previousWorldMatrices: {},\r\n previousViewProjection: Matrix.Zero(),\r\n currentViewProjection: Matrix.Zero(),\r\n previousBones: {},\r\n lastUpdateFrameId: -1,\r\n excludedSkinnedMesh: [],\r\n };\r\n return MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Deletes a geometry rendering configuration.\r\n * @param renderPassId The render pass id of the configuration to delete.\r\n */\r\n public static DeleteConfiguration(renderPassId: number) {\r\n delete MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Gets a geometry rendering configuration.\r\n * @param renderPassId The render pass id of the configuration to get.\r\n * @returns The configuration.\r\n */\r\n public static GetConfiguration(renderPassId: number): GeometryRenderingConfiguration {\r\n return MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n }\r\n\r\n /**\r\n * Adds uniforms and samplers for geometry rendering.\r\n * @param uniforms The array of uniforms to add to.\r\n * @param _samplers The array of samplers to add to.\r\n */\r\n public static AddUniformsAndSamplers(uniforms: string[], _samplers: string[]) {\r\n uniforms.push(\"previousWorld\", \"previousViewProjection\", \"mPreviousBones\");\r\n }\r\n\r\n /**\r\n * Marks a list of meshes as dirty for geometry rendering.\r\n * @param renderPassId The render pass id the meshes are marked as dirty for.\r\n * @param meshes The list of meshes to mark as dirty.\r\n */\r\n public static MarkAsDirty(renderPassId: number, meshes: AbstractMesh[]) {\r\n for (const mesh of meshes) {\r\n if (!mesh.subMeshes) {\r\n continue;\r\n }\r\n\r\n for (const subMesh of mesh.subMeshes) {\r\n subMesh._removeDrawWrapper(renderPassId);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Prepares defines for geometry rendering.\r\n * @param renderPassId The render pass id the defines are prepared for.\r\n * @param mesh The mesh the defines are prepared for.\r\n * @param defines The defines to update according to the geometry rendering configuration.\r\n */\r\n public static PrepareDefines(renderPassId: number, mesh: AbstractMesh, defines: MaterialDefines) {\r\n if (!defines._arePrePassDirty) {\r\n return;\r\n }\r\n\r\n const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n if (!configuration) {\r\n return;\r\n }\r\n\r\n defines[\"PREPASS\"] = true;\r\n defines[\"PREPASS_COLOR\"] = false;\r\n defines[\"PREPASS_COLOR_INDEX\"] = -1;\r\n\r\n let numMRT = 0;\r\n\r\n for (let i = 0; i < MaterialHelperGeometryRendering.GeometryTextureDescriptions.length; i++) {\r\n const geometryTextureDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[i];\r\n const defineName = geometryTextureDescription.define;\r\n const defineIndex = geometryTextureDescription.defineIndex;\r\n const index = configuration.defines[defineIndex];\r\n\r\n if (index !== undefined) {\r\n defines[defineName] = true;\r\n defines[defineIndex] = index;\r\n numMRT++;\r\n } else {\r\n defines[defineName] = false;\r\n delete defines[defineIndex];\r\n }\r\n }\r\n\r\n defines[\"SCENE_MRT_COUNT\"] = numMRT;\r\n\r\n defines[\"BONES_VELOCITY_ENABLED\"] =\r\n mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton && !mesh.skeleton.isUsingTextureForMatrices && configuration.excludedSkinnedMesh.indexOf(mesh) === -1;\r\n }\r\n\r\n /**\r\n * Binds geometry rendering data for a mesh.\r\n * @param renderPassId The render pass id the geometry rendering data is bound for.\r\n * @param effect The effect to bind the geometry rendering data to.\r\n * @param mesh The mesh to bind the geometry rendering data for.\r\n * @param world The world matrix of the mesh.\r\n */\r\n public static Bind(renderPassId: number, effect: Effect, mesh: Mesh, world: Matrix) {\r\n const configuration = MaterialHelperGeometryRendering._Configurations[renderPassId];\r\n if (!configuration) {\r\n return;\r\n }\r\n\r\n if (configuration.defines[\"PREPASS_VELOCITY_INDEX\"] !== undefined || configuration.defines[\"PREPASS_VELOCITY_LINEAR_INDEX\"] !== undefined) {\r\n if (!configuration.previousWorldMatrices[mesh.uniqueId]) {\r\n configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();\r\n }\r\n\r\n const scene = mesh.getScene();\r\n\r\n if (!configuration.previousViewProjection) {\r\n configuration.previousViewProjection = scene.getTransformMatrix().clone();\r\n configuration.currentViewProjection = scene.getTransformMatrix().clone();\r\n }\r\n\r\n const engine = scene.getEngine();\r\n\r\n if (configuration.currentViewProjection.updateFlag !== scene.getTransformMatrix().updateFlag) {\r\n // First update of the prepass configuration for this rendering pass\r\n configuration.lastUpdateFrameId = engine.frameId;\r\n configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);\r\n configuration.currentViewProjection.copyFrom(scene.getTransformMatrix());\r\n } else if (configuration.lastUpdateFrameId !== engine.frameId) {\r\n // The scene transformation did not change from the previous frame (so no camera motion), we must update previousViewProjection accordingly\r\n configuration.lastUpdateFrameId = engine.frameId;\r\n configuration.previousViewProjection.copyFrom(configuration.currentViewProjection);\r\n }\r\n\r\n effect.setMatrix(\"previousWorld\", configuration.previousWorldMatrices[mesh.uniqueId]);\r\n effect.setMatrix(\"previousViewProjection\", configuration.previousViewProjection);\r\n\r\n configuration.previousWorldMatrices[mesh.uniqueId] = world.clone();\r\n\r\n if (mesh.useBones && mesh.computeBonesUsingShaders && mesh.skeleton) {\r\n const skeleton = mesh.skeleton;\r\n\r\n if (!skeleton.isUsingTextureForMatrices || effect.getUniformIndex(\"boneTextureWidth\") === -1) {\r\n const matrices = skeleton.getTransformMatrices(mesh);\r\n\r\n if (matrices) {\r\n if (!configuration.previousBones[mesh.uniqueId]) {\r\n configuration.previousBones[mesh.uniqueId] = matrices.slice();\r\n }\r\n effect.setMatrices(\"mPreviousBones\", configuration.previousBones[mesh.uniqueId]);\r\n configuration.previousBones[mesh.uniqueId].set(matrices);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -119,8 +119,12 @@ export declare class StandardMaterialDefines extends MaterialDefines implements
|
|
|
119
119
|
ALPHATEST_AFTERALLALPHACOMPUTATIONS: boolean;
|
|
120
120
|
ALPHABLEND: boolean;
|
|
121
121
|
PREPASS: boolean;
|
|
122
|
+
PREPASS_COLOR: boolean;
|
|
123
|
+
PREPASS_COLOR_INDEX: number;
|
|
122
124
|
PREPASS_IRRADIANCE: boolean;
|
|
123
125
|
PREPASS_IRRADIANCE_INDEX: number;
|
|
126
|
+
PREPASS_ALBEDO: boolean;
|
|
127
|
+
PREPASS_ALBEDO_INDEX: number;
|
|
124
128
|
PREPASS_ALBEDO_SQRT: boolean;
|
|
125
129
|
PREPASS_ALBEDO_SQRT_INDEX: number;
|
|
126
130
|
PREPASS_DEPTH: boolean;
|
|
@@ -20,6 +20,7 @@ import { DetailMapConfiguration } from "./material.detailMapConfiguration.js";
|
|
|
20
20
|
import { addClipPlaneUniforms, bindClipPlane } from "./clipPlaneMaterialHelper.js";
|
|
21
21
|
import { BindBonesParameters, BindFogParameters, BindLights, BindLogDepth, BindMorphTargetParameters, BindTextureMatrix, HandleFallbacksForShadows, PrepareAttributesForBakedVertexAnimation, PrepareAttributesForBones, PrepareAttributesForInstances, PrepareAttributesForMorphTargets, PrepareDefinesForAttributes, PrepareDefinesForFrameBoundValues, PrepareDefinesForLights, PrepareDefinesForMergedUV, PrepareDefinesForMisc, PrepareDefinesForMultiview, PrepareDefinesForOIT, PrepareDefinesForPrePass, PrepareUniformsAndSamplersList, } from "./materialHelper.functions.js";
|
|
22
22
|
import { SerializationHelper } from "../Misc/decorators.serialization.js";
|
|
23
|
+
import { MaterialHelperGeometryRendering } from "./materialHelper.geometryrendering.js";
|
|
23
24
|
const onCreatedEffectParameters = { effect: null, subMesh: null };
|
|
24
25
|
/** @internal */
|
|
25
26
|
export class StandardMaterialDefines extends MaterialDefines {
|
|
@@ -129,8 +130,12 @@ export class StandardMaterialDefines extends MaterialDefines {
|
|
|
129
130
|
this.ALPHATEST_AFTERALLALPHACOMPUTATIONS = false;
|
|
130
131
|
this.ALPHABLEND = true;
|
|
131
132
|
this.PREPASS = false;
|
|
133
|
+
this.PREPASS_COLOR = false;
|
|
134
|
+
this.PREPASS_COLOR_INDEX = -1;
|
|
132
135
|
this.PREPASS_IRRADIANCE = false;
|
|
133
136
|
this.PREPASS_IRRADIANCE_INDEX = -1;
|
|
137
|
+
this.PREPASS_ALBEDO = false;
|
|
138
|
+
this.PREPASS_ALBEDO_INDEX = -1;
|
|
134
139
|
this.PREPASS_ALBEDO_SQRT = false;
|
|
135
140
|
this.PREPASS_ALBEDO_SQRT_INDEX = -1;
|
|
136
141
|
this.PREPASS_DEPTH = false;
|
|
@@ -563,6 +568,7 @@ export class StandardMaterial extends PushMaterial {
|
|
|
563
568
|
PrepareDefinesForPrePass(scene, defines, this.canRenderToMRT && !oit);
|
|
564
569
|
// Order independant transparency
|
|
565
570
|
PrepareDefinesForOIT(scene, defines, oit);
|
|
571
|
+
MaterialHelperGeometryRendering.PrepareDefines(engine.currentRenderPassId, mesh, defines);
|
|
566
572
|
// Textures
|
|
567
573
|
if (defines._areTexturesDirty) {
|
|
568
574
|
this._eventInfo.hasRenderTargetTextures = false;
|
|
@@ -969,6 +975,7 @@ export class StandardMaterial extends PushMaterial {
|
|
|
969
975
|
this._eventInfo.mesh = mesh;
|
|
970
976
|
this._eventInfo.indexParameters = indexParameters;
|
|
971
977
|
this._callbackPluginEventGeneric(128 /* MaterialPluginEvent.PrepareEffect */, this._eventInfo);
|
|
978
|
+
MaterialHelperGeometryRendering.AddUniformsAndSamplers(uniforms, samplers);
|
|
972
979
|
PrePassConfiguration.AddUniforms(uniforms);
|
|
973
980
|
PrePassConfiguration.AddSamplers(samplers);
|
|
974
981
|
if (ImageProcessingConfiguration) {
|
|
@@ -1118,6 +1125,7 @@ export class StandardMaterial extends PushMaterial {
|
|
|
1118
1125
|
// Binding unconditionally
|
|
1119
1126
|
this._uniformBuffer.bindToEffect(effect, "Material");
|
|
1120
1127
|
this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
|
|
1128
|
+
MaterialHelperGeometryRendering.Bind(scene.getEngine().currentRenderPassId, this._activeEffect, mesh, world);
|
|
1121
1129
|
this._eventInfo.subMesh = subMesh;
|
|
1122
1130
|
this._callbackPluginEventHardBindForSubMesh(this._eventInfo);
|
|
1123
1131
|
// Normal Matrix
|