@onerjs/core 8.56.4 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.core.js +36 -0
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animationGroup.pure.d.ts +61 -1
- package/Animations/animationGroup.pure.js +191 -2
- package/Animations/animationGroup.pure.js.map +1 -1
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/Animations/pure.d.ts +1 -0
- package/Animations/pure.js +1 -0
- package/Animations/pure.js.map +1 -1
- package/Animations/rootMotion.d.ts +560 -0
- package/Animations/rootMotion.js +1709 -0
- package/Animations/rootMotion.js.map +1 -0
- package/Animations/runtimeAnimation.d.ts +57 -0
- package/Animations/runtimeAnimation.js +127 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.d.ts +2 -0
- package/Cameras/arcRotateCamera.pure.js +2 -0
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.d.ts +2 -0
- package/Cameras/targetCamera.pure.js +7 -1
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.js +5 -5
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
- package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
- package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.pure.js +63 -0
- package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
- package/Engines/Extensions/index.d.ts +1 -0
- package/Engines/Extensions/index.js +1 -0
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/Extensions/pure.d.ts +1 -1
- package/Engines/Extensions/pure.js +1 -1
- package/Engines/Extensions/pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/index.d.ts +1 -0
- package/Engines/WebGPU/Extensions/index.js +1 -0
- package/Engines/WebGPU/Extensions/index.js.map +1 -1
- package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
- package/Engines/WebGPU/Extensions/pure.js +1 -1
- package/Engines/WebGPU/Extensions/pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
- package/Engines/WebGPU/webgpuBundleList.js +4 -0
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
- package/Engines/WebGPU/webgpuTextureManager.js +286 -13
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +2 -0
- package/Engines/abstractEngine.pure.js +7 -3
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +14 -0
- package/Engines/thinEngine.pure.js +48 -12
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +1 -0
- package/Engines/thinNativeEngine.pure.js +7 -1
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +4 -0
- package/Engines/thinWebGPUEngine.js +10 -1
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +5 -2
- package/Engines/webgpuEngine.pure.js +48 -13
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +53 -10
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +4 -0
- package/FlowGraph/flowGraph.js +38 -7
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphBlock.js +3 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +7 -0
- package/FlowGraph/flowGraphConnection.js +7 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +2 -1
- package/FlowGraph/flowGraphContext.js +4 -3
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
- package/FlowGraph/flowGraphCoordinator.js +47 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
- package/FlowGraph/flowGraphEventBlock.js +7 -0
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
- package/FlowGraph/flowGraphHostResolver.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +60 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/serialization.d.ts +2 -0
- package/FlowGraph/serialization.js +10 -22
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +8 -0
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.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/inputBlock.pure.js +20 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.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/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +69 -33
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/frameGraphObjectList.d.ts +6 -1
- package/FrameGraph/frameGraphObjectList.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
- package/FrameGraph/frameGraphRenderContext.js +5 -5
- package/FrameGraph/frameGraphRenderContext.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.d.ts +4 -0
- package/Inputs/scene.inputManager.js +50 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +151 -47
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
- package/Materials/Node/nodeMaterial.pure.js +4 -0
- package/Materials/Node/nodeMaterial.pure.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +25 -3
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +13 -14
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +6 -6
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/baseTexture.pure.js +3 -0
- package/Materials/Textures/baseTexture.pure.js.map +1 -1
- package/Materials/Textures/cubeTexture.pure.js +1 -1
- package/Materials/Textures/cubeTexture.pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +8 -1
- package/Materials/Textures/internalTexture.js +9 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
- package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +1 -1
- package/Materials/Textures/rawTexture3D.js +1 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/textureHelper.functions.d.ts +14 -0
- package/Materials/Textures/textureHelper.functions.js +24 -0
- package/Materials/Textures/textureHelper.functions.js.map +1 -1
- package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +46 -1
- package/Materials/materialHelper.geometryrendering.js +105 -8
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +2 -0
- package/Materials/prepass.defines.js +2 -0
- package/Materials/prepass.defines.js.map +1 -1
- package/Materials/pure.d.ts +1 -0
- package/Materials/pure.js +1 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +2 -0
- package/Materials/standardMaterial.pure.js +6 -3
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
- package/Meshes/Builders/polygonBuilder.pure.js +4 -1
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -14
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +20 -24
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +11 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +18 -0
- package/Meshes/abstractMesh.pure.js +22 -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/instancedMesh.pure.d.ts +5 -0
- package/Meshes/instancedMesh.pure.js +12 -0
- package/Meshes/instancedMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +23 -8
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/meshBlendingTag.d.ts +47 -0
- package/Meshes/meshBlendingTag.js +64 -0
- package/Meshes/meshBlendingTag.js.map +1 -0
- package/Meshes/polygonMesh.js +2 -2
- package/Meshes/polygonMesh.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/Misc/fileTools.pure.js +21 -0
- package/Misc/fileTools.pure.js.map +1 -1
- package/Misc/snapshotRenderingHelper.js +2 -2
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +2 -0
- package/Particles/gpuParticleSystem.pure.js +89 -28
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +2 -0
- package/Particles/thinParticleSystem.pure.js +84 -19
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
- package/Particles/webgl2ParticleSystem.pure.js +12 -4
- package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
- package/PostProcesses/meshBlendingBlueNoise.js +77 -0
- package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
- package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
- package/PostProcesses/meshBlendingPostProcess.js +315 -0
- package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
- package/PostProcesses/pure.d.ts +2 -0
- package/PostProcesses/pure.js +2 -0
- package/PostProcesses/pure.js.map +1 -1
- package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +8 -8
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -1
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.js +3 -4
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/edgesRenderer.pure.d.ts +4 -2
- package/Rendering/edgesRenderer.pure.js +11 -2
- package/Rendering/edgesRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +10 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +20 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +9 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +14 -9
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
- package/Rendering/geometryBufferRenderer.pure.js +126 -17
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +7 -1
- package/Rendering/objectRenderer.js +45 -7
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +6 -2
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -1
- package/Rendering/renderingManager.js +5 -4
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +6 -2
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
- package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/Shaders/default.fragment.js +31 -40
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfField.fragment.js +13 -9
- package/Shaders/depthOfField.fragment.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +63 -3
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +80 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/geometry.fragment.js +17 -11
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.js +43 -1
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +96 -16
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/meshBlending.fragment.d.ts +5 -0
- package/Shaders/meshBlending.fragment.js +519 -0
- package/Shaders/meshBlending.fragment.js.map +1 -0
- package/Shaders/particles.fragment.js +43 -1
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.js +84 -3
- package/Shaders/particles.vertex.js.map +1 -1
- package/Shaders/sprites.fragment.js +52 -2
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Shaders/sprites.vertex.js +62 -1
- package/Shaders/sprites.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +17 -48
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +80 -0
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +37 -2
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
- package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
- package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
- package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
- package/ShadersWGSL/meshBlending.fragment.js +576 -0
- package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
- package/ShadersWGSL/openpbr.fragment.js +2 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/particles.fragment.js +45 -1
- package/ShadersWGSL/particles.fragment.js.map +1 -1
- package/ShadersWGSL/particles.vertex.js +86 -4
- package/ShadersWGSL/particles.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +2 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.fragment.js +56 -2
- package/ShadersWGSL/sprites.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.vertex.js +62 -1
- package/ShadersWGSL/sprites.vertex.js.map +1 -1
- package/Sprites/spriteManager.d.ts +13 -0
- package/Sprites/spriteManager.js +15 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +24 -1
- package/Sprites/spriteRenderer.js +368 -50
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.d.ts +4 -0
- package/Sprites/thinSprite.js +4 -0
- package/Sprites/thinSprite.js.map +1 -1
- package/States/alphaCullingState.d.ts +3 -1
- package/States/alphaCullingState.js +18 -3
- package/States/alphaCullingState.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +5 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.d.ts +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +23 -0
- package/scene.pure.js +35 -0
- package/scene.pure.js.map +1 -1
|
@@ -26,6 +26,7 @@ export declare function CreatePolygonVertexData(polygon: Mesh, sideOrientation:
|
|
|
26
26
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
27
27
|
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
|
|
28
28
|
* * Remember you can only change the shape positions, not their number when updating a polygon
|
|
29
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
29
30
|
* @param name defines the name of the mesh
|
|
30
31
|
* @param options defines the options used to create the mesh
|
|
31
32
|
* @param scene defines the hosting scene
|
|
@@ -49,7 +50,9 @@ export declare function CreatePolygon(name: string, options: {
|
|
|
49
50
|
/**
|
|
50
51
|
* Creates an extruded polygon mesh, with depth in the Y direction.
|
|
51
52
|
* * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
|
|
53
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
52
54
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
|
|
55
|
+
* @see https://playground.babylonjs.com/#TJLZLN#0
|
|
53
56
|
* @param name defines the name of the mesh
|
|
54
57
|
* @param options defines the options used to create the mesh
|
|
55
58
|
* @param scene defines the hosting scene
|
|
@@ -60,6 +63,7 @@ export declare function ExtrudePolygon(name: string, options: {
|
|
|
60
63
|
shape: Vector3[];
|
|
61
64
|
holes?: Vector3[][];
|
|
62
65
|
depth?: number;
|
|
66
|
+
smoothingThreshold?: number;
|
|
63
67
|
faceUV?: Vector4[];
|
|
64
68
|
faceColors?: Color4[];
|
|
65
69
|
updatable?: boolean;
|
|
@@ -128,6 +128,7 @@ export function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors,
|
|
|
128
128
|
* * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
|
|
129
129
|
* * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)
|
|
130
130
|
* * Remember you can only change the shape positions, not their number when updating a polygon
|
|
131
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
131
132
|
* @param name defines the name of the mesh
|
|
132
133
|
* @param options defines the options used to create the mesh
|
|
133
134
|
* @param scene defines the hosting scene
|
|
@@ -139,7 +140,7 @@ export function CreatePolygon(name, options, scene = null, earcutInjection = ear
|
|
|
139
140
|
const shape = options.shape;
|
|
140
141
|
const holes = options.holes || [];
|
|
141
142
|
const depth = options.depth || 0;
|
|
142
|
-
const smoothingThreshold = options.smoothingThreshold
|
|
143
|
+
const smoothingThreshold = options.smoothingThreshold ?? 2;
|
|
143
144
|
if (options.instance) {
|
|
144
145
|
const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);
|
|
145
146
|
vertexData.applyToMesh(options.instance, options.updatable);
|
|
@@ -174,7 +175,9 @@ export function CreatePolygon(name, options, scene = null, earcutInjection = ear
|
|
|
174
175
|
/**
|
|
175
176
|
* Creates an extruded polygon mesh, with depth in the Y direction.
|
|
176
177
|
* * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)
|
|
178
|
+
* * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing
|
|
177
179
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace
|
|
180
|
+
* @see https://playground.babylonjs.com/#TJLZLN#0
|
|
178
181
|
* @param name defines the name of the mesh
|
|
179
182
|
* @param options defines the options used to create the mesh
|
|
180
183
|
* @param scene defines the hosting scene
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygonBuilder.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/polygonBuilder.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAO9E;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAa,EAAE,eAAuB,EAAE,GAAe,EAAE,OAAkB,EAAE,QAAkB,EAAE,OAAiB,EAAE,GAAa;IACrK,MAAM,MAAM,GAAc,GAAG,IAAI,IAAI,KAAK,CAAU,CAAC,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,CAAC;IAC3B,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,MAAM,IAAI,GAAY,GAAG,IAAI,KAAK,CAAC;IAEnC,0CAA0C;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,UAAU,IAAI,UAAU,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c,GAAG,CAClB,IAAY,EACZ,KAAgB,EAChB,KAAa,EACb,KAAY,EACZ,KAAmB,EACnB,SAAmB,EACnB,eAAwB,EACxB,eAAe,GAAG,MAAM,EACpB,EAAE;QACN,MAAM,OAAO,GAAG;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,SAAS;YACpB,eAAe,EAAE,eAAe;SACnC,CAAC;QACF,OAAO,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC,CAAC;AACN,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector4, type Vector3 } from \"../../Maths/math.vector.pure\";\r\n\r\nimport { Color4 } from \"../../Maths/math.color.pure\";\r\nimport { Mesh } from \"../mesh.pure\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { PolygonMeshBuilder } from \"../polygonMesh\";\r\nimport { type FloatArray, type IndicesArray, type Nullable } from \"../../types\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer.pure\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\nimport { type Scene } from \"../../scene.pure\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\ndeclare let earcut: any;\r\n\r\n/**\r\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\r\n * All parameters are provided by CreatePolygon as needed\r\n * @param polygon a mesh built from polygonTriangulation.build()\r\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\r\n * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\r\n * @returns the VertexData of the Polygon\r\n */\r\nexport function CreatePolygonVertexData(polygon: Mesh, sideOrientation: number, fUV?: Vector4[], fColors?: Color4[], frontUVs?: Vector4, backUVs?: Vector4, wrp?: boolean) {\r\n const faceUV: Vector4[] = fUV || new Array<Vector4>(3);\r\n const faceColors = fColors;\r\n const colors = [];\r\n const wrap: boolean = wrp || false;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < 3; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const positions = <FloatArray>polygon.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = <FloatArray>polygon.getVerticesData(VertexBuffer.NormalKind);\r\n const uvs = <FloatArray>polygon.getVerticesData(VertexBuffer.UVKind);\r\n const indices = <IndicesArray>polygon.getIndices();\r\n const startIndex = positions.length / 9;\r\n let disp: number;\r\n let distX: number;\r\n let distZ: number;\r\n let dist: number;\r\n let totalLen = 0;\r\n const cumulate = [0];\r\n if (wrap) {\r\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\r\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\r\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\r\n dist = Math.sqrt(distX * distX + distZ * distZ);\r\n totalLen += dist;\r\n cumulate.push(totalLen);\r\n }\r\n }\r\n // set face colours and textures\r\n let idx: number;\r\n let face: number = 0;\r\n for (let index = 0; index < normals.length; index += 3) {\r\n //Edge Face no. 1\r\n if (Math.abs(normals[index + 1]) < 0.001) {\r\n face = 1;\r\n }\r\n //Top Face no. 0\r\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\r\n face = 0;\r\n }\r\n //Bottom Face no. 2\r\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\r\n face = 2;\r\n }\r\n idx = index / 3;\r\n if (face === 1) {\r\n disp = idx - startIndex;\r\n if (disp % 4 < 1.5) {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].x;\r\n }\r\n } else {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].z;\r\n }\r\n }\r\n if (disp % 2 === 0) {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\r\n } else {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\r\n }\r\n } else {\r\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\r\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\r\n\r\n if (useOpenGLOrientationForUV) {\r\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\r\n }\r\n }\r\n if (faceColors) {\r\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\r\n }\r\n }\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a polygon mesh\r\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\r\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\r\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)\r\n * * Remember you can only change the shape positions, not their number when updating a polygon\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function CreatePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n instance?: Mesh;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const shape = options.shape;\r\n const holes = options.holes || [];\r\n const depth = options.depth || 0;\r\n const smoothingThreshold = options.smoothingThreshold || 2;\r\n if (options.instance) {\r\n const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(options.instance, options.updatable);\r\n return options.instance;\r\n } else {\r\n const contours: Array<Vector2> = [];\r\n let hole: Array<Vector2>;\r\n\r\n for (let i = 0; i < shape.length; i++) {\r\n contours[i] = new Vector2(shape[i].x, shape[i].z);\r\n }\r\n const epsilon = 0.00000001;\r\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\r\n contours.pop();\r\n }\r\n\r\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene!, earcutInjection);\r\n for (let hNb = 0; hNb < holes.length; hNb++) {\r\n hole = [];\r\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\r\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\r\n }\r\n polygonTriangulation.addHole(hole);\r\n }\r\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\r\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\r\n polygon._originalBuilderSideOrientation = options.sideOrientation;\r\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(polygon, options.updatable);\r\n return polygon;\r\n }\r\n}\r\n\r\n/**\r\n * Creates an extruded polygon mesh, with depth in the Y direction.\r\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function ExtrudePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const PolygonBuilder = {\r\n ExtrudePolygon,\r\n CreatePolygon,\r\n};\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for polygonBuilder.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterPolygonBuilder(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n VertexData.CreatePolygon = CreatePolygonVertexData;\r\n\r\n Mesh.CreatePolygon = (name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection = earcut): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n };\r\n\r\n Mesh.ExtrudePolygon = (\r\n name: string,\r\n shape: Vector3[],\r\n depth: number,\r\n scene: Scene,\r\n holes?: Vector3[][],\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n earcutInjection = earcut\r\n ): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n depth: depth,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return ExtrudePolygon(name, options, scene, earcutInjection);\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"polygonBuilder.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/polygonBuilder.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAgB,MAAM,8BAA8B,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EA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esContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { Vector2, Vector4, type Vector3 } from \"../../Maths/math.vector.pure\";\r\n\r\nimport { Color4 } from \"../../Maths/math.color.pure\";\r\nimport { Mesh } from \"../mesh.pure\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { PolygonMeshBuilder } from \"../polygonMesh\";\r\nimport { type FloatArray, type IndicesArray, type Nullable } from \"../../types\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer.pure\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\nimport { type Scene } from \"../../scene.pure\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\ndeclare let earcut: any;\r\n\r\n/**\r\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\r\n * All parameters are provided by CreatePolygon as needed\r\n * @param polygon a mesh built from polygonTriangulation.build()\r\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\r\n * @param frontUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * @param backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\r\n * @returns the VertexData of the Polygon\r\n */\r\nexport function CreatePolygonVertexData(polygon: Mesh, sideOrientation: number, fUV?: Vector4[], fColors?: Color4[], frontUVs?: Vector4, backUVs?: Vector4, wrp?: boolean) {\r\n const faceUV: Vector4[] = fUV || new Array<Vector4>(3);\r\n const faceColors = fColors;\r\n const colors = [];\r\n const wrap: boolean = wrp || false;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < 3; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const positions = <FloatArray>polygon.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = <FloatArray>polygon.getVerticesData(VertexBuffer.NormalKind);\r\n const uvs = <FloatArray>polygon.getVerticesData(VertexBuffer.UVKind);\r\n const indices = <IndicesArray>polygon.getIndices();\r\n const startIndex = positions.length / 9;\r\n let disp: number;\r\n let distX: number;\r\n let distZ: number;\r\n let dist: number;\r\n let totalLen = 0;\r\n const cumulate = [0];\r\n if (wrap) {\r\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\r\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\r\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\r\n dist = Math.sqrt(distX * distX + distZ * distZ);\r\n totalLen += dist;\r\n cumulate.push(totalLen);\r\n }\r\n }\r\n // set face colours and textures\r\n let idx: number;\r\n let face: number = 0;\r\n for (let index = 0; index < normals.length; index += 3) {\r\n //Edge Face no. 1\r\n if (Math.abs(normals[index + 1]) < 0.001) {\r\n face = 1;\r\n }\r\n //Top Face no. 0\r\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\r\n face = 0;\r\n }\r\n //Bottom Face no. 2\r\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\r\n face = 2;\r\n }\r\n idx = index / 3;\r\n if (face === 1) {\r\n disp = idx - startIndex;\r\n if (disp % 4 < 1.5) {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].x;\r\n }\r\n } else {\r\n if (wrap) {\r\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\r\n } else {\r\n uvs[2 * idx] = faceUV[face].z;\r\n }\r\n }\r\n if (disp % 2 === 0) {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\r\n } else {\r\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\r\n }\r\n } else {\r\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\r\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\r\n\r\n if (useOpenGLOrientationForUV) {\r\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\r\n }\r\n }\r\n if (faceColors) {\r\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\r\n }\r\n }\r\n\r\n // sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a polygon mesh\r\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\r\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\r\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4)\r\n * * Remember you can only change the shape positions, not their number when updating a polygon\r\n * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function CreatePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n instance?: Mesh;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const shape = options.shape;\r\n const holes = options.holes || [];\r\n const depth = options.depth || 0;\r\n const smoothingThreshold = options.smoothingThreshold ?? 2;\r\n if (options.instance) {\r\n const vertexData = CreatePolygonVertexData(options.instance, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(options.instance, options.updatable);\r\n return options.instance;\r\n } else {\r\n const contours: Array<Vector2> = [];\r\n let hole: Array<Vector2>;\r\n\r\n for (let i = 0; i < shape.length; i++) {\r\n contours[i] = new Vector2(shape[i].x, shape[i].z);\r\n }\r\n const epsilon = 0.00000001;\r\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\r\n contours.pop();\r\n }\r\n\r\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene!, earcutInjection);\r\n for (let hNb = 0; hNb < holes.length; hNb++) {\r\n hole = [];\r\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\r\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\r\n }\r\n polygonTriangulation.addHole(hole);\r\n }\r\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\r\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\r\n polygon._originalBuilderSideOrientation = options.sideOrientation;\r\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\r\n vertexData.applyToMesh(polygon, options.updatable);\r\n return polygon;\r\n }\r\n}\r\n\r\n/**\r\n * Creates an extruded polygon mesh, with depth in the Y direction.\r\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\r\n * * The `smoothingThreshold` option defines the dot product threshold for smoothing the normals of adjacent side faces. The default value of 2 disables smoothing\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\r\n * @see https://playground.babylonjs.com/#TJLZLN#0\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @param earcutInjection can be used to inject your own earcut reference\r\n * @returns the polygon mesh\r\n */\r\nexport function ExtrudePolygon(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n holes?: Vector3[][];\r\n depth?: number;\r\n smoothingThreshold?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n wrap?: boolean;\r\n },\r\n scene: Nullable<Scene> = null,\r\n earcutInjection = earcut\r\n): Mesh {\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const PolygonBuilder = {\r\n ExtrudePolygon,\r\n CreatePolygon,\r\n};\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for polygonBuilder.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterPolygonBuilder(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n VertexData.CreatePolygon = CreatePolygonVertexData;\r\n\r\n Mesh.CreatePolygon = (name: string, shape: Vector3[], scene: Scene, holes?: Vector3[][], updatable?: boolean, sideOrientation?: number, earcutInjection = earcut): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return CreatePolygon(name, options, scene, earcutInjection);\r\n };\r\n\r\n Mesh.ExtrudePolygon = (\r\n name: string,\r\n shape: Vector3[],\r\n depth: number,\r\n scene: Scene,\r\n holes?: Vector3[][],\r\n updatable?: boolean,\r\n sideOrientation?: number,\r\n earcutInjection = earcut\r\n ): Mesh => {\r\n const options = {\r\n shape: shape,\r\n holes: holes,\r\n depth: depth,\r\n updatable: updatable,\r\n sideOrientation: sideOrientation,\r\n };\r\n return ExtrudePolygon(name, options, scene, earcutInjection);\r\n };\r\n}\r\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type AbstractMesh } from "../abstractMesh.pure.js";
|
|
2
|
+
/**
|
|
3
|
+
* True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
|
|
4
|
+
* `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
|
|
5
|
+
* (also returned by `GaussianSplattingCompoundMesh`) or `"GaussianSplattingStream"`.
|
|
6
|
+
*
|
|
7
|
+
* This function is retained for backward compatibility. Internal code should prefer
|
|
8
|
+
* {@link _IsGaussianSplattingMesh}, which also recognizes the inherited Gaussian Splatting capability.
|
|
9
|
+
* @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
|
|
10
|
+
* @returns true if the class name identifies a Gaussian Splatting mesh
|
|
11
|
+
*/
|
|
12
|
+
export declare function IsGaussianSplattingClassName(className: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Tests whether a mesh uses Gaussian Splatting rendering behavior.
|
|
15
|
+
* @param mesh the mesh to test
|
|
16
|
+
* @returns true if the mesh is a Gaussian Splatting mesh
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function _IsGaussianSplattingMesh(mesh: AbstractMesh): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
|
|
3
|
+
* `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
|
|
4
|
+
* (also returned by `GaussianSplattingCompoundMesh`) or `"GaussianSplattingStream"`.
|
|
5
|
+
*
|
|
6
|
+
* This function is retained for backward compatibility. Internal code should prefer
|
|
7
|
+
* {@link _IsGaussianSplattingMesh}, which also recognizes the inherited Gaussian Splatting capability.
|
|
8
|
+
* @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
|
|
9
|
+
* @returns true if the class name identifies a Gaussian Splatting mesh
|
|
10
|
+
*/
|
|
11
|
+
export function IsGaussianSplattingClassName(className) {
|
|
12
|
+
return className === "GaussianSplattingMesh" || className === "GaussianSplattingStream";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Tests whether a mesh uses Gaussian Splatting rendering behavior.
|
|
16
|
+
* @param mesh the mesh to test
|
|
17
|
+
* @returns true if the mesh is a Gaussian Splatting mesh
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export function _IsGaussianSplattingMesh(mesh) {
|
|
21
|
+
return mesh._isGaussianSplatting || IsGaussianSplattingClassName(mesh.getClassName());
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=gaussianSplatting.functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplatting.functions.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplatting.functions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC1D,OAAO,SAAS,KAAK,uBAAuB,IAAI,SAAS,KAAK,yBAAyB,CAAC;AAC5F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAkB;IACvD,OAAO,IAAI,CAAC,oBAAoB,IAAI,4BAA4B,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import { type AbstractMesh } from \"../abstractMesh.pure\";\r\n\r\n/**\r\n * True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose\r\n * `position.z` vertex attribute encodes a splat index rather than world-space Z: `\"GaussianSplattingMesh\"`\r\n * (also returned by `GaussianSplattingCompoundMesh`) or `\"GaussianSplattingStream\"`.\r\n *\r\n * This function is retained for backward compatibility. Internal code should prefer\r\n * {@link _IsGaussianSplattingMesh}, which also recognizes the inherited Gaussian Splatting capability.\r\n * @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`\r\n * @returns true if the class name identifies a Gaussian Splatting mesh\r\n */\r\nexport function IsGaussianSplattingClassName(className: string): boolean {\r\n return className === \"GaussianSplattingMesh\" || className === \"GaussianSplattingStream\";\r\n}\r\n\r\n/**\r\n * Tests whether a mesh uses Gaussian Splatting rendering behavior.\r\n * @param mesh the mesh to test\r\n * @returns true if the mesh is a Gaussian Splatting mesh\r\n * @internal\r\n */\r\nexport function _IsGaussianSplattingMesh(mesh: AbstractMesh): boolean {\r\n return mesh._isGaussianSplatting || IsGaussianSplattingClassName(mesh.getClassName());\r\n}\r\n"]}
|
|
@@ -10,6 +10,7 @@ import { GaussianSplattingPartProxyMesh } from "./gaussianSplattingPartProxyMesh
|
|
|
10
10
|
import { BoundingInfo } from "../../Culling/boundingInfo.js";
|
|
11
11
|
import { type BaseTexture } from "../../Materials/Textures/baseTexture.pure.js";
|
|
12
12
|
import { type AbstractMesh } from "../abstractMesh.pure.js";
|
|
13
|
+
export { IsGaussianSplattingClassName } from "./gaussianSplatting.functions.js";
|
|
13
14
|
interface IGaussianSplattingPartSource {
|
|
14
15
|
name: string;
|
|
15
16
|
_vertexCount: number;
|
|
@@ -203,6 +204,8 @@ export declare class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
203
204
|
private _tombstonedPartIndices;
|
|
204
205
|
private _partIndicesTexture;
|
|
205
206
|
private _partIndices;
|
|
207
|
+
private _partWorldData;
|
|
208
|
+
private readonly _partVisibilityData;
|
|
206
209
|
/** Gets the part indices texture used for compound rendering */
|
|
207
210
|
get partIndicesTexture(): Nullable<BaseTexture>;
|
|
208
211
|
/**
|
|
@@ -545,22 +548,8 @@ export declare class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
545
548
|
*/
|
|
546
549
|
static Parse(parsedMesh: any, scene: Scene): GaussianSplattingMesh;
|
|
547
550
|
}
|
|
548
|
-
/**
|
|
549
|
-
* True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
|
|
550
|
-
* `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
|
|
551
|
-
* (also returned by {@link GaussianSplattingCompoundMesh}, which deliberately does not override
|
|
552
|
-
* `getClassName()`) and `"GaussianSplattingStream"` (which does override it, to remain distinguishable for
|
|
553
|
-
* other purposes). Rendering-pipeline code that must treat any Gaussian Splatting mesh differently from an
|
|
554
|
-
* ordinary mesh (geometry buffer, depth pre-pass, GPU picking, IBL voxelization, snapshot rendering, ...)
|
|
555
|
-
* should use this instead of a literal string comparison, so a future splat mesh subclass only needs to be
|
|
556
|
-
* added here once.
|
|
557
|
-
* @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
|
|
558
|
-
* @returns true if the class name identifies a Gaussian Splatting mesh
|
|
559
|
-
*/
|
|
560
|
-
export declare function IsGaussianSplattingClassName(className: string): boolean;
|
|
561
551
|
/**
|
|
562
552
|
* Register side effects for gaussianSplattingMesh.
|
|
563
553
|
* Safe to call multiple times; only the first call has an effect.
|
|
564
554
|
*/
|
|
565
555
|
export declare function RegisterGaussianSplattingMesh(): void;
|
|
566
|
-
export {};
|
|
@@ -9,6 +9,7 @@ import { DecodeBase64ToBinary, EncodeArrayBufferToBase64 } from "../../Misc/stri
|
|
|
9
9
|
import { Mesh } from "../mesh.pure.js";
|
|
10
10
|
import { GaussianSplattingPartProxyMesh } from "./gaussianSplattingPartProxyMesh.pure.js";
|
|
11
11
|
import { BoundingInfo } from "../../Culling/boundingInfo.js";
|
|
12
|
+
export { IsGaussianSplattingClassName } from "./gaussianSplatting.functions.js";
|
|
12
13
|
const _GaussianSplattingBytesPerSplat = 32;
|
|
13
14
|
const _GaussianSplattingBytesPerShTexel = 16;
|
|
14
15
|
/**
|
|
@@ -135,6 +136,8 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
135
136
|
this._tombstonedPartIndices = new Set();
|
|
136
137
|
this._partIndicesTexture = null;
|
|
137
138
|
this._partIndices = null;
|
|
139
|
+
this._partWorldData = new Float32Array(0);
|
|
140
|
+
this._partVisibilityData = [];
|
|
138
141
|
// Ensure _splatsData is retained once compound mode is entered — addPart/addParts need
|
|
139
142
|
// the source data for full-texture rebuilds. Set after super() so it is visible to
|
|
140
143
|
// _updateData when the async load completes.
|
|
@@ -366,14 +369,19 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
366
369
|
return;
|
|
367
370
|
}
|
|
368
371
|
effect.setTexture("partIndicesTexture", this._partIndicesTexture);
|
|
369
|
-
const
|
|
372
|
+
const partWorldDataLength = this.partCount * 16;
|
|
373
|
+
if (this._partWorldData.length !== partWorldDataLength) {
|
|
374
|
+
this._partWorldData = new Float32Array(partWorldDataLength);
|
|
375
|
+
}
|
|
376
|
+
const partWorldData = this._partWorldData;
|
|
370
377
|
for (let i = 0; i < this.partCount; i++) {
|
|
371
378
|
this._partMatrices[i].toArray(partWorldData, i * 16);
|
|
372
379
|
}
|
|
373
380
|
effect.setMatrices("partWorld", partWorldData);
|
|
374
|
-
const partVisibilityData =
|
|
381
|
+
const partVisibilityData = this._partVisibilityData;
|
|
382
|
+
partVisibilityData.length = this.partCount;
|
|
375
383
|
for (let i = 0; i < this.partCount; i++) {
|
|
376
|
-
partVisibilityData
|
|
384
|
+
partVisibilityData[i] = this._partVisibility[i] ?? 1.0;
|
|
377
385
|
}
|
|
378
386
|
effect.setArray("partVisibility", partVisibilityData);
|
|
379
387
|
}
|
|
@@ -685,7 +693,7 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
685
693
|
}
|
|
686
694
|
_onUpdateTextures(textureSize) {
|
|
687
695
|
const createTextureFromDataU8 = (data, width, height, format) => {
|
|
688
|
-
return new RawTexture(data, width, height, format, this._scene, false, false,
|
|
696
|
+
return new RawTexture(data, width, height, format, this._scene, false, false, 1, 0);
|
|
689
697
|
};
|
|
690
698
|
// Keep the part indices texture in sync with _partIndices whenever textures are rebuilt.
|
|
691
699
|
// The old "only create if absent" logic left the texture stale after a second addPart/addParts
|
|
@@ -741,7 +749,7 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
741
749
|
return;
|
|
742
750
|
}
|
|
743
751
|
const buffer = new Uint8Array(this._partIndices);
|
|
744
|
-
this._partIndicesTexture = new RawTexture(buffer, textureSize.x, textureSize.y, 6, this._scene, false, false,
|
|
752
|
+
this._partIndicesTexture = new RawTexture(buffer, textureSize.x, textureSize.y, 6, this._scene, false, false, 1, 0);
|
|
745
753
|
this._partIndicesTexture.wrapU = 0;
|
|
746
754
|
this._partIndicesTexture.wrapV = 0;
|
|
747
755
|
if (this._worker) {
|
|
@@ -785,11 +793,14 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
785
793
|
splatByteOffset += existingVertexCount * _GaussianSplattingBytesPerSplat;
|
|
786
794
|
}
|
|
787
795
|
for (const other of others) {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
796
|
+
// A reserved-empty streaming source carries no CPU data but still owns its slot in the atlas (its
|
|
797
|
+
// GPU rows are decoded later). Advance past that slot regardless of data so a real source appended
|
|
798
|
+
// after it lands at the offset its proxy's _splatsDataOffset points to — matching the unconditional
|
|
799
|
+
// GPU dstOffset advance in _addPartsInternal (and the SH loop below).
|
|
791
800
|
const splatByteLength = other._vertexCount * _GaussianSplattingBytesPerSplat;
|
|
792
|
-
|
|
801
|
+
if (other._splatsData) {
|
|
802
|
+
mergedSplatsData.set(GaussianSplattingMeshBase._GetSplatDataBytes(other._splatsData).subarray(0, splatByteLength), splatByteOffset);
|
|
803
|
+
}
|
|
793
804
|
splatByteOffset += splatByteLength;
|
|
794
805
|
}
|
|
795
806
|
this._splatsData = mergedSplatsData.buffer;
|
|
@@ -1991,21 +2002,6 @@ export class GaussianSplattingMesh extends GaussianSplattingMeshBase {
|
|
|
1991
2002
|
return GaussianSplattingMesh._ParseInternal(parsedMesh, scene, GaussianSplattingMesh);
|
|
1992
2003
|
}
|
|
1993
2004
|
}
|
|
1994
|
-
/**
|
|
1995
|
-
* True when `className` (from `AbstractMesh.getClassName()`) identifies a Gaussian Splatting mesh whose
|
|
1996
|
-
* `position.z` vertex attribute encodes a splat index rather than world-space Z: `"GaussianSplattingMesh"`
|
|
1997
|
-
* (also returned by {@link GaussianSplattingCompoundMesh}, which deliberately does not override
|
|
1998
|
-
* `getClassName()`) and `"GaussianSplattingStream"` (which does override it, to remain distinguishable for
|
|
1999
|
-
* other purposes). Rendering-pipeline code that must treat any Gaussian Splatting mesh differently from an
|
|
2000
|
-
* ordinary mesh (geometry buffer, depth pre-pass, GPU picking, IBL voxelization, snapshot rendering, ...)
|
|
2001
|
-
* should use this instead of a literal string comparison, so a future splat mesh subclass only needs to be
|
|
2002
|
-
* added here once.
|
|
2003
|
-
* @param className the mesh class name to test, e.g. from `AbstractMesh.getClassName()`
|
|
2004
|
-
* @returns true if the class name identifies a Gaussian Splatting mesh
|
|
2005
|
-
*/
|
|
2006
|
-
export function IsGaussianSplattingClassName(className) {
|
|
2007
|
-
return className === "GaussianSplattingMesh" || className === "GaussianSplattingStream";
|
|
2008
|
-
}
|
|
2009
2005
|
let _Registered = false;
|
|
2010
2006
|
/**
|
|
2011
2007
|
* Register side effects for gaussianSplattingMesh.
|