@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphValidator.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphValidator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAN,IAAkB,2BAKjB;AALD,WAAkB,2BAA2B;IACzC,wDAAwD;IACxD,+EAAK,CAAA;IACL,qDAAqD;IACrD,mFAAO,CAAA;AACX,CAAC,EALiB,2BAA2B,KAA3B,2BAA2B,QAK5C;AAgCD,kFAAkF;AACl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AAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC;YACtC,GAAG,CAAC,KAAK,CAAC,CAAC;QACf,CAAC;IACL,CAAC;AACL,CAAC","sourcesContent":["import { type FlowGraph } from \"./flowGraph\";\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphTypes } from \"./flowGraphRichTypes.pure\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { type FlowGraphEventType } from \"./flowGraphEventType\";\n\n/**\n * Severity level for a validation issue.\n */\nexport const enum FlowGraphValidationSeverity {\n /** A critical issue that will cause runtime failure. */\n Error,\n /** A potential issue that may indicate a mistake. */\n Warning,\n}\n\n/**\n * A single validation issue found in the flow graph.\n */\nexport interface IFlowGraphValidationIssue {\n /** The severity level. */\n severity: FlowGraphValidationSeverity;\n /** Human-readable description of the issue. */\n message: string;\n /** The block where the issue was found (if applicable). */\n block?: FlowGraphBlock;\n /** The connection name involved (if applicable). */\n connectionName?: string;\n}\n\n/**\n * The result of validating a flow graph.\n */\nexport interface IFlowGraphValidationResult {\n /** Whether the graph passed validation with no errors. */\n isValid: boolean;\n /** All issues found, ordered by severity (errors first). */\n issues: IFlowGraphValidationIssue[];\n /** Convenience: number of error-level issues. */\n errorCount: number;\n /** Convenience: number of warning-level issues. */\n warningCount: number;\n /** Map from block uniqueId to the issues affecting that block. */\n issuesByBlock: Map<string, IFlowGraphValidationIssue[]>;\n}\n\n// Types that are mutually coercible and should not produce type-mismatch warnings\nconst NumericLikeTypes = new Set<string>([FlowGraphTypes.Number, FlowGraphTypes.Integer, FlowGraphTypes.Boolean]);\nconst VectorLikeTypes = new Set<string>([FlowGraphTypes.Vector4, FlowGraphTypes.Quaternion]);\nconst ColorLikeTypes = new Set<string>([FlowGraphTypes.Color3, FlowGraphTypes.Color4]);\n\n/**\n * @internal\n */\nfunction _AreTypesCompatible(sourceType: string, targetType: string): boolean {\n if (sourceType === targetType) {\n return true;\n }\n // \"any\" is compatible with everything\n if (sourceType === FlowGraphTypes.Any || targetType === FlowGraphTypes.Any) {\n return true;\n }\n // Numeric coercion group\n if (NumericLikeTypes.has(sourceType) && NumericLikeTypes.has(targetType)) {\n return true;\n }\n // Vector4 / Quaternion are interchangeable\n if (VectorLikeTypes.has(sourceType) && VectorLikeTypes.has(targetType)) {\n return true;\n }\n // Color3 → Color4 widening is safe\n if (ColorLikeTypes.has(sourceType) && ColorLikeTypes.has(targetType)) {\n return true;\n }\n return false;\n}\n\n/**\n * Validates a flow graph and returns all issues found.\n *\n * The following checks are performed:\n * 1. **No event blocks** — the graph has no entry points.\n * 2. **Unconnected required data inputs** — a non-optional data input with no connection.\n * 3. **Unconnected signal inputs** — an execution block whose `in` signal has no connection and\n * that is not an event block (entry point).\n * 4. **Data type mismatches** — a data connection whose source richType is incompatible with the\n * target richType.\n * 5. **Unreachable blocks** — blocks not reachable from any event block via signal/data traversal.\n * 6. **Data dependency cycles** — circular data-only connections that would cause infinite recursion.\n *\n * @param flowGraph - The flow graph to validate.\n * @returns The validation result.\n */\nexport function ValidateFlowGraph(flowGraph: FlowGraph): IFlowGraphValidationResult {\n const issues: IFlowGraphValidationIssue[] = [];\n const issuesByBlock = new Map<string, IFlowGraphValidationIssue[]>();\n\n const addIssue = (issue: IFlowGraphValidationIssue) => {\n issues.push(issue);\n if (issue.block) {\n let arr = issuesByBlock.get(issue.block.uniqueId);\n if (!arr) {\n arr = [];\n issuesByBlock.set(issue.block.uniqueId, arr);\n }\n arr.push(issue);\n }\n };\n\n // Collect ALL blocks via visitAllBlocks\n const allBlocks: FlowGraphBlock[] = [];\n flowGraph.visitAllBlocks((block) => {\n allBlocks.push(block);\n });\n\n // ── Check 1: No event blocks ───────────────────────────────────────\n const eventBlocks = _GetEventBlocks(flowGraph);\n if (eventBlocks.length === 0) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: \"Graph has no event blocks — nothing will trigger execution.\",\n });\n }\n\n // ── Check 2: Unconnected required data inputs ──────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 3: Unconnected signal inputs on non-event execution blocks\n for (const block of allBlocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n // Skip event blocks — they are entry points and don't need an incoming signal.\n if (_IsEventBlock(block)) {\n continue;\n }\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n });\n }\n }\n }\n\n // ── Check 4: Data type mismatches ──────────────────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n const source = input._connectedPoint[0] as FlowGraphDataConnection<any>;\n const srcType = source.richType?.typeName;\n const tgtType = input.richType?.typeName;\n if (srcType && tgtType && !_AreTypesCompatible(srcType, tgtType)) {\n // If either side has a typeTransformer, it's intentionally converted\n if (source.richType.typeTransformer !== undefined || input.richType.typeTransformer !== undefined) {\n continue;\n }\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `Type mismatch: \"${source._ownerBlock.name}.${source.name}\" (${srcType}) → \"${block.name}.${input.name}\" (${tgtType}).`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 5: Unreachable blocks ────────────────────────────────────\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n // We need to also check standalone data blocks not visited by visitAllBlocks.\n // visitAllBlocks starts from event blocks; any block not found is unreachable.\n // Since we can only iterate blocks we know about, the allBlocks list IS\n // from visitAllBlocks, so everything in it IS reachable.\n // There's no separate registry of \"all added blocks\" in the FlowGraph.\n // So: unreachable blocks are blocks that exist but aren't visited.\n // Currently visitAllBlocks IS our source, so this check is a no-op for\n // blocks added via the graph. However, the editor creates nodes and adds\n // execution blocks, so we should compare against the editor's full list.\n // For the core validator, we expose a variant that accepts an external block list.\n\n // ── Check 6: Data dependency cycles ────────────────────────────────\n _DetectDataCycles(allBlocks, addIssue);\n\n // Sort: errors first, then warnings\n issues.sort((a, b) => a.severity - b.severity);\n\n return {\n isValid: issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error),\n issues,\n errorCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Error).length,\n warningCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Warning).length,\n issuesByBlock,\n };\n}\n\n/**\n * Extended validation that also checks for unreachable blocks.\n * Requires a full list of all blocks in the graph (including those not reachable\n * from event blocks via the normal traversal).\n *\n * @param flowGraph - The flow graph to validate.\n * @param allKnownBlocks - Complete list of all blocks (e.g., from the editor's node set).\n * @returns The validation result.\n */\nexport function ValidateFlowGraphWithBlockList(flowGraph: FlowGraph, allKnownBlocks: FlowGraphBlock[]): IFlowGraphValidationResult {\n const result = ValidateFlowGraph(flowGraph);\n\n // Check for unreachable blocks\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n\n for (const block of allKnownBlocks) {\n if (!reachableIds.has(block.uniqueId)) {\n const issue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `Block is unreachable from any event block.`,\n block,\n };\n result.issues.push(issue);\n result.warningCount++;\n let arr = result.issuesByBlock.get(block.uniqueId);\n if (!arr) {\n arr = [];\n result.issuesByBlock.set(block.uniqueId, arr);\n }\n arr.push(issue);\n\n // Also run Check 2 and Check 3 on unreachable blocks so the editor\n // can display all issues, not just reachability ones.\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n const dataIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n };\n result.issues.push(dataIssue);\n result.warningCount++;\n arr.push(dataIssue);\n }\n }\n\n if (block instanceof FlowGraphExecutionBlock && !_IsEventBlock(block)) {\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n const signalIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n };\n result.issues.push(signalIssue);\n result.errorCount++;\n arr.push(signalIssue);\n }\n }\n }\n }\n\n result.isValid = result.issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error);\n result.issues.sort((a, b) => a.severity - b.severity);\n return result;\n}\n\n/**\n * Get all event blocks from a flow graph.\n * @param flowGraph - the flow graph\n * @returns the event blocks\n */\nfunction _GetEventBlocks(flowGraph: FlowGraph): FlowGraphEventBlock[] {\n const eventBlocks: FlowGraphEventBlock[] = [];\n for (const type in flowGraph._eventBlocks) {\n for (const block of flowGraph._eventBlocks[type as FlowGraphEventType]) {\n eventBlocks.push(block);\n }\n }\n return eventBlocks;\n}\n\n/**\n * Detect whether a block is an event block (entry point).\n * @param block - the block to check\n * @returns true if it is an event block\n */\nfunction _IsEventBlock(block: FlowGraphBlock): boolean {\n return block instanceof FlowGraphEventBlock;\n}\n\n/**\n * Detects cycles among data-only blocks.\n * A data cycle means that block A's output feeds into block B's input, and\n * block B's output feeds back into block A (directly or indirectly).\n * This would cause infinite recursion during getValue().\n * @param allBlocks - all blocks to check\n * @param addIssue - callback to report issues\n */\nfunction _DetectDataCycles(allBlocks: FlowGraphBlock[], addIssue: (issue: IFlowGraphValidationIssue) => void): void {\n // Build adjacency: for each block, which blocks do its data inputs depend on?\n // (Data inputs pull values from connected output blocks.)\n const white = 0; // unvisited\n const gray = 1; // in current DFS path\n const black = 2; // fully explored\n const color = new Map<string, number>();\n\n for (const block of allBlocks) {\n color.set(block.uniqueId, white);\n }\n\n const blockMap = new Map<string, FlowGraphBlock>();\n for (const block of allBlocks) {\n blockMap.set(block.uniqueId, block);\n }\n\n const reportedCycleBlocks = new Set<string>();\n\n function dfs(block: FlowGraphBlock): boolean {\n color.set(block.uniqueId, gray);\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n for (const connected of input._connectedPoint) {\n const dep = (connected as FlowGraphDataConnection<any>)._ownerBlock;\n // Only consider data-only blocks (not execution blocks which are driven by signals)\n if (dep instanceof FlowGraphExecutionBlock) {\n continue;\n }\n const depColor = color.get(dep.uniqueId);\n if (depColor === gray) {\n // Cycle found\n if (!reportedCycleBlocks.has(block.uniqueId)) {\n reportedCycleBlocks.add(block.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block,\n });\n }\n if (!reportedCycleBlocks.has(dep.uniqueId)) {\n reportedCycleBlocks.add(dep.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block: dep,\n });\n }\n return true;\n }\n if (depColor === white) {\n dfs(dep);\n }\n }\n }\n color.set(block.uniqueId, black);\n return false;\n }\n\n for (const block of allBlocks) {\n if (color.get(block.uniqueId) === white) {\n dfs(block);\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphValidator.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphValidator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,MAAM,CAAN,IAAkB,2BAKjB;AALD,WAAkB,2BAA2B;IACzC,wDAAwD;IACxD,+EAAK,CAAA;IACL,qDAAqD;IACrD,mFAAO,CAAA;AACX,CAAC,EAL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} from \"./flowGraph\";\nimport { type FlowGraphBlock } from \"./flowGraphBlock\";\nimport { FlowGraphExecutionBlock } from \"./flowGraphExecutionBlock\";\nimport { type FlowGraphDataConnection } from \"./flowGraphDataConnection\";\nimport { FlowGraphTypes } from \"./flowGraphRichTypes.pure\";\nimport { FlowGraphEventBlock } from \"./flowGraphEventBlock\";\nimport { type FlowGraphEventType } from \"./flowGraphEventType\";\n\n/**\n * Severity level for a validation issue.\n */\nexport const enum FlowGraphValidationSeverity {\n /** A critical issue that will cause runtime failure. */\n Error,\n /** A potential issue that may indicate a mistake. */\n Warning,\n}\n\n/**\n * A single validation issue found in the flow graph.\n */\nexport interface IFlowGraphValidationIssue {\n /** The severity level. */\n severity: FlowGraphValidationSeverity;\n /** Human-readable description of the issue. */\n message: string;\n /** The block where the issue was found (if applicable). */\n block?: FlowGraphBlock;\n /** The connection name involved (if applicable). */\n connectionName?: string;\n}\n\n/**\n * The result of validating a flow graph.\n */\nexport interface IFlowGraphValidationResult {\n /** Whether the graph passed validation with no errors. */\n isValid: boolean;\n /** All issues found, ordered by severity (errors first). */\n issues: IFlowGraphValidationIssue[];\n /** Convenience: number of error-level issues. */\n errorCount: number;\n /** Convenience: number of warning-level issues. */\n warningCount: number;\n /** Map from block uniqueId to the issues affecting that block. */\n issuesByBlock: Map<string, IFlowGraphValidationIssue[]>;\n}\n\n// Types that are mutually coercible and should not produce type-mismatch warnings\nconst NumericLikeTypes = new Set<string>([FlowGraphTypes.Number, FlowGraphTypes.Integer, FlowGraphTypes.Boolean]);\nconst VectorLikeTypes = new Set<string>([FlowGraphTypes.Vector4, FlowGraphTypes.Quaternion]);\nconst ColorLikeTypes = new Set<string>([FlowGraphTypes.Color3, FlowGraphTypes.Color4]);\n\n/**\n * @internal\n */\nfunction _AreTypesCompatible(sourceType: string, targetType: string): boolean {\n if (sourceType === targetType) {\n return true;\n }\n // \"any\" is compatible with everything\n if (sourceType === FlowGraphTypes.Any || targetType === FlowGraphTypes.Any) {\n return true;\n }\n // Numeric coercion group\n if (NumericLikeTypes.has(sourceType) && NumericLikeTypes.has(targetType)) {\n return true;\n }\n // Vector4 / Quaternion are interchangeable\n if (VectorLikeTypes.has(sourceType) && VectorLikeTypes.has(targetType)) {\n return true;\n }\n // Color3 → Color4 widening is safe\n if (ColorLikeTypes.has(sourceType) && ColorLikeTypes.has(targetType)) {\n return true;\n }\n return false;\n}\n\n/**\n * Validates a flow graph and returns all issues found.\n *\n * The following checks are performed:\n * 1. **No event blocks** — the graph has no entry points.\n * 2. **Unconnected required data inputs** — a non-optional data input with no connection.\n * 3. **Unconnected signal inputs** — an execution block whose `in` signal has no connection and\n * that is not an event block (entry point).\n * 4. **Data type mismatches** — a data connection whose source richType is incompatible with the\n * target richType.\n * 5. **Unreachable blocks** — blocks not reachable from any event block via signal/data traversal.\n * 6. **Data dependency cycles** — circular data-only connections that would cause infinite recursion.\n *\n * @param flowGraph - The flow graph to validate.\n * @returns The validation result.\n */\nexport function ValidateFlowGraph(flowGraph: FlowGraph): IFlowGraphValidationResult {\n const issues: IFlowGraphValidationIssue[] = [];\n const issuesByBlock = new Map<string, IFlowGraphValidationIssue[]>();\n\n const addIssue = (issue: IFlowGraphValidationIssue) => {\n issues.push(issue);\n if (issue.block) {\n let arr = issuesByBlock.get(issue.block.uniqueId);\n if (!arr) {\n arr = [];\n issuesByBlock.set(issue.block.uniqueId, arr);\n }\n arr.push(issue);\n }\n };\n\n // Collect ALL blocks via visitAllBlocks\n const allBlocks: FlowGraphBlock[] = [];\n flowGraph.visitAllBlocks((block) => {\n allBlocks.push(block);\n });\n\n // ── Check 1: No event blocks ───────────────────────────────────────\n const eventBlocks = _GetEventBlocks(flowGraph);\n if (eventBlocks.length === 0) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: \"Graph has no event blocks — nothing will trigger execution.\",\n });\n }\n\n // ── Check 2: Unconnected required data inputs ──────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 3: Unconnected signal inputs on non-event execution blocks\n for (const block of allBlocks) {\n if (block instanceof FlowGraphExecutionBlock) {\n // Skip event blocks — they are entry points and don't need an incoming signal.\n if (_IsEventBlock(block)) {\n continue;\n }\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n });\n }\n }\n }\n\n // ── Check 4: Data type mismatches ──────────────────────────────────\n for (const block of allBlocks) {\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n const source = input._connectedPoint[0] as FlowGraphDataConnection<any>;\n const srcType = source.richType?.typeName;\n const tgtType = input.richType?.typeName;\n if (srcType && tgtType && !_AreTypesCompatible(srcType, tgtType)) {\n // If either side has a typeTransformer, it's intentionally converted\n if (source.richType.typeTransformer !== undefined || input.richType.typeTransformer !== undefined) {\n continue;\n }\n addIssue({\n severity: FlowGraphValidationSeverity.Warning,\n message: `Type mismatch: \"${source._ownerBlock.name}.${source.name}\" (${srcType}) → \"${block.name}.${input.name}\" (${tgtType}).`,\n block,\n connectionName: input.name,\n });\n }\n }\n }\n\n // ── Check 5: Unreachable blocks ────────────────────────────────────\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n // We need to also check standalone data blocks not visited by visitAllBlocks.\n // visitAllBlocks starts from event blocks; any block not found is unreachable.\n // Since we can only iterate blocks we know about, the allBlocks list IS\n // from visitAllBlocks, so everything in it IS reachable.\n // There's no separate registry of \"all added blocks\" in the FlowGraph.\n // So: unreachable blocks are blocks that exist but aren't visited.\n // Currently visitAllBlocks IS our source, so this check is a no-op for\n // blocks added via the graph. However, the editor creates nodes and adds\n // execution blocks, so we should compare against the editor's full list.\n // For the core validator, we expose a variant that accepts an external block list.\n\n // ── Check 6: Data dependency cycles ────────────────────────────────\n _DetectDataCycles(allBlocks, addIssue);\n\n // Sort: errors first, then warnings\n issues.sort((a, b) => a.severity - b.severity);\n\n return {\n isValid: issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error),\n issues,\n errorCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Error).length,\n warningCount: issues.filter((i) => i.severity === FlowGraphValidationSeverity.Warning).length,\n issuesByBlock,\n };\n}\n\n/**\n * Extended validation that also checks for unreachable blocks.\n * Requires a full list of all blocks in the graph (including those not reachable\n * from event blocks via the normal traversal).\n *\n * @param flowGraph - The flow graph to validate.\n * @param allKnownBlocks - Complete list of all blocks (e.g., from the editor's node set).\n * @returns The validation result.\n */\nexport function ValidateFlowGraphWithBlockList(flowGraph: FlowGraph, allKnownBlocks: FlowGraphBlock[]): IFlowGraphValidationResult {\n const result = ValidateFlowGraph(flowGraph);\n\n // Check for unreachable blocks\n const reachableIds = new Set<string>();\n flowGraph.visitAllBlocks((block) => {\n reachableIds.add(block.uniqueId);\n });\n\n for (const block of allKnownBlocks) {\n if (!reachableIds.has(block.uniqueId)) {\n const issue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `Block is unreachable from any event block.`,\n block,\n };\n result.issues.push(issue);\n result.warningCount++;\n let arr = result.issuesByBlock.get(block.uniqueId);\n if (!arr) {\n arr = [];\n result.issuesByBlock.set(block.uniqueId, arr);\n }\n arr.push(issue);\n\n // Also run Check 2 and Check 3 on unreachable blocks so the editor\n // can display all issues, not just reachability ones.\n for (const input of block.dataInputs) {\n if (!input.optional && !input.isDisabled && !input.isConnected()) {\n const dataIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Warning,\n message: `\"${input.name}\" is not connected and will use its default value.`,\n block,\n connectionName: input.name,\n };\n result.issues.push(dataIssue);\n result.warningCount++;\n arr.push(dataIssue);\n }\n }\n\n if (block instanceof FlowGraphExecutionBlock && !_IsEventBlock(block)) {\n const inSignal = block.signalInputs.find((s) => s.name === \"in\");\n if (inSignal && !inSignal.isConnected()) {\n const signalIssue: IFlowGraphValidationIssue = {\n severity: FlowGraphValidationSeverity.Error,\n message: `Execution block has no incoming signal — it will never execute.`,\n block,\n connectionName: \"in\",\n };\n result.issues.push(signalIssue);\n result.errorCount++;\n arr.push(signalIssue);\n }\n }\n }\n }\n\n result.isValid = result.issues.every((i) => i.severity !== FlowGraphValidationSeverity.Error);\n result.issues.sort((a, b) => a.severity - b.severity);\n return result;\n}\n\n/**\n * Get all event blocks from a flow graph.\n * @param flowGraph - the flow graph\n * @returns the event blocks\n */\nfunction _GetEventBlocks(flowGraph: FlowGraph): FlowGraphEventBlock[] {\n const eventBlocks: FlowGraphEventBlock[] = [];\n for (const type in flowGraph._eventBlocks) {\n for (const block of flowGraph._eventBlocks[type as FlowGraphEventType]) {\n eventBlocks.push(block);\n }\n }\n return eventBlocks;\n}\n\n/**\n * Detect whether a block is an event block (entry point).\n * @param block - the block to check\n * @returns true if it is an event block\n */\nfunction _IsEventBlock(block: FlowGraphBlock): boolean {\n return block instanceof FlowGraphEventBlock;\n}\n\n/**\n * Detects cycles among data-only blocks.\n * A data cycle means that block A's output feeds into block B's input, and\n * block B's output feeds back into block A (directly or indirectly).\n * This would cause infinite recursion during getValue().\n * @param allBlocks - all blocks to check\n * @param addIssue - callback to report issues\n */\nfunction _DetectDataCycles(allBlocks: FlowGraphBlock[], addIssue: (issue: IFlowGraphValidationIssue) => void): void {\n // Build adjacency: for each block, which blocks do its data inputs depend on?\n // (Data inputs pull values from connected output blocks.)\n const white = 0; // unvisited\n const gray = 1; // in current DFS path\n const black = 2; // fully explored\n const color = new Map<string, number>();\n\n for (const block of allBlocks) {\n color.set(block.uniqueId, white);\n }\n\n const reportedCycleBlocks = new Set<string>();\n\n function dfs(block: FlowGraphBlock): boolean {\n color.set(block.uniqueId, gray);\n for (const input of block.dataInputs) {\n if (!input.isConnected()) {\n continue;\n }\n for (const connected of input._connectedPoint) {\n const dep = (connected as FlowGraphDataConnection<any>)._ownerBlock;\n // Only consider data-only blocks (not execution blocks which are driven by signals)\n if (dep instanceof FlowGraphExecutionBlock) {\n continue;\n }\n const depColor = color.get(dep.uniqueId);\n if (depColor === gray) {\n // Cycle found\n if (!reportedCycleBlocks.has(block.uniqueId)) {\n reportedCycleBlocks.add(block.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block,\n });\n }\n if (!reportedCycleBlocks.has(dep.uniqueId)) {\n reportedCycleBlocks.add(dep.uniqueId);\n addIssue({\n severity: FlowGraphValidationSeverity.Error,\n message: `Data dependency cycle detected — getValue() will recurse infinitely.`,\n block: dep,\n });\n }\n return true;\n }\n if (depColor === white) {\n dfs(dep);\n }\n }\n }\n color.set(block.uniqueId, black);\n return false;\n }\n\n for (const block of allBlocks) {\n if (color.get(block.uniqueId) === white) {\n dfs(block);\n }\n }\n}\n"]}
|
package/FlowGraph/index.d.ts
CHANGED
|
@@ -15,7 +15,9 @@ export * from "./flowGraphPathConverter.js";
|
|
|
15
15
|
export * from "./flowGraphPathConverterComponent.js";
|
|
16
16
|
export * from "./flowGraphHostResolver.js";
|
|
17
17
|
export * from "./flowGraphDelayRegistry.js";
|
|
18
|
+
export * from "./flowGraphAnimationHelpers.js";
|
|
18
19
|
export * from "./flowGraphLogger.js";
|
|
19
20
|
export * from "./flowGraphValidator.js";
|
|
21
|
+
export { defaultValueParseFunction } from "./serialization.js";
|
|
20
22
|
export * from "./Blocks/index.js";
|
|
21
23
|
export * from "./CustomTypes/index.js";
|
package/FlowGraph/index.js
CHANGED
|
@@ -15,8 +15,10 @@ export * from "./flowGraphPathConverter.js";
|
|
|
15
15
|
export * from "./flowGraphPathConverterComponent.js";
|
|
16
16
|
export * from "./flowGraphHostResolver.js";
|
|
17
17
|
export * from "./flowGraphDelayRegistry.js";
|
|
18
|
+
export * from "./flowGraphAnimationHelpers.js";
|
|
18
19
|
export * from "./flowGraphLogger.js";
|
|
19
20
|
export * from "./flowGraphValidator.js";
|
|
21
|
+
export { defaultValueParseFunction } from "./serialization.js";
|
|
20
22
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
21
23
|
export * from "./Blocks/index.js";
|
|
22
24
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
package/FlowGraph/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,oEAAoE;AACpE,cAAc,gBAAgB,CAAC;AAC/B,oEAAoE;AACpE,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\nexport * from \"./flowGraphAssetsContext\";\r\nexport * from \"./flowGraphParser\";\r\nexport * from \"./flowGraphPathConverter\";\r\nexport * from \"./flowGraphPathConverterComponent\";\r\nexport * from \"./flowGraphHostResolver\";\r\nexport * from \"./flowGraphDelayRegistry\";\r\nexport * from \"./flowGraphLogger\";\r\nexport * from \"./flowGraphValidator\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./Blocks/index\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./CustomTypes/index\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,oEAAoE;AACpE,cAAc,gBAAgB,CAAC;AAC/B,oEAAoE;AACpE,cAAc,qBAAqB,CAAC","sourcesContent":["export * from \"./flowGraph\";\r\nexport * from \"./flowGraphBlock\";\r\nexport * from \"./flowGraphSignalConnection\";\r\nexport * from \"./flowGraphExecutionBlock\";\r\nexport * from \"./flowGraphEventBlock\";\r\nexport * from \"./flowGraphRichTypes\";\r\nexport * from \"./flowGraphContext\";\r\nexport * from \"./flowGraphCoordinator\";\r\nexport * from \"./typeDefinitions\";\r\nexport * from \"./flowGraphConnection\";\r\nexport * from \"./flowGraphDataConnection\";\r\nexport * from \"./flowGraphAssetsContext\";\r\nexport * from \"./flowGraphParser\";\r\nexport * from \"./flowGraphPathConverter\";\r\nexport * from \"./flowGraphPathConverterComponent\";\r\nexport * from \"./flowGraphHostResolver\";\r\nexport * from \"./flowGraphDelayRegistry\";\r\nexport * from \"./flowGraphAnimationHelpers\";\r\nexport * from \"./flowGraphLogger\";\r\nexport * from \"./flowGraphValidator\";\r\nexport { defaultValueParseFunction } from \"./serialization\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./Blocks/index\";\r\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\r\nexport * from \"./CustomTypes/index\";\r\n"]}
|
package/FlowGraph/pure.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ export * from "./flowGraphPathConverter.js";
|
|
|
16
16
|
export * from "./flowGraphPathConverterComponent.js";
|
|
17
17
|
export * from "./flowGraphHostResolver.js";
|
|
18
18
|
export * from "./flowGraphDelayRegistry.js";
|
|
19
|
+
export * from "./flowGraphAnimationHelpers.js";
|
|
19
20
|
export * from "./flowGraphLogger.js";
|
|
20
21
|
export * from "./flowGraphValidator.js";
|
|
22
|
+
export { defaultValueParseFunction } from "./serialization.js";
|
|
21
23
|
export * from "./Blocks/pure.js";
|
|
22
24
|
export * from "./CustomTypes/pure.js";
|
package/FlowGraph/pure.js
CHANGED
|
@@ -17,8 +17,10 @@ export * from "./flowGraphPathConverter.js";
|
|
|
17
17
|
export * from "./flowGraphPathConverterComponent.js";
|
|
18
18
|
export * from "./flowGraphHostResolver.js";
|
|
19
19
|
export * from "./flowGraphDelayRegistry.js";
|
|
20
|
+
export * from "./flowGraphAnimationHelpers.js";
|
|
20
21
|
export * from "./flowGraphLogger.js";
|
|
21
22
|
export * from "./flowGraphValidator.js";
|
|
23
|
+
export { defaultValueParseFunction } from "./serialization.js";
|
|
22
24
|
export * from "./Blocks/pure.js";
|
|
23
25
|
export * from "./CustomTypes/pure.js";
|
|
24
26
|
//# sourceMappingURL=pure.js.map
|
package/FlowGraph/pure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport * from \"./flowGraph\";\nexport * from \"./flowGraphBlock\";\nexport * from \"./flowGraphSignalConnection.pure\";\nexport * from \"./flowGraphExecutionBlock\";\nexport * from \"./flowGraphEventBlock\";\nexport * from \"./flowGraphRichTypes.pure\";\nexport * from \"./flowGraphContext\";\nexport * from \"./flowGraphCoordinator\";\nexport * from \"./typeDefinitions\";\nexport * from \"./flowGraphConnection\";\nexport * from \"./flowGraphDataConnection.pure\";\nexport * from \"./flowGraphAssetsContext\";\nexport * from \"./flowGraphParser\";\nexport * from \"./flowGraphPathConverter\";\nexport * from \"./flowGraphPathConverterComponent\";\nexport * from \"./flowGraphHostResolver\";\nexport * from \"./flowGraphDelayRegistry\";\nexport * from \"./flowGraphLogger\";\nexport * from \"./flowGraphValidator\";\nexport * from \"./Blocks/pure\";\nexport * from \"./CustomTypes/pure\";\n"]}
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oEAAoE;AACpE,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nexport * from \"./flowGraph\";\nexport * from \"./flowGraphBlock\";\nexport * from \"./flowGraphSignalConnection.pure\";\nexport * from \"./flowGraphExecutionBlock\";\nexport * from \"./flowGraphEventBlock\";\nexport * from \"./flowGraphRichTypes.pure\";\nexport * from \"./flowGraphContext\";\nexport * from \"./flowGraphCoordinator\";\nexport * from \"./typeDefinitions\";\nexport * from \"./flowGraphConnection\";\nexport * from \"./flowGraphDataConnection.pure\";\nexport * from \"./flowGraphAssetsContext\";\nexport * from \"./flowGraphParser\";\nexport * from \"./flowGraphPathConverter\";\nexport * from \"./flowGraphPathConverterComponent\";\nexport * from \"./flowGraphHostResolver\";\nexport * from \"./flowGraphDelayRegistry\";\nexport * from \"./flowGraphAnimationHelpers\";\nexport * from \"./flowGraphLogger\";\nexport * from \"./flowGraphValidator\";\nexport { defaultValueParseFunction } from \"./serialization\";\nexport * from \"./Blocks/pure\";\nexport * from \"./CustomTypes/pure\";\n"]}
|
|
@@ -26,8 +26,8 @@ export declare function defaultValueSerializationFunction(key: string, value: an
|
|
|
26
26
|
* @param key the key to the value that will be parsed
|
|
27
27
|
* @param serializationObject the object that will be parsed
|
|
28
28
|
* @param assetsContainer the assets container that will be used to find the objects
|
|
29
|
-
* @param scene
|
|
30
|
-
* @returns
|
|
29
|
+
* @param scene the scene used to resolve node and animation group references
|
|
30
|
+
* @returns the parsed value, with serialized Babylon types and scene references restored
|
|
31
31
|
*/
|
|
32
32
|
export declare function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene): any;
|
|
33
33
|
/**
|
|
@@ -138,8 +138,8 @@ export function defaultValueSerializationFunction(key, value, serializationObjec
|
|
|
138
138
|
* @param key the key to the value that will be parsed
|
|
139
139
|
* @param serializationObject the object that will be parsed
|
|
140
140
|
* @param assetsContainer the assets container that will be used to find the objects
|
|
141
|
-
* @param scene
|
|
142
|
-
* @returns
|
|
141
|
+
* @param scene the scene used to resolve node and animation group references
|
|
142
|
+
* @returns the parsed value, with serialized Babylon types and scene references restored
|
|
143
143
|
*/
|
|
144
144
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
145
145
|
export function defaultValueParseFunction(key, serializationObject, assetsContainer, scene) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/serialization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAG1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAErF,MAAM,4BAA4B,GAAG,IAAI,OAAO,EAAkB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,UAAU,8BAA8B,CAAC,KAAc;IACzD,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IACxC,OAAO,CACH,SAAS,2CAA2B;QACpC,SAAS,2CAA2B;QACpC,SAAS,2CAA2B;QACpC,SAAS,iDAA8B;QACvC,SAAS,yCAA0B;QACnC,SAAS,yCAA0B,CACtC,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IACxC,OAAO,SAAS,yCAA0B,IAAI,SAAS,6CAA4B,IAAI,SAAS,6CAA4B,CAAC;AACjI,CAAC;AAED,SAAS,yBAAyB,CAAC,SAAiB;IAChD,OAAO,SAAS,KAAK,gBAAgB,CAAC;AAC1C,CAAC;AAED;;;;;;;;GAQG;AACH,gEAAgE;AAChE,M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CAAC;aAAM,CAAC;YACJ,UAAU,GAAG,iBAAiB,CAAC;QACnC,CAAC;IACL,CAAC;IACD,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,gEAAgE;AAChE,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAChD,0FAA0F;IAC1F,OAAO,SAAS,kFAA0C,CAAC;AAC/D,CAAC","sourcesContent":["import { type IAssetContainer } from \"core/IAssetContainer\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { Color3, Color4 } from \"../Maths/math.color.pure\";\r\nimport { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"../Maths/math.vector.pure\";\r\nimport { type Scene } from \"../scene\";\r\nimport { FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\r\nimport { FlowGraphInteger } from \"./CustomTypes/flowGraphInteger.pure\";\r\nimport { FlowGraphTypes } from \"./flowGraphRichTypes.pure\";\r\nimport { type Node } from \"core/node\";\r\nimport { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"./CustomTypes/flowGraphMatrix\";\r\n\r\nconst _DefaultEventDataParseCounts = new WeakMap<object, number>();\r\n\r\n/** @internal */\r\nexport function _GetDefaultEventDataParseCount(value: unknown): number {\r\n return value !== null && typeof value === \"object\" ? (_DefaultEventDataParseCounts.get(value) ?? 0) : 0;\r\n}\r\n\r\nfunction IsVectorClassName(className: string) {\r\n return (\r\n className === FlowGraphTypes.Vector2 ||\r\n className === FlowGraphTypes.Vector3 ||\r\n className === FlowGraphTypes.Vector4 ||\r\n className === FlowGraphTypes.Quaternion ||\r\n className === FlowGraphTypes.Color3 ||\r\n className === FlowGraphTypes.Color4\r\n );\r\n}\r\n\r\nfunction IsMatrixClassName(className: string) {\r\n return className === FlowGraphTypes.Matrix || className === FlowGraphTypes.Matrix2D || className === FlowGraphTypes.Matrix3D;\r\n}\r\n\r\nfunction IsAnimationGroupClassName(className: string) {\r\n return className === \"AnimationGroup\";\r\n}\r\n\r\n/**\r\n * Resolves a serialized node reference (`{ id, name, className, uniqueId }`) to an actual scene node.\r\n * Matching prefers `id` (falling back to `name`), then narrows by class name, then by `uniqueId`.\r\n * Because `uniqueId` is reassigned every time a scene is built, it is only used as a tie-breaker so\r\n * that references still resolve after a scene is reloaded (e.g. an editor preview).\r\n * @param serializedReference the serialized reference to resolve\r\n * @param scene the scene to resolve the reference against\r\n * @returns the matching node, or undefined when none is found\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function GetSceneNodeFromSerializedReference(serializedReference: any, scene: Scene): Node | undefined {\r\n if (!serializedReference || (!serializedReference.id && !serializedReference.name)) {\r\n return undefined;\r\n }\r\n\r\n const nodes = scene.getNodes().filter((node) => (serializedReference.id ? node.id === serializedReference.id : node.name === serializedReference.name));\r\n if (nodes.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const className = serializedReference.type ?? serializedReference.className;\r\n const classMatches = className ? nodes.filter((node) => node.getClassName() === className) : [];\r\n const candidates = classMatches.length > 0 ? classMatches : nodes;\r\n return (serializedReference.uniqueId ? candidates.find((node) => node.uniqueId === serializedReference.uniqueId) : undefined) ?? candidates[0];\r\n}\r\n\r\nfunction ParseVector(className: string, value: Array<number>, flipHandedness = false) {\r\n if (className === FlowGraphTypes.Vector2) {\r\n return Vector2.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector3) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n }\r\n return Vector3.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector4) {\r\n return Vector4.FromArray(value);\r\n } else if (className === FlowGraphTypes.Quaternion) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n value[3] *= -1;\r\n }\r\n return Quaternion.FromArray(value);\r\n } else if (className === FlowGraphTypes.Color3) {\r\n return new Color3(value[0], value[1], value[2]);\r\n } else if (className === FlowGraphTypes.Color4) {\r\n return new Color4(value[0], value[1], value[2], value[3]);\r\n } else {\r\n throw new Error(`Unknown vector class name ${className}`);\r\n }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n const className = value?.getClassName?.() ?? \"\";\r\n if (IsVectorClassName(className) || IsMatrixClassName(className)) {\r\n serializationObject[key] = {\r\n value: value.asArray(),\r\n className,\r\n };\r\n } else if (className === FlowGraphTypes.Integer) {\r\n serializationObject[key] = {\r\n value: value.value,\r\n className,\r\n };\r\n } else {\r\n if (className && (value.id || value.name)) {\r\n serializationObject[key] = {\r\n id: value.id,\r\n name: value.name,\r\n className,\r\n uniqueId: value.uniqueId,\r\n };\r\n } else {\r\n if (typeof value !== \"object\" || value === null) {\r\n serializationObject[key] = value;\r\n } else {\r\n // Skip known non-serializable keys immediately to avoid\r\n // expensive JSON.stringify attempts on large object trees\r\n // (e.g. pathConverter holds the entire glTF parse tree).\r\n if (key === \"pathConverter\") {\r\n return;\r\n }\r\n // Quick check: if any own property is a function, the object\r\n // is not JSON-safe and stringify would be wasteful.\r\n const hasFunction = Object.values(value).some((v) => typeof v === \"function\");\r\n if (hasFunction) {\r\n return;\r\n }\r\n // Plain object (e.g. parsed event config) — store it if JSON-safe.\r\n try {\r\n serializationObject[key] = JSON.parse(JSON.stringify(value));\r\n } catch {\r\n Logger.Warn(`FlowGraph serialization: value for key \"${key}\" is not JSON-serializable and was skipped.`);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The default function that parses values stored in a serialization object\r\n * @param key the key to the value that will be parsed\r\n * @param serializationObject the object that will be parsed\r\n * @param assetsContainer the assets container that will be used to find the objects\r\n * @param scene\r\n * @returns\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) {\r\n const intermediateValue = serializationObject[key];\r\n let finalValue;\r\n const className = intermediateValue?.type ?? intermediateValue?.className;\r\n const sceneNode = GetSceneNodeFromSerializedReference(intermediateValue, scene);\r\n if (sceneNode) {\r\n finalValue = sceneNode;\r\n } else if (IsVectorClassName(className)) {\r\n finalValue = ParseVector(className, intermediateValue.value);\r\n } else if (IsAnimationGroupClassName(className)) {\r\n // do not use the scene.getAnimationGroupByName because it is possible that two AGs will have the same name\r\n const ags = scene.animationGroups.filter((ag) => ag.name === intermediateValue.name);\r\n // uniqueId changes on each load. this is used for the glTF loader, that uses serialization after the scene was loaded.\r\n finalValue = ags.length === 1 ? ags[0] : ags.find((ag) => ag.uniqueId === intermediateValue.uniqueId);\r\n } else if (className === FlowGraphTypes.Matrix) {\r\n finalValue = Matrix.FromArray(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix2D) {\r\n finalValue = new FlowGraphMatrix2D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix3D) {\r\n finalValue = new FlowGraphMatrix3D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Integer) {\r\n finalValue = FlowGraphInteger.FromValue(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Number || className === FlowGraphTypes.String || className === FlowGraphTypes.Boolean) {\r\n finalValue = intermediateValue.value[0];\r\n } else if (key === \"eventData\" && intermediateValue !== null && typeof intermediateValue === \"object\") {\r\n _DefaultEventDataParseCounts.set(intermediateValue, _GetDefaultEventDataParseCount(intermediateValue) + 1);\r\n finalValue = intermediateValue;\r\n } else if (intermediateValue && intermediateValue.value !== undefined) {\r\n finalValue = intermediateValue.value;\r\n } else {\r\n if (Array.isArray(intermediateValue)) {\r\n finalValue = intermediateValue;\r\n } else {\r\n finalValue = intermediateValue;\r\n }\r\n }\r\n return finalValue;\r\n}\r\n\r\n/**\r\n * Given a name of a flow graph block class, return if this\r\n * class needs to be created with a path converter. Used in\r\n * parsing.\r\n * @param className the name of the flow graph block class\r\n * @returns a boolean indicating if the class needs a path converter\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function needsPathConverter(className: string) {\r\n // I am not using the ClassName property here because it was causing a circular dependency\r\n return className === FlowGraphBlockNames.JsonPointerParser;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"serialization.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/serialization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAG1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAErF,MAAM,4BAA4B,GAAG,IAAI,OAAO,EAAkB,CAAC;AAEnE,gBAAgB;AAChB,MAAM,UAAU,8BAA8B,CAAC,KAAc;IACzD,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5G,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IACxC,OAAO,CACH,SAAS,2CAA2B;QACpC,SAAS,2CAA2B;QACpC,SAAS,2CAA2B;QACpC,SAAS,iDAA8B;QACvC,SAAS,yCAA0B;QACnC,SAAS,yCAA0B,CACtC,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IACxC,OAAO,SAAS,yCAA0B,IAAI,SAAS,6CAA4B,IAAI,SAAS,6CAA4B,CAAC;AACjI,CAAC;AAED,SAAS,yBAAyB,CAAC,SAAiB;IAChD,OAAO,SAAS,KAAK,gBAAgB,CAAC;AA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EAAE,CAAC;YACnC,UAAU,GAAG,iBAAiB,CAAC;QACnC,CAAC;aAAM,CAAC;YACJ,UAAU,GAAG,iBAAiB,CAAC;QACnC,CAAC;IACL,CAAC;IACD,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;GAMG;AACH,gEAAgE;AAChE,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAChD,0FAA0F;IAC1F,OAAO,SAAS,kFAA0C,CAAC;AAC/D,CAAC","sourcesContent":["import { type IAssetContainer } from \"core/IAssetContainer\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { Color3, Color4 } from \"../Maths/math.color.pure\";\r\nimport { Matrix, Quaternion, Vector2, Vector3, Vector4 } from \"../Maths/math.vector.pure\";\r\nimport { type Scene } from \"../scene\";\r\nimport { FlowGraphBlockNames } from \"./Blocks/flowGraphBlockNames\";\r\nimport { FlowGraphInteger } from \"./CustomTypes/flowGraphInteger.pure\";\r\nimport { FlowGraphTypes } from \"./flowGraphRichTypes.pure\";\r\nimport { type Node } from \"core/node\";\r\nimport { FlowGraphMatrix2D, FlowGraphMatrix3D } from \"./CustomTypes/flowGraphMatrix\";\r\n\r\nconst _DefaultEventDataParseCounts = new WeakMap<object, number>();\r\n\r\n/** @internal */\r\nexport function _GetDefaultEventDataParseCount(value: unknown): number {\r\n return value !== null && typeof value === \"object\" ? (_DefaultEventDataParseCounts.get(value) ?? 0) : 0;\r\n}\r\n\r\nfunction IsVectorClassName(className: string) {\r\n return (\r\n className === FlowGraphTypes.Vector2 ||\r\n className === FlowGraphTypes.Vector3 ||\r\n className === FlowGraphTypes.Vector4 ||\r\n className === FlowGraphTypes.Quaternion ||\r\n className === FlowGraphTypes.Color3 ||\r\n className === FlowGraphTypes.Color4\r\n );\r\n}\r\n\r\nfunction IsMatrixClassName(className: string) {\r\n return className === FlowGraphTypes.Matrix || className === FlowGraphTypes.Matrix2D || className === FlowGraphTypes.Matrix3D;\r\n}\r\n\r\nfunction IsAnimationGroupClassName(className: string) {\r\n return className === \"AnimationGroup\";\r\n}\r\n\r\n/**\r\n * Resolves a serialized node reference (`{ id, name, className, uniqueId }`) to an actual scene node.\r\n * Matching prefers `id` (falling back to `name`), then narrows by class name, then by `uniqueId`.\r\n * Because `uniqueId` is reassigned every time a scene is built, it is only used as a tie-breaker so\r\n * that references still resolve after a scene is reloaded (e.g. an editor preview).\r\n * @param serializedReference the serialized reference to resolve\r\n * @param scene the scene to resolve the reference against\r\n * @returns the matching node, or undefined when none is found\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function GetSceneNodeFromSerializedReference(serializedReference: any, scene: Scene): Node | undefined {\r\n if (!serializedReference || (!serializedReference.id && !serializedReference.name)) {\r\n return undefined;\r\n }\r\n\r\n const nodes = scene.getNodes().filter((node) => (serializedReference.id ? node.id === serializedReference.id : node.name === serializedReference.name));\r\n if (nodes.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const className = serializedReference.type ?? serializedReference.className;\r\n const classMatches = className ? nodes.filter((node) => node.getClassName() === className) : [];\r\n const candidates = classMatches.length > 0 ? classMatches : nodes;\r\n return (serializedReference.uniqueId ? candidates.find((node) => node.uniqueId === serializedReference.uniqueId) : undefined) ?? candidates[0];\r\n}\r\n\r\nfunction ParseVector(className: string, value: Array<number>, flipHandedness = false) {\r\n if (className === FlowGraphTypes.Vector2) {\r\n return Vector2.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector3) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n }\r\n return Vector3.FromArray(value);\r\n } else if (className === FlowGraphTypes.Vector4) {\r\n return Vector4.FromArray(value);\r\n } else if (className === FlowGraphTypes.Quaternion) {\r\n if (flipHandedness) {\r\n value[2] *= -1;\r\n value[3] *= -1;\r\n }\r\n return Quaternion.FromArray(value);\r\n } else if (className === FlowGraphTypes.Color3) {\r\n return new Color3(value[0], value[1], value[2]);\r\n } else if (className === FlowGraphTypes.Color4) {\r\n return new Color4(value[0], value[1], value[2], value[3]);\r\n } else {\r\n throw new Error(`Unknown vector class name ${className}`);\r\n }\r\n}\r\n\r\n/**\r\n * The default function that serializes values in a context object to a serialization object\r\n * @param key the key where the value should be stored in the serialization object\r\n * @param value the value to store\r\n * @param serializationObject the object where the value will be stored\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function defaultValueSerializationFunction(key: string, value: any, serializationObject: any) {\r\n const className = value?.getClassName?.() ?? \"\";\r\n if (IsVectorClassName(className) || IsMatrixClassName(className)) {\r\n serializationObject[key] = {\r\n value: value.asArray(),\r\n className,\r\n };\r\n } else if (className === FlowGraphTypes.Integer) {\r\n serializationObject[key] = {\r\n value: value.value,\r\n className,\r\n };\r\n } else {\r\n if (className && (value.id || value.name)) {\r\n serializationObject[key] = {\r\n id: value.id,\r\n name: value.name,\r\n className,\r\n uniqueId: value.uniqueId,\r\n };\r\n } else {\r\n if (typeof value !== \"object\" || value === null) {\r\n serializationObject[key] = value;\r\n } else {\r\n // Skip known non-serializable keys immediately to avoid\r\n // expensive JSON.stringify attempts on large object trees\r\n // (e.g. pathConverter holds the entire glTF parse tree).\r\n if (key === \"pathConverter\") {\r\n return;\r\n }\r\n // Quick check: if any own property is a function, the object\r\n // is not JSON-safe and stringify would be wasteful.\r\n const hasFunction = Object.values(value).some((v) => typeof v === \"function\");\r\n if (hasFunction) {\r\n return;\r\n }\r\n // Plain object (e.g. parsed event config) — store it if JSON-safe.\r\n try {\r\n serializationObject[key] = JSON.parse(JSON.stringify(value));\r\n } catch {\r\n Logger.Warn(`FlowGraph serialization: value for key \"${key}\" is not JSON-serializable and was skipped.`);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * The default function that parses values stored in a serialization object\r\n * @param key the key to the value that will be parsed\r\n * @param serializationObject the object that will be parsed\r\n * @param assetsContainer the assets container that will be used to find the objects\r\n * @param scene the scene used to resolve node and animation group references\r\n * @returns the parsed value, with serialized Babylon types and scene references restored\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function defaultValueParseFunction(key: string, serializationObject: any, assetsContainer: IAssetContainer, scene: Scene) {\r\n const intermediateValue = serializationObject[key];\r\n let finalValue;\r\n const className = intermediateValue?.type ?? intermediateValue?.className;\r\n const sceneNode = GetSceneNodeFromSerializedReference(intermediateValue, scene);\r\n if (sceneNode) {\r\n finalValue = sceneNode;\r\n } else if (IsVectorClassName(className)) {\r\n finalValue = ParseVector(className, intermediateValue.value);\r\n } else if (IsAnimationGroupClassName(className)) {\r\n // do not use the scene.getAnimationGroupByName because it is possible that two AGs will have the same name\r\n const ags = scene.animationGroups.filter((ag) => ag.name === intermediateValue.name);\r\n // uniqueId changes on each load. this is used for the glTF loader, that uses serialization after the scene was loaded.\r\n finalValue = ags.length === 1 ? ags[0] : ags.find((ag) => ag.uniqueId === intermediateValue.uniqueId);\r\n } else if (className === FlowGraphTypes.Matrix) {\r\n finalValue = Matrix.FromArray(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix2D) {\r\n finalValue = new FlowGraphMatrix2D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Matrix3D) {\r\n finalValue = new FlowGraphMatrix3D(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Integer) {\r\n finalValue = FlowGraphInteger.FromValue(intermediateValue.value);\r\n } else if (className === FlowGraphTypes.Number || className === FlowGraphTypes.String || className === FlowGraphTypes.Boolean) {\r\n finalValue = intermediateValue.value[0];\r\n } else if (key === \"eventData\" && intermediateValue !== null && typeof intermediateValue === \"object\") {\r\n _DefaultEventDataParseCounts.set(intermediateValue, _GetDefaultEventDataParseCount(intermediateValue) + 1);\r\n finalValue = intermediateValue;\r\n } else if (intermediateValue && intermediateValue.value !== undefined) {\r\n finalValue = intermediateValue.value;\r\n } else {\r\n if (Array.isArray(intermediateValue)) {\r\n finalValue = intermediateValue;\r\n } else {\r\n finalValue = intermediateValue;\r\n }\r\n }\r\n return finalValue;\r\n}\r\n\r\n/**\r\n * Given a name of a flow graph block class, return if this\r\n * class needs to be created with a path converter. Used in\r\n * parsing.\r\n * @param className the name of the flow graph block class\r\n * @returns a boolean indicating if the class needs a path converter\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function needsPathConverter(className: string) {\r\n // I am not using the ClassName property here because it was causing a circular dependency\r\n return className === FlowGraphBlockNames.JsonPointerParser;\r\n}\r\n"]}
|
|
@@ -54,7 +54,7 @@ export interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any,
|
|
|
54
54
|
/**
|
|
55
55
|
* @deprecated Use get instead
|
|
56
56
|
*/
|
|
57
|
-
getPropertyName?: Array<(target: GLTFTargetType) => string>;
|
|
57
|
+
getPropertyName?: Array<(target: GLTFTargetType, index?: number) => string>;
|
|
58
58
|
/**
|
|
59
59
|
* Set a new value to the property.
|
|
60
60
|
* @param newValue the new value to set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import { type IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { type Animation } from \"core/Animations/animation\";\r\nimport { type FlowGraphConnectionType } from \"./flowGraphConnection\";\r\n\r\n/**\r\n * Interpolation generator\r\n */\r\nexport interface IInterpolationPropertyInfo {\r\n /**\r\n * type of the interpolation\r\n */\r\n type: number;\r\n /**\r\n * The name of the property\r\n */\r\n name: string;\r\n /** @internal */\r\n getValue: (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n /** @internal */\r\n getStride: (target: any) => number;\r\n /**\r\n * @internal\r\n */\r\n buildAnimations(target: any, name: string, fps: number, keys: any[]): { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[];\r\n}\r\n\r\n/**\r\n * An accessor that allows modifying properties on some other object.\r\n */\r\nexport interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any> {\r\n /**\r\n * The number of components that are changed in the property when setting this value.\r\n * This will usually be 1. But, for example, Babylon has both orthoLeft and orthoRight (two components) properties that are changed when setting xmag (single value in glTF).\r\n * Defaults to 1 if not provided!\r\n */\r\n componentsCount?: number;\r\n /**\r\n * The (babylon) type of the property.\r\n */\r\n type: string;\r\n /**\r\n * Get the value of the property.\r\n */\r\n get: (target: GLTFTargetType, index?: number, payload?: any) => BabylonValueType | undefined;\r\n /**\r\n * Get the target of the property.\r\n */\r\n getTarget: (target: GLTFTargetType, index?: number, payload?: any) => BabylonTargetType | undefined;\r\n /**\r\n * is the property readonly?\r\n */\r\n isReadOnly?: boolean;\r\n /**\r\n * @deprecated Use get instead\r\n */\r\n getPropertyName?: Array<(target: GLTFTargetType) => string>;\r\n /**\r\n * Set a new value to the property.\r\n * @param newValue the new value to set\r\n * @param target the target object\r\n * @param index the index of the target object in the array (optional)\r\n */\r\n set?: (newValue: BabylonValueType, target: GLTFTargetType, index?: number, payload?: any) => void;\r\n /**\r\n * Interpolation/animation information for the property.\r\n * This is an array that can be used to animate the value over time.\r\n */\r\n interpolation?: IInterpolationPropertyInfo[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Context\r\n */\r\nexport interface ISerializedFlowGraphContext {\r\n /**\r\n * The unique id of the context\r\n */\r\n uniqueId: string;\r\n /**\r\n * An optional user-facing name for the context\r\n */\r\n name?: string;\r\n /**\r\n * User variables\r\n */\r\n _userVariables: { [key: string]: any };\r\n /**\r\n * Optional type annotations for user variables.\r\n * Keys are variable names; values are type name strings.\r\n */\r\n _variableTypes?: { [key: string]: string };\r\n /**\r\n * Values of the connection points\r\n */\r\n _connectionValues: { [key: string]: any };\r\n\r\n /**\r\n * Assets context, if not the scene\r\n */\r\n _assetsContext?: { [key: string]: any };\r\n\r\n /**\r\n * Should logging be enabled?\r\n */\r\n enableLogging?: boolean;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Connection\r\n */\r\nexport interface ISerializedFlowGraphConnection {\r\n /**\r\n * The unique id of the connection\r\n */\r\n uniqueId: string;\r\n /**\r\n * The name of the connection\r\n */\r\n name: string;\r\n /**\r\n * The type of the connection\r\n */\r\n _connectionType: FlowGraphConnectionType;\r\n /**\r\n * The id of the connection that this is connected to\r\n */\r\n connectedPointIds: string[];\r\n /**\r\n * Optional host-format metadata associated with this connection.\r\n */\r\n metadata?: any;\r\n /**\r\n * The serialized default value of a data connection (set by the user for\r\n * unconnected inputs). Only present on data connections.\r\n */\r\n defaultValue?: any;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Block\r\n */\r\nexport interface ISerializedFlowGraphBlock {\r\n /**\r\n * The class name of the block\r\n */\r\n className: string;\r\n /**\r\n * The glTF type of the block\r\n */\r\n type: string;\r\n /**\r\n * Configuration parameters for the block\r\n */\r\n config: any;\r\n /**\r\n * The unique id of the block\r\n */\r\n uniqueId: string;\r\n /**\r\n * Input connection data\r\n */\r\n dataInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection data\r\n */\r\n dataOutputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Metadata for the block\r\n */\r\n metadata: any;\r\n /**\r\n * Input connection signal\r\n */\r\n signalInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection signal\r\n */\r\n signalOutputs: ISerializedFlowGraphConnection[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph\r\n */\r\nexport interface ISerializedFlowGraph {\r\n /**\r\n * Optional human-readable name for the graph\r\n */\r\n name?: string;\r\n /**\r\n * Optional unique identifier for the graph\r\n */\r\n uniqueId?: string;\r\n /**\r\n * Optional host-format metadata associated with the graph.\r\n */\r\n metadata?: any;\r\n /**\r\n * Contexts belonging to the flow graph\r\n */\r\n executionContexts: ISerializedFlowGraphContext[];\r\n /**\r\n * Blocks belonging to the flow graph\r\n */\r\n allBlocks: ISerializedFlowGraphBlock[];\r\n\r\n /**\r\n * Is the flow graph in RHS mode?\r\n */\r\n rightHanded?: boolean;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import { type IAnimatable } from \"core/Animations/animatable.interface\";\r\nimport { type Animation } from \"core/Animations/animation\";\r\nimport { type FlowGraphConnectionType } from \"./flowGraphConnection\";\r\n\r\n/**\r\n * Interpolation generator\r\n */\r\nexport interface IInterpolationPropertyInfo {\r\n /**\r\n * type of the interpolation\r\n */\r\n type: number;\r\n /**\r\n * The name of the property\r\n */\r\n name: string;\r\n /** @internal */\r\n getValue: (target: any, source: Float32Array, offset: number, scale: number) => any;\r\n /** @internal */\r\n getStride: (target: any) => number;\r\n /**\r\n * @internal\r\n */\r\n buildAnimations(target: any, name: string, fps: number, keys: any[]): { babylonAnimatable: IAnimatable; babylonAnimation: Animation }[];\r\n}\r\n\r\n/**\r\n * An accessor that allows modifying properties on some other object.\r\n */\r\nexport interface IObjectAccessor<GLTFTargetType = any, BabylonTargetType = any, BabylonValueType = any> {\r\n /**\r\n * The number of components that are changed in the property when setting this value.\r\n * This will usually be 1. But, for example, Babylon has both orthoLeft and orthoRight (two components) properties that are changed when setting xmag (single value in glTF).\r\n * Defaults to 1 if not provided!\r\n */\r\n componentsCount?: number;\r\n /**\r\n * The (babylon) type of the property.\r\n */\r\n type: string;\r\n /**\r\n * Get the value of the property.\r\n */\r\n get: (target: GLTFTargetType, index?: number, payload?: any) => BabylonValueType | undefined;\r\n /**\r\n * Get the target of the property.\r\n */\r\n getTarget: (target: GLTFTargetType, index?: number, payload?: any) => BabylonTargetType | undefined;\r\n /**\r\n * is the property readonly?\r\n */\r\n isReadOnly?: boolean;\r\n /**\r\n * @deprecated Use get instead\r\n */\r\n getPropertyName?: Array<(target: GLTFTargetType, index?: number) => string>;\r\n /**\r\n * Set a new value to the property.\r\n * @param newValue the new value to set\r\n * @param target the target object\r\n * @param index the index of the target object in the array (optional)\r\n */\r\n set?: (newValue: BabylonValueType, target: GLTFTargetType, index?: number, payload?: any) => void;\r\n /**\r\n * Interpolation/animation information for the property.\r\n * This is an array that can be used to animate the value over time.\r\n */\r\n interpolation?: IInterpolationPropertyInfo[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Context\r\n */\r\nexport interface ISerializedFlowGraphContext {\r\n /**\r\n * The unique id of the context\r\n */\r\n uniqueId: string;\r\n /**\r\n * An optional user-facing name for the context\r\n */\r\n name?: string;\r\n /**\r\n * User variables\r\n */\r\n _userVariables: { [key: string]: any };\r\n /**\r\n * Optional type annotations for user variables.\r\n * Keys are variable names; values are type name strings.\r\n */\r\n _variableTypes?: { [key: string]: string };\r\n /**\r\n * Values of the connection points\r\n */\r\n _connectionValues: { [key: string]: any };\r\n\r\n /**\r\n * Assets context, if not the scene\r\n */\r\n _assetsContext?: { [key: string]: any };\r\n\r\n /**\r\n * Should logging be enabled?\r\n */\r\n enableLogging?: boolean;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Connection\r\n */\r\nexport interface ISerializedFlowGraphConnection {\r\n /**\r\n * The unique id of the connection\r\n */\r\n uniqueId: string;\r\n /**\r\n * The name of the connection\r\n */\r\n name: string;\r\n /**\r\n * The type of the connection\r\n */\r\n _connectionType: FlowGraphConnectionType;\r\n /**\r\n * The id of the connection that this is connected to\r\n */\r\n connectedPointIds: string[];\r\n /**\r\n * Optional host-format metadata associated with this connection.\r\n */\r\n metadata?: any;\r\n /**\r\n * The serialized default value of a data connection (set by the user for\r\n * unconnected inputs). Only present on data connections.\r\n */\r\n defaultValue?: any;\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph Block\r\n */\r\nexport interface ISerializedFlowGraphBlock {\r\n /**\r\n * The class name of the block\r\n */\r\n className: string;\r\n /**\r\n * The glTF type of the block\r\n */\r\n type: string;\r\n /**\r\n * Configuration parameters for the block\r\n */\r\n config: any;\r\n /**\r\n * The unique id of the block\r\n */\r\n uniqueId: string;\r\n /**\r\n * Input connection data\r\n */\r\n dataInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection data\r\n */\r\n dataOutputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Metadata for the block\r\n */\r\n metadata: any;\r\n /**\r\n * Input connection signal\r\n */\r\n signalInputs: ISerializedFlowGraphConnection[];\r\n /**\r\n * Output connection signal\r\n */\r\n signalOutputs: ISerializedFlowGraphConnection[];\r\n}\r\n\r\n/**\r\n * A Serialized Flow Graph\r\n */\r\nexport interface ISerializedFlowGraph {\r\n /**\r\n * Optional human-readable name for the graph\r\n */\r\n name?: string;\r\n /**\r\n * Optional unique identifier for the graph\r\n */\r\n uniqueId?: string;\r\n /**\r\n * Optional host-format metadata associated with the graph.\r\n */\r\n metadata?: any;\r\n /**\r\n * Contexts belonging to the flow graph\r\n */\r\n executionContexts: ISerializedFlowGraphContext[];\r\n /**\r\n * Blocks belonging to the flow graph\r\n */\r\n allBlocks: ISerializedFlowGraphBlock[];\r\n\r\n /**\r\n * Is the flow graph in RHS mode?\r\n */\r\n rightHanded?: boolean;\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./minMaxReducerBlock.pure.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minMaxReducerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,0BAA0B,EAAE,CAAC","sourcesContent":["export * from \"./minMaxReducerBlock.pure\";\r\n\r\nimport { RegisterMinMaxReducerBlock } from \"./minMaxReducerBlock.pure\";\r\nRegisterMinMaxReducerBlock();\r\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type FrameGraph, type NodeRenderGraphBuildState, type NodeRenderGraphConnectionPoint, type Scene } from "../../../../index.js";
|
|
3
|
+
import { DepthTextureType } from "../../../../Misc/thinMinMaxReducer.js";
|
|
4
|
+
import { FrameGraphMinMaxReducerTask } from "../../../Tasks/Misc/minMaxReducerTask.js";
|
|
5
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
6
|
+
/**
|
|
7
|
+
* Block that reduces a color texture's red channel to its minimum and maximum values.
|
|
8
|
+
* When using a geometry depth-as-color output, enable depthRedux and select the matching depthTextureType.
|
|
9
|
+
* WebGPU depth/stencil attachments are reduced as screen depth automatically.
|
|
10
|
+
* Connect the output to a downstream texture input or a dependency so the block is included in the graph.
|
|
11
|
+
*/
|
|
12
|
+
export declare class NodeRenderGraphMinMaxReducerBlock extends NodeRenderGraphBlock {
|
|
13
|
+
protected _frameGraphTask: FrameGraphMinMaxReducerTask;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the frame graph task associated with this block.
|
|
16
|
+
*/
|
|
17
|
+
get task(): FrameGraphMinMaxReducerTask;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a min/max reducer block.
|
|
20
|
+
* @param name The block name.
|
|
21
|
+
* @param frameGraph The hosting frame graph.
|
|
22
|
+
* @param scene The hosting scene.
|
|
23
|
+
*/
|
|
24
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
25
|
+
/** Whether to ignore the depth clear value of a depth-as-color source. Depth/stencil attachments are handled automatically. */
|
|
26
|
+
get depthRedux(): boolean;
|
|
27
|
+
set depthRedux(value: boolean);
|
|
28
|
+
/** The kind of depth values stored in a depth-as-color source when depth reduction is enabled. */
|
|
29
|
+
get depthTextureType(): DepthTextureType;
|
|
30
|
+
set depthTextureType(value: DepthTextureType);
|
|
31
|
+
/** The texture type used for the reduction steps and the 1x1 result. */
|
|
32
|
+
get textureType(): number;
|
|
33
|
+
set textureType(value: number);
|
|
34
|
+
/** Wait for WebGPU readback before notifying observers, without blocking the render loop. */
|
|
35
|
+
get waitForReadback(): boolean;
|
|
36
|
+
set waitForReadback(value: boolean);
|
|
37
|
+
/**
|
|
38
|
+
* Gets the source texture input.
|
|
39
|
+
*/
|
|
40
|
+
get source(): NodeRenderGraphConnectionPoint;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the 1x1 RG texture containing the minimum in red and maximum in green.
|
|
43
|
+
*/
|
|
44
|
+
get output(): NodeRenderGraphConnectionPoint;
|
|
45
|
+
getClassName(): string;
|
|
46
|
+
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
47
|
+
protected _dumpPropertiesCode(): string;
|
|
48
|
+
serialize(): any;
|
|
49
|
+
_deserialize(serializationObject: any): void;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Registers the min/max reducer block for node render graph deserialization.
|
|
53
|
+
*/
|
|
54
|
+
export declare function RegisterMinMaxReducerBlock(): void;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { __esDecorate, __runInitializers } from "../../../../tslib.es6.js";
|
|
3
|
+
|
|
4
|
+
import { FrameGraphMinMaxReducerTask } from "../../../Tasks/Misc/minMaxReducerTask.js";
|
|
5
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
7
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
8
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
9
|
+
/**
|
|
10
|
+
* Block that reduces a color texture's red channel to its minimum and maximum values.
|
|
11
|
+
* When using a geometry depth-as-color output, enable depthRedux and select the matching depthTextureType.
|
|
12
|
+
* WebGPU depth/stencil attachments are reduced as screen depth automatically.
|
|
13
|
+
* Connect the output to a downstream texture input or a dependency so the block is included in the graph.
|
|
14
|
+
*/
|
|
15
|
+
let NodeRenderGraphMinMaxReducerBlock = (() => {
|
|
16
|
+
var _a;
|
|
17
|
+
let _classSuper = NodeRenderGraphBlock;
|
|
18
|
+
let _instanceExtraInitializers = [];
|
|
19
|
+
let _get_depthRedux_decorators;
|
|
20
|
+
let _get_depthTextureType_decorators;
|
|
21
|
+
let _get_textureType_decorators;
|
|
22
|
+
let _get_waitForReadback_decorators;
|
|
23
|
+
return _a = class NodeRenderGraphMinMaxReducerBlock extends _classSuper {
|
|
24
|
+
/**
|
|
25
|
+
* Gets the frame graph task associated with this block.
|
|
26
|
+
*/
|
|
27
|
+
get task() {
|
|
28
|
+
return this._frameGraphTask;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates a min/max reducer block.
|
|
32
|
+
* @param name The block name.
|
|
33
|
+
* @param frameGraph The hosting frame graph.
|
|
34
|
+
* @param scene The hosting scene.
|
|
35
|
+
*/
|
|
36
|
+
constructor(name, frameGraph, scene) {
|
|
37
|
+
super(name, frameGraph, scene);
|
|
38
|
+
this._frameGraphTask = __runInitializers(this, _instanceExtraInitializers);
|
|
39
|
+
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);
|
|
40
|
+
this._addDependenciesInput();
|
|
41
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
42
|
+
this.source.addExcludedConnectionPointFromAllowedTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer & ~NodeRenderGraphBlockConnectionPointTypes.TextureMeshBlendTag);
|
|
43
|
+
this._frameGraphTask = new FrameGraphMinMaxReducerTask(name, frameGraph);
|
|
44
|
+
}
|
|
45
|
+
/** Whether to ignore the depth clear value of a depth-as-color source. Depth/stencil attachments are handled automatically. */
|
|
46
|
+
get depthRedux() {
|
|
47
|
+
return this._frameGraphTask.depthRedux;
|
|
48
|
+
}
|
|
49
|
+
set depthRedux(value) {
|
|
50
|
+
this._frameGraphTask.depthRedux = value;
|
|
51
|
+
}
|
|
52
|
+
/** The kind of depth values stored in a depth-as-color source when depth reduction is enabled. */
|
|
53
|
+
get depthTextureType() {
|
|
54
|
+
return this._frameGraphTask.depthTextureType;
|
|
55
|
+
}
|
|
56
|
+
set depthTextureType(value) {
|
|
57
|
+
this._frameGraphTask.depthTextureType = value;
|
|
58
|
+
}
|
|
59
|
+
/** The texture type used for the reduction steps and the 1x1 result. */
|
|
60
|
+
get textureType() {
|
|
61
|
+
return this._frameGraphTask.textureType;
|
|
62
|
+
}
|
|
63
|
+
set textureType(value) {
|
|
64
|
+
this._frameGraphTask.textureType = value;
|
|
65
|
+
}
|
|
66
|
+
/** Wait for WebGPU readback before notifying observers, without blocking the render loop. */
|
|
67
|
+
get waitForReadback() {
|
|
68
|
+
return this._frameGraphTask.waitForReadback;
|
|
69
|
+
}
|
|
70
|
+
set waitForReadback(value) {
|
|
71
|
+
this._frameGraphTask.waitForReadback = value;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Gets the source texture input.
|
|
75
|
+
*/
|
|
76
|
+
get source() {
|
|
77
|
+
return this._inputs[0];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Gets the 1x1 RG texture containing the minimum in red and maximum in green.
|
|
81
|
+
*/
|
|
82
|
+
get output() {
|
|
83
|
+
return this._outputs[0];
|
|
84
|
+
}
|
|
85
|
+
getClassName() {
|
|
86
|
+
return "NodeRenderGraphMinMaxReducerBlock";
|
|
87
|
+
}
|
|
88
|
+
_buildBlock(state) {
|
|
89
|
+
super._buildBlock(state);
|
|
90
|
+
this.output.value = this._frameGraphTask.outputTexture;
|
|
91
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
92
|
+
}
|
|
93
|
+
_dumpPropertiesCode() {
|
|
94
|
+
const codes = [];
|
|
95
|
+
codes.push(`${this._codeVariableName}.depthRedux = ${this.depthRedux};`);
|
|
96
|
+
codes.push(`${this._codeVariableName}.depthTextureType = ${this.depthTextureType};`);
|
|
97
|
+
codes.push(`${this._codeVariableName}.textureType = ${this.textureType};`);
|
|
98
|
+
codes.push(`${this._codeVariableName}.waitForReadback = ${this.waitForReadback};`);
|
|
99
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
100
|
+
}
|
|
101
|
+
serialize() {
|
|
102
|
+
const serializationObject = super.serialize();
|
|
103
|
+
serializationObject.depthRedux = this.depthRedux;
|
|
104
|
+
serializationObject.depthTextureType = this.depthTextureType;
|
|
105
|
+
serializationObject.textureType = this.textureType;
|
|
106
|
+
serializationObject.waitForReadback = this.waitForReadback;
|
|
107
|
+
return serializationObject;
|
|
108
|
+
}
|
|
109
|
+
_deserialize(serializationObject) {
|
|
110
|
+
super._deserialize(serializationObject);
|
|
111
|
+
this.depthRedux = serializationObject.depthRedux ?? false;
|
|
112
|
+
this.depthTextureType = serializationObject.depthTextureType ?? 0 /* DepthTextureType.NormalizedViewDepth */;
|
|
113
|
+
this.textureType = serializationObject.textureType ?? 2;
|
|
114
|
+
this.waitForReadback = serializationObject.waitForReadback ?? false;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
(() => {
|
|
118
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
119
|
+
_get_depthRedux_decorators = [editableInPropertyPage("Depth-as-color reduction", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")];
|
|
120
|
+
_get_depthTextureType_decorators = [editableInPropertyPage("Depth-as-color type", 5 /* PropertyTypeForEdition.List */, "PROPERTIES", {
|
|
121
|
+
options: [
|
|
122
|
+
{ label: "Normalized view depth", value: 0 /* DepthTextureType.NormalizedViewDepth */ },
|
|
123
|
+
{ label: "View depth", value: 1 /* DepthTextureType.ViewDepth */ },
|
|
124
|
+
{ label: "Screen depth", value: 2 /* DepthTextureType.ScreenDepth */ },
|
|
125
|
+
],
|
|
126
|
+
})];
|
|
127
|
+
_get_textureType_decorators = [editableInPropertyPage("Texture type", 5 /* PropertyTypeForEdition.List */, "PROPERTIES", {
|
|
128
|
+
options: [
|
|
129
|
+
{ label: "Half float", value: 2 },
|
|
130
|
+
{ label: "Float", value: 1 },
|
|
131
|
+
{ label: "Unsigned byte", value: 0 },
|
|
132
|
+
],
|
|
133
|
+
})];
|
|
134
|
+
_get_waitForReadback_decorators = [editableInPropertyPage("Wait for readback", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")];
|
|
135
|
+
__esDecorate(_a, null, _get_depthRedux_decorators, { kind: "getter", name: "depthRedux", static: false, private: false, access: { has: obj => "depthRedux" in obj, get: obj => obj.depthRedux }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
136
|
+
__esDecorate(_a, null, _get_depthTextureType_decorators, { kind: "getter", name: "depthTextureType", static: false, private: false, access: { has: obj => "depthTextureType" in obj, get: obj => obj.depthTextureType }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
137
|
+
__esDecorate(_a, null, _get_textureType_decorators, { kind: "getter", name: "textureType", static: false, private: false, access: { has: obj => "textureType" in obj, get: obj => obj.textureType }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
138
|
+
__esDecorate(_a, null, _get_waitForReadback_decorators, { kind: "getter", name: "waitForReadback", static: false, private: false, access: { has: obj => "waitForReadback" in obj, get: obj => obj.waitForReadback }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
139
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
140
|
+
})(),
|
|
141
|
+
_a;
|
|
142
|
+
})();
|
|
143
|
+
export { NodeRenderGraphMinMaxReducerBlock };
|
|
144
|
+
let _Registered = false;
|
|
145
|
+
/**
|
|
146
|
+
* Registers the min/max reducer block for node render graph deserialization.
|
|
147
|
+
*/
|
|
148
|
+
export function RegisterMinMaxReducerBlock() {
|
|
149
|
+
if (_Registered) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
_Registered = true;
|
|
153
|
+
RegisterClass("BABYLON.NodeRenderGraphMinMaxReducerBlock", NodeRenderGraphMinMaxReducerBlock);
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=minMaxReducerBlock.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minMaxReducerBlock.pure.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAE5F;;;;;GAKG;IACU,iCAAiC;;sBAAS,oBAAoB;;;;;;sBAA9D,iCAAkC,SAAQ,WAAoB;YAGvE;;eAEG;YACH,IAAoB,IAAI;gBACpB,OAAO,IAAI,CAAC,eAAe,CAAC;YAChC,CAAC;YAED;;;;;eAKG;YACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;gBACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;gBAhBhB,oBAAe,GADzB,mDAAiC,CACsB;gBAkB5D,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,UAAU,CAAC,CAAC;gBAClF,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC7B,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;gBAEhF,IAAI,CAAC,MAAM,CAAC,0CAA0C,CAClD,wCAAwC,CAAC,uBAAuB,GAAG,CAAC,wCAAwC,CAAC,mBAAmB,CACnI,CAAC;gBAEF,IAAI,CAAC,eAAe,GAAG,IAAI,2BAA2B,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YAC7E,CAAC;YAED,+HAA+H;YAE/H,IAAW,UAAU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BAAsB,CAAC;gBACvF,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,IAAI,KAAK,CAAC;YACxE,CAAC;;;;0CApGA,sBAAsB,CAAC,0BAA0B,0CAAkC,YAAY,CAAC;gDAUhG,sBAAsB,CAAC,qBAAqB,uCAA+B,YAAY,EAAE;oBACtF,OAAO,EAAE;wBACL,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,8CAAsC,EAAE;wBAC/E,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,oCAA4B,EAAE;wBAC1D,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,sCAA8B,EAAE;qBACjE;iBACJ,CAAC;2CAUD,sBAAsB,CAAC,cAAc,uCAA+B,YAAY,EAAE;oBAC/E,OAAO,EAAE;wBACL,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,CAAC,sBAAsB,EAAE;wBAChE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,iBAAiB,EAAE;wBACtD,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,CAAC,yBAAyB,EAAE;qBACzE;iBACJ,CAAC;+CAUD,sBAAsB,CAAC,mBAAmB,0CAAkC,YAAY,CAAC;YAzC1F,mLAAW,UAAU,6DAEpB;YAcD,qMAAW,gBAAgB,6DAE1B;YAcD,sLAAW,WAAW,6DAErB;YAQD,kMAAW,eAAe,6DAEzB;;;;;SA5EQ,iCAAiC;AAsI9C,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;GAEG;AACH,MAAM,UAAU,0BAA0B;IACtC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,2CAA2C,EAAE,iCAAiC,CAAC,CAAC;AAClG,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type FrameGraph, type FrameGraphTextureHandle, type NodeRenderGraphBuildState, type NodeRenderGraphConnectionPoint, type Scene } from \"core/index\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { DepthTextureType } from \"core/Misc/thinMinMaxReducer\";\r\nimport { FrameGraphMinMaxReducerTask } from \"../../../Tasks/Misc/minMaxReducerTask\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\n\r\n/**\r\n * Block that reduces a color texture's red channel to its minimum and maximum values.\r\n * When using a geometry depth-as-color output, enable depthRedux and select the matching depthTextureType.\r\n * WebGPU depth/stencil attachments are reduced as screen depth automatically.\r\n * Connect the output to a downstream texture input or a dependency so the block is included in the graph.\r\n */\r\nexport class NodeRenderGraphMinMaxReducerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphMinMaxReducerTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block.\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Creates a min/max reducer block.\r\n * @param name The block name.\r\n * @param frameGraph The hosting frame graph.\r\n * @param scene The hosting scene.\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n\r\n this.source.addExcludedConnectionPointFromAllowedTypes(\r\n NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer & ~NodeRenderGraphBlockConnectionPointTypes.TextureMeshBlendTag\r\n );\r\n\r\n this._frameGraphTask = new FrameGraphMinMaxReducerTask(name, frameGraph);\r\n }\r\n\r\n /** Whether to ignore the depth clear value of a depth-as-color source. Depth/stencil attachments are handled automatically. */\r\n @editableInPropertyPage(\"Depth-as-color reduction\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthRedux(): boolean {\r\n return this._frameGraphTask.depthRedux;\r\n }\r\n\r\n public set depthRedux(value: boolean) {\r\n this._frameGraphTask.depthRedux = value;\r\n }\r\n\r\n /** The kind of depth values stored in a depth-as-color source when depth reduction is enabled. */\r\n @editableInPropertyPage(\"Depth-as-color type\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Normalized view depth\", value: DepthTextureType.NormalizedViewDepth },\r\n { label: \"View depth\", value: DepthTextureType.ViewDepth },\r\n { label: \"Screen depth\", value: DepthTextureType.ScreenDepth },\r\n ],\r\n })\r\n public get depthTextureType(): DepthTextureType {\r\n return this._frameGraphTask.depthTextureType;\r\n }\r\n\r\n public set depthTextureType(value: DepthTextureType) {\r\n this._frameGraphTask.depthTextureType = value;\r\n }\r\n\r\n /** The texture type used for the reduction steps and the 1x1 result. */\r\n @editableInPropertyPage(\"Texture type\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Half float\", value: Constants.TEXTURETYPE_HALF_FLOAT },\r\n { label: \"Float\", value: Constants.TEXTURETYPE_FLOAT },\r\n { label: \"Unsigned byte\", value: Constants.TEXTURETYPE_UNSIGNED_BYTE },\r\n ],\r\n })\r\n public get textureType(): number {\r\n return this._frameGraphTask.textureType;\r\n }\r\n\r\n public set textureType(value: number) {\r\n this._frameGraphTask.textureType = value;\r\n }\r\n\r\n /** Wait for WebGPU readback before notifying observers, without blocking the render loop. */\r\n @editableInPropertyPage(\"Wait for readback\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get waitForReadback(): boolean {\r\n return this._frameGraphTask.waitForReadback;\r\n }\r\n\r\n public set waitForReadback(value: boolean) {\r\n this._frameGraphTask.waitForReadback = value;\r\n }\r\n\r\n /**\r\n * Gets the source texture input.\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the 1x1 RG texture containing the minimum in red and maximum in green.\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n public override getClassName() {\r\n return \"NodeRenderGraphMinMaxReducerBlock\";\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthRedux = ${this.depthRedux};`);\r\n codes.push(`${this._codeVariableName}.depthTextureType = ${this.depthTextureType};`);\r\n codes.push(`${this._codeVariableName}.textureType = ${this.textureType};`);\r\n codes.push(`${this._codeVariableName}.waitForReadback = ${this.waitForReadback};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.depthRedux = this.depthRedux;\r\n serializationObject.depthTextureType = this.depthTextureType;\r\n serializationObject.textureType = this.textureType;\r\n serializationObject.waitForReadback = this.waitForReadback;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthRedux = serializationObject.depthRedux ?? false;\r\n this.depthTextureType = serializationObject.depthTextureType ?? DepthTextureType.NormalizedViewDepth;\r\n this.textureType = serializationObject.textureType ?? Constants.TEXTURETYPE_HALF_FLOAT;\r\n this.waitForReadback = serializationObject.waitForReadback ?? false;\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Registers the min/max reducer block for node render graph deserialization.\r\n */\r\nexport function RegisterMinMaxReducerBlock(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.NodeRenderGraphMinMaxReducerBlock\", NodeRenderGraphMinMaxReducerBlock);\r\n}\r\n"]}
|