@onerjs/core 9.0.0 → 9.0.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/Animations/animationGroup.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.js +6 -1
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
- package/Engines/Native/nativeHardwareTexture.js +7 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +56 -1
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +37 -8
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
- package/Engines/Processors/shaderCodeCursor.js +40 -3
- package/Engines/Processors/shaderCodeCursor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +15 -1
- package/Engines/abstractEngine.pure.js +12 -4
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -1
- package/Engines/engine.pure.js +0 -7
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.js +1 -1
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +1 -0
- package/Engines/thinEngine.pure.js +13 -2
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +217 -17
- package/Engines/thinNativeEngine.pure.js +1431 -164
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.js +6 -1
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +12 -1
- package/Engines/webgpuEngine.pure.js +8 -0
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +16 -4
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +20 -6
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +7 -7
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +52 -35
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +2 -1
- package/FlowGraph/flowGraph.js +3 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
- package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
- package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
- package/FlowGraph/flowGraphContext.js +1 -0
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphValidator.js +0 -4
- package/FlowGraph/flowGraphValidator.js.map +1 -1
- package/FlowGraph/index.d.ts +2 -0
- package/FlowGraph/index.js +2 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +2 -0
- package/FlowGraph/pure.js +2 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +2 -2
- package/FlowGraph/serialization.js +2 -2
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +1 -1
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/allBlocks.pure.js +2 -0
- package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/pure.js +1 -0
- package/FrameGraph/Node/Blocks/pure.js.map +1 -1
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +14 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/FrameGraph/pure.d.ts +1 -0
- package/FrameGraph/pure.js +1 -0
- package/FrameGraph/pure.js.map +1 -1
- package/Inputs/scene.inputManager.js +1 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +98 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -2
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/pure.d.ts +4 -0
- package/Materials/GaussianSplatting/pure.js +4 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +1 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +31 -7
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/mirrorTexture.pure.js +3 -1
- package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
- package/Materials/Textures/texture.pure.js +1 -1
- package/Materials/Textures/texture.pure.js.map +1 -1
- package/Materials/effectRenderer.pure.d.ts +4 -0
- package/Materials/effectRenderer.pure.js +3 -2
- package/Materials/effectRenderer.pure.js.map +1 -1
- package/Materials/index.d.ts +4 -0
- package/Materials/index.js +4 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.pure.js +25 -12
- package/Materials/material.pure.js.map +1 -1
- package/Materials/pure.d.ts +4 -0
- package/Materials/pure.js +4 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +8 -0
- package/Materials/standardMaterial.pure.js +24 -2
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.js +1 -1
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +160 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +219 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +32 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +114 -21
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/pure.js +2 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +12 -0
- package/Meshes/abstractMesh.pure.js +32 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +11 -2
- package/Meshes/subMesh.pure.js +20 -5
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +1 -0
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/andOrNotEvaluator.js +4 -0
- package/Misc/andOrNotEvaluator.js.map +1 -1
- package/Misc/minMaxReducer.pure.d.ts +6 -0
- package/Misc/minMaxReducer.pure.js +10 -0
- package/Misc/minMaxReducer.pure.js.map +1 -1
- package/Misc/thinMinMaxReducer.d.ts +19 -2
- package/Misc/thinMinMaxReducer.js +74 -21
- package/Misc/thinMinMaxReducer.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +2 -0
- package/Particles/gpuParticleSystem.pure.js +12 -4
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/particle.js +3 -2
- package/Particles/particle.js.map +1 -1
- package/Particles/solidParticleSystem.js +7 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.d.ts +6 -0
- package/Particles/thinParticleSystem.function.js +144 -88
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +6 -0
- package/Particles/thinParticleSystem.pure.js +70 -9
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Physics/v2/ragdoll.d.ts +2 -4
- package/Physics/v2/ragdoll.js +11 -4
- package/Physics/v2/ragdoll.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +43 -18
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.d.ts +9 -0
- package/Rendering/depthRenderer.pure.js +12 -0
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +4 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +6 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +4 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +8 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.js +4 -1
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/prePassRenderer.pure.js +3 -3
- package/Rendering/prePassRenderer.pure.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
- package/Shaders/minmaxRedux.fragment.js +6 -1
- package/Shaders/minmaxRedux.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
- package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
- package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPartition.compute.js +27 -0
- package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
- package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
- package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
- package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
- package/ShadersWGSL/gpsResolve.compute.js +41 -0
- package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
- package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanSums.compute.js +30 -0
- package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
- package/ShadersWGSL/gpsSplat.compute.js +37 -0
- package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
- package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
- package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.pure.js +2 -1
- package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
- package/assetContainer.d.ts +1 -0
- package/assetContainer.js +5 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +13 -2
- package/scene.pure.js +28 -4
- package/scene.pure.js.map +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/** Pure barrel — re-exports only side-effect-free modules */
|
|
2
|
+
export * from "./gaussianPointSplattingController.pure.js";
|
|
3
|
+
export * from "./gaussianPointSplattingRenderer.pure.js";
|
|
2
4
|
export * from "./gaussianSplattingCompoundMesh.pure.js";
|
|
3
5
|
export * from "./gaussianSplattingDebugger.pure.js";
|
|
4
6
|
export * from "./gaussianSplattingMesh.pure.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/** Pure barrel — re-exports only side-effect-free modules */
|
|
2
|
+
export * from "./gaussianPointSplattingController.pure.js";
|
|
3
|
+
export * from "./gaussianPointSplattingRenderer.pure.js";
|
|
2
4
|
export * from "./gaussianSplattingCompoundMesh.pure.js";
|
|
3
5
|
export * from "./gaussianSplattingDebugger.pure.js";
|
|
4
6
|
export * from "./gaussianSplattingMesh.pure.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./gaussianSplattingCompoundMesh.pure\";\nexport * from \"./gaussianSplattingDebugger.pure\";\nexport * from \"./gaussianSplattingMesh.pure\";\nexport * from \"./gaussianSplattingMeshBase.pure\";\nexport * from \"./gaussianSplattingPartProxyMesh.pure\";\n"]}
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\nexport * from \"./gaussianPointSplattingController.pure\";\nexport * from \"./gaussianPointSplattingRenderer.pure\";\nexport * from \"./gaussianSplattingCompoundMesh.pure\";\nexport * from \"./gaussianSplattingDebugger.pure\";\nexport * from \"./gaussianSplattingMesh.pure\";\nexport * from \"./gaussianSplattingMeshBase.pure\";\nexport * from \"./gaussianSplattingPartProxyMesh.pure\";\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __esDecorate, __runInitializers } from "../../../tslib.es6.js";
|
|
3
3
|
import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
|
|
4
4
|
import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
|
|
5
|
+
import { VertexData } from "../../mesh.vertexData.js";
|
|
5
6
|
import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
|
|
6
7
|
import { CSG2, InitializeCSG2Async, IsCSG2Ready } from "../../csg2.js";
|
|
7
8
|
import { CSG } from "../../csg.js";
|
|
@@ -103,25 +104,38 @@ let BooleanGeometryBlock = (() => {
|
|
|
103
104
|
if (!vertexData0 || !vertexData1) {
|
|
104
105
|
return null;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
//
|
|
107
|
+
// Make both operands expose the same attributes, since CSG2 refuses mismatched vertex layouts.
|
|
108
|
+
// Missing normals are computed from the geometry, missing colors default to white (as VertexData.merge does)
|
|
109
|
+
// and missing UVs to zero. Every pad is sized to its own operand.
|
|
110
|
+
const pad = (length, value) => new Array(length).fill(value);
|
|
111
|
+
const computeNormals = (geometry) => {
|
|
112
|
+
const normals = [];
|
|
113
|
+
VertexData.ComputeNormals(geometry.positions, geometry.indices, normals);
|
|
114
|
+
return normals;
|
|
115
|
+
};
|
|
116
|
+
const vertexCount0 = vertexData0.positions.length / 3;
|
|
117
|
+
const vertexCount1 = vertexData1.positions.length / 3;
|
|
108
118
|
if (!vertexData0.normals && vertexData1.normals) {
|
|
109
|
-
vertexData0.normals =
|
|
119
|
+
vertexData0.normals = computeNormals(vertexData0);
|
|
110
120
|
}
|
|
111
121
|
if (!vertexData1.normals && vertexData0.normals) {
|
|
112
|
-
vertexData1.normals =
|
|
122
|
+
vertexData1.normals = computeNormals(vertexData1);
|
|
113
123
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
// The legacy engine only reads the first UV set; CSG2 counts every set present.
|
|
125
|
+
const uvSets = this.useOldCSGEngine ? ["uvs"] : ["uvs", "uvs2", "uvs3", "uvs4", "uvs5", "uvs6"];
|
|
126
|
+
for (const key of uvSets) {
|
|
127
|
+
if (!vertexData0[key] && vertexData1[key]) {
|
|
128
|
+
vertexData0[key] = pad(vertexCount0 * 2, 0);
|
|
129
|
+
}
|
|
130
|
+
if (!vertexData1[key] && vertexData0[key]) {
|
|
131
|
+
vertexData1[key] = pad(vertexCount1 * 2, 0);
|
|
132
|
+
}
|
|
119
133
|
}
|
|
120
134
|
if (!vertexData0.colors && vertexData1.colors) {
|
|
121
|
-
vertexData0.colors =
|
|
135
|
+
vertexData0.colors = pad(vertexCount0 * 4, 1);
|
|
122
136
|
}
|
|
123
137
|
if (!vertexData1.colors && vertexData0.colors) {
|
|
124
|
-
vertexData1.colors =
|
|
138
|
+
vertexData1.colors = pad(vertexCount1 * 4, 1);
|
|
125
139
|
}
|
|
126
140
|
let boolCSG;
|
|
127
141
|
if (this.useOldCSGEngine) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booleanGeometryBlock.pure.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/booleanGeometryBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAGlG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACjC,gBAAgB;IAChB,mFAAS,CAAA;IACT,eAAe;IACf,iFAAQ,CAAA;IACR,YA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B,oBAAoB;AAkMjC,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IACxC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { type NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { type VertexData } from \"../../mesh.vertexData\";\r\nimport { type NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { CSG2, InitializeCSG2Async, IsCSG2Ready } from \"core/Meshes/csg2\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { CSG } from \"core/Meshes/csg\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Operations supported by the boolean block\r\n */\r\nexport enum BooleanGeometryOperations {\r\n /** Intersect */\r\n Intersect,\r\n /** Subtract */\r\n Subtract,\r\n /** Union */\r\n Union,\r\n}\r\n\r\n/**\r\n * Block used to apply a boolean operation between 2 geometries\r\n */\r\nexport class BooleanGeometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Intersect\", value: BooleanGeometryOperations.Intersect },\r\n { label: \"Subtract\", value: BooleanGeometryOperations.Subtract },\r\n { label: \"Union\", value: BooleanGeometryOperations.Union },\r\n ],\r\n })\r\n public operation = BooleanGeometryOperations.Intersect;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Use old CSG engine\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public useOldCSGEngine = false;\r\n\r\n private _csg2LoadingPromise: Promise<void>;\r\n /**\r\n * @internal\r\n */\r\n public override get _isReadyState(): Nullable<Promise<void>> {\r\n if (IsCSG2Ready()) {\r\n return null;\r\n }\r\n\r\n if (!this._csg2LoadingPromise) {\r\n this._csg2LoadingPromise = InitializeCSG2Async();\r\n }\r\n\r\n return this._csg2LoadingPromise;\r\n }\r\n\r\n /**\r\n * Create a new BooleanGeometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry0\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"geometry1\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"BooleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry0 input component\r\n */\r\n public get geometry0(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry1 input component\r\n */\r\n public get geometry1(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const vertexData0 = this.geometry0.getConnectedValue(state) as VertexData;\r\n const vertexData1 = this.geometry1.getConnectedValue(state) as VertexData;\r\n\r\n if (!vertexData0 || !vertexData1) {\r\n return null;\r\n }\r\n\r\n const vertexCount = vertexData0.positions!.length / 3;\r\n // Ensure that all the fields are filled to avoid problems later on in the graph\r\n if (!vertexData0.normals && vertexData1.normals) {\r\n vertexData0.normals = new Array<number>(vertexData0.positions!.length);\r\n }\r\n if (!vertexData1.normals && vertexData0.normals) {\r\n vertexData1.normals = new Array<number>(vertexData1.positions!.length);\r\n }\r\n if (!vertexData0.uvs && vertexData1.uvs) {\r\n vertexData0.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData1.uvs && vertexData0.uvs) {\r\n vertexData1.uvs = new Array<number>(vertexCount * 2);\r\n }\r\n if (!vertexData0.colors && vertexData1.colors) {\r\n vertexData0.colors = new Array<number>(vertexCount * 4);\r\n }\r\n if (!vertexData1.colors && vertexData0.colors) {\r\n vertexData1.colors = new Array<number>(vertexCount * 4);\r\n }\r\n\r\n let boolCSG: CSG | CSG2;\r\n\r\n if (this.useOldCSGEngine) {\r\n const csg0 = CSG.FromVertexData(vertexData0);\r\n const csg1 = CSG.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.union(csg1);\r\n break;\r\n }\r\n } else {\r\n const csg0 = CSG2.FromVertexData(vertexData0);\r\n const csg1 = CSG2.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.add(csg1);\r\n break;\r\n }\r\n }\r\n\r\n return boolCSG.toVertexData();\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\\n`;\r\n codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.operation = this.operation;\r\n serializationObject.useOldCSGEngine = this.useOldCSGEngine;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /** @internal */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n if (serializationObject.operation) {\r\n this.operation = serializationObject.operation;\r\n }\r\n\r\n this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for booleanGeometryBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterBooleanGeometryBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"booleanGeometryBlock.pure.js","sourceRoot":"","sources":["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AAe,yGAAS;YAc/B,6KAAO,SAAS,6BAAT,SAAS,6FAAuC;YAOvD,+LAAO,eAAe,6BAAf,eAAe,yGAAS;;;;;SA3BtB,oBAAoB;AA+MjC,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IACxC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC;AACxE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { type NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { VertexData } from \"../../mesh.vertexData\";\r\nimport { type NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { CSG2, InitializeCSG2Async, IsCSG2Ready } from \"core/Meshes/csg2\";\r\nimport { type Nullable } from \"core/types\";\r\nimport { CSG } from \"core/Meshes/csg\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Operations supported by the boolean block\r\n */\r\nexport enum BooleanGeometryOperations {\r\n /** Intersect */\r\n Intersect,\r\n /** Subtract */\r\n Subtract,\r\n /** Union */\r\n Union,\r\n}\r\n\r\n/**\r\n * Block used to apply a boolean operation between 2 geometries\r\n */\r\nexport class BooleanGeometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Gets or sets the operation applied by the block\r\n */\r\n @editableInPropertyPage(\"Operation\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"Intersect\", value: BooleanGeometryOperations.Intersect },\r\n { label: \"Subtract\", value: BooleanGeometryOperations.Subtract },\r\n { label: \"Union\", value: BooleanGeometryOperations.Union },\r\n ],\r\n })\r\n public operation = BooleanGeometryOperations.Intersect;\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Use old CSG engine\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public useOldCSGEngine = false;\r\n\r\n private _csg2LoadingPromise: Promise<void>;\r\n /**\r\n * @internal\r\n */\r\n public override get _isReadyState(): Nullable<Promise<void>> {\r\n if (IsCSG2Ready()) {\r\n return null;\r\n }\r\n\r\n if (!this._csg2LoadingPromise) {\r\n this._csg2LoadingPromise = InitializeCSG2Async();\r\n }\r\n\r\n return this._csg2LoadingPromise;\r\n }\r\n\r\n /**\r\n * Create a new BooleanGeometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry0\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"geometry1\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"BooleanGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry0 input component\r\n */\r\n public get geometry0(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry1 input component\r\n */\r\n public get geometry1(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const vertexData0 = this.geometry0.getConnectedValue(state) as VertexData;\r\n const vertexData1 = this.geometry1.getConnectedValue(state) as VertexData;\r\n\r\n if (!vertexData0 || !vertexData1) {\r\n return null;\r\n }\r\n\r\n // Make both operands expose the same attributes, since CSG2 refuses mismatched vertex layouts.\r\n // Missing normals are computed from the geometry, missing colors default to white (as VertexData.merge does)\r\n // and missing UVs to zero. Every pad is sized to its own operand.\r\n const pad = (length: number, value: number) => new Array<number>(length).fill(value);\r\n const computeNormals = (geometry: VertexData) => {\r\n const normals: number[] = [];\r\n VertexData.ComputeNormals(geometry.positions, geometry.indices, normals);\r\n return normals;\r\n };\r\n const vertexCount0 = vertexData0.positions!.length / 3;\r\n const vertexCount1 = vertexData1.positions!.length / 3;\r\n if (!vertexData0.normals && vertexData1.normals) {\r\n vertexData0.normals = computeNormals(vertexData0);\r\n }\r\n if (!vertexData1.normals && vertexData0.normals) {\r\n vertexData1.normals = computeNormals(vertexData1);\r\n }\r\n // The legacy engine only reads the first UV set; CSG2 counts every set present.\r\n const uvSets = this.useOldCSGEngine ? ([\"uvs\"] as const) : ([\"uvs\", \"uvs2\", \"uvs3\", \"uvs4\", \"uvs5\", \"uvs6\"] as const);\r\n for (const key of uvSets) {\r\n if (!vertexData0[key] && vertexData1[key]) {\r\n vertexData0[key] = pad(vertexCount0 * 2, 0);\r\n }\r\n if (!vertexData1[key] && vertexData0[key]) {\r\n vertexData1[key] = pad(vertexCount1 * 2, 0);\r\n }\r\n }\r\n if (!vertexData0.colors && vertexData1.colors) {\r\n vertexData0.colors = pad(vertexCount0 * 4, 1);\r\n }\r\n if (!vertexData1.colors && vertexData0.colors) {\r\n vertexData1.colors = pad(vertexCount1 * 4, 1);\r\n }\r\n\r\n let boolCSG: CSG | CSG2;\r\n\r\n if (this.useOldCSGEngine) {\r\n const csg0 = CSG.FromVertexData(vertexData0);\r\n const csg1 = CSG.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.union(csg1);\r\n break;\r\n }\r\n } else {\r\n const csg0 = CSG2.FromVertexData(vertexData0);\r\n const csg1 = CSG2.FromVertexData(vertexData1);\r\n switch (this.operation) {\r\n case BooleanGeometryOperations.Intersect:\r\n boolCSG = csg0.intersect(csg1);\r\n break;\r\n case BooleanGeometryOperations.Subtract:\r\n boolCSG = csg0.subtract(csg1);\r\n break;\r\n case BooleanGeometryOperations.Union:\r\n boolCSG = csg0.add(csg1);\r\n break;\r\n }\r\n }\r\n\r\n return boolCSG.toVertexData();\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.operation = BABYLON.BooleanGeometryOperations.${BooleanGeometryOperations[this.operation]};\\n`;\r\n codeString += `${this._codeVariableName}.useOldCSGEngine = ${this.useOldCSGEngine ? \"true\" : \"false\"};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.operation = this.operation;\r\n serializationObject.useOldCSGEngine = this.useOldCSGEngine;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /** @internal */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n if (serializationObject.operation) {\r\n this.operation = serializationObject.operation;\r\n }\r\n\r\n this.useOldCSGEngine = !!serializationObject.useOldCSGEngine;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for booleanGeometryBlock.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterBooleanGeometryBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.BooleanGeometryBlock\", BooleanGeometryBlock);\r\n}\r\n"]}
|
|
@@ -12,6 +12,7 @@ import { type SubMesh } from "../Meshes/subMesh.pure.js";
|
|
|
12
12
|
import { PickingInfo } from "../Collisions/pickingInfo.js";
|
|
13
13
|
import { type ICullable, BoundingInfo } from "../Culling/boundingInfo.js";
|
|
14
14
|
import { type Material } from "../Materials/material.pure.js";
|
|
15
|
+
import { type DrawWrapper } from "../Materials/drawWrapper.js";
|
|
15
16
|
import { type Light } from "../Lights/light.js";
|
|
16
17
|
import { type Skeleton } from "../Bones/skeleton.js";
|
|
17
18
|
import { type MorphTargetManager } from "../Morph/morphTargetManager.js";
|
|
@@ -418,6 +419,17 @@ export declare abstract class AbstractMesh extends TransformNode implements IDis
|
|
|
418
419
|
* @param material material to use for this render pass. If undefined is passed, no specific material will be used for this render pass but the regular material will be used instead (mesh.material)
|
|
419
420
|
*/
|
|
420
421
|
setMaterialForRenderPass(renderPassId: number, material?: Material): void;
|
|
422
|
+
/**
|
|
423
|
+
* Checks whether a submesh rendered by this mesh can resolve to the given material in a render pass it has a draw wrapper for.
|
|
424
|
+
* SubMesh.getMaterial resolves a pass to the mesh's material for that pass (or its material), the scene's default material when
|
|
425
|
+
* there is none, or a sub-material of a multi-material: any other material can never resolve to the given one. A mesh that
|
|
426
|
+
* customizes getMaterialForRenderPass is always a candidate.
|
|
427
|
+
* @param material defines the material to check
|
|
428
|
+
* @param drawWrappers defines the draw wrappers of the submesh, indexed by render pass id
|
|
429
|
+
* @returns false when no render pass with a draw wrapper can resolve to the material
|
|
430
|
+
* @internal
|
|
431
|
+
*/
|
|
432
|
+
_mayRenderWithMaterial(material: Material, drawWrappers: Array<DrawWrapper>): boolean;
|
|
421
433
|
/**
|
|
422
434
|
* Gets or sets a boolean indicating that this mesh can receive realtime shadows
|
|
423
435
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
|
|
@@ -533,6 +533,38 @@ let AbstractMesh = (() => {
|
|
|
533
533
|
material.meshMap[this.uniqueId] = this;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* Checks whether a submesh rendered by this mesh can resolve to the given material in a render pass it has a draw wrapper for.
|
|
538
|
+
* SubMesh.getMaterial resolves a pass to the mesh's material for that pass (or its material), the scene's default material when
|
|
539
|
+
* there is none, or a sub-material of a multi-material: any other material can never resolve to the given one. A mesh that
|
|
540
|
+
* customizes getMaterialForRenderPass is always a candidate.
|
|
541
|
+
* @param material defines the material to check
|
|
542
|
+
* @param drawWrappers defines the draw wrappers of the submesh, indexed by render pass id
|
|
543
|
+
* @returns false when no render pass with a draw wrapper can resolve to the material
|
|
544
|
+
* @internal
|
|
545
|
+
*/
|
|
546
|
+
_mayRenderWithMaterial(material, drawWrappers) {
|
|
547
|
+
if (this.getMaterialForRenderPass !== _a.prototype.getMaterialForRenderPass) {
|
|
548
|
+
return true;
|
|
549
|
+
}
|
|
550
|
+
const meshMaterial = this.material;
|
|
551
|
+
if (meshMaterial === material || !meshMaterial || meshMaterial.getSubMaterial !== undefined) {
|
|
552
|
+
return true;
|
|
553
|
+
}
|
|
554
|
+
const materialForRenderPass = this._internalAbstractMeshDataInfo._materialForRenderPass;
|
|
555
|
+
if (materialForRenderPass) {
|
|
556
|
+
// The array is indexed by render pass id and keeps its length when an override is removed: only the passes with a draw
|
|
557
|
+
// wrapper matter
|
|
558
|
+
const passCount = Math.min(drawWrappers.length, materialForRenderPass.length);
|
|
559
|
+
for (let passId = 0; passId < passCount; passId++) {
|
|
560
|
+
const passMaterial = materialForRenderPass[passId];
|
|
561
|
+
if (passMaterial && drawWrappers[passId] && (passMaterial === material || passMaterial.getSubMaterial !== undefined)) {
|
|
562
|
+
return true;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
536
568
|
/**
|
|
537
569
|
* Gets or sets a boolean indicating that this mesh can receive realtime shadows
|
|
538
570
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
|