@babylonjs/core 9.4.1 → 9.5.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/Cameras/Inputs/freeCameraTouchInput.js +5 -3
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js +11 -7
- package/Cameras/Inputs/freeCameraVirtualJoystickInput.js.map +1 -1
- package/Cameras/arcRotateCamera.js +2 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.js +1 -0
- package/Cameras/camera.js.map +1 -1
- package/Cameras/followCamera.js +1 -1
- package/Cameras/followCamera.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +12 -0
- package/Collisions/gpuPicker.js +51 -0
- package/Collisions/gpuPicker.js.map +1 -1
- package/Compute/computeEffect.js +2 -2
- package/Compute/computeEffect.js.map +1 -1
- package/Culling/ray.core.js +46 -2
- package/Culling/ray.core.js.map +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +26 -0
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +26 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +52 -0
- package/Engines/constants.js +52 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +13 -0
- package/Engines/thinEngine.js +52 -0
- package/Engines/thinEngine.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js +10 -3
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +36 -3
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +13 -0
- package/FlowGraph/flowGraphEventBlock.js +21 -2
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +11 -3
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.js +26 -0
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/Layers/layer.js +5 -1
- package/Layers/layer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -0
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +19 -1
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Lights/light.d.ts +5 -0
- package/Lights/light.js +18 -2
- package/Lights/light.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +14 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +6 -3
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +10 -3
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.d.ts +2 -1
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +10 -4
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +10 -2
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.d.ts +42 -0
- package/Materials/PBR/openpbrMaterial.js +108 -13
- package/Materials/PBR/openpbrMaterial.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +26 -0
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/envCubeTexture.js +33 -15
- package/Materials/Textures/envCubeTexture.js.map +1 -1
- package/Materials/effect.functions.js +4 -4
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/material.d.ts +16 -1
- package/Materials/material.js +16 -1
- package/Materials/material.js.map +1 -1
- package/Materials/standardMaterial.js +4 -2
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +16 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.d.ts +24 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js +93 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +10 -2
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/abstractMesh.js +1 -0
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/mesh.js +3 -0
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.d.ts +6 -0
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/brdfTextureTools.d.ts +12 -0
- package/Misc/brdfTextureTools.js +22 -0
- package/Misc/brdfTextureTools.js.map +1 -1
- package/Misc/depthReducer.js +1 -1
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/snapshotRenderingHelper.d.ts +29 -2
- package/Misc/snapshotRenderingHelper.js +108 -1
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/textureTools.js +26 -0
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.js +1 -1
- package/Misc/tools.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js +17 -10
- package/Particles/Node/Blocks/Update/updateFlowMapBlock.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js +14 -0
- package/Particles/Node/Blocks/Update/updateNoiseBlock.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.js +114 -12
- package/Particles/Node/Blocks/particleSourceTextureBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.d.ts +11 -0
- package/Particles/Node/nodeParticleBuildState.js +15 -0
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.js +33 -24
- package/Particles/Node/nodeParticleSystemSet.js.map +1 -1
- package/Particles/gpuParticleSystem.js +1 -0
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +13 -0
- package/Particles/thinParticleSystem.js +42 -6
- package/Particles/thinParticleSystem.js.map +1 -1
- package/PostProcesses/postProcessManager.d.ts +2 -0
- package/PostProcesses/postProcessManager.js +14 -8
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +12 -9
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/depthRendererSceneComponent.js +6 -6
- package/Rendering/depthRendererSceneComponent.js.map +1 -1
- package/Rendering/iblCdfGeneratorSceneComponent.d.ts +6 -0
- package/Rendering/iblCdfGeneratorSceneComponent.js +16 -0
- package/Rendering/iblCdfGeneratorSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +4 -1
- package/Rendering/prePassRenderer.js +31 -9
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +20 -7
- package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +20 -12
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +44 -16
- package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js +4 -1
- package/Shaders/ShadersInclude/openpbrFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +8 -5
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js +2 -0
- package/Shaders/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js +1 -1
- package/Shaders/ShadersInclude/openpbrVolumeFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +12 -7
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/openpbr.fragment.js +14 -15
- package/Shaders/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +20 -7
- package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +21 -13
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js +3 -3
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +44 -16
- package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +5 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js +2 -0
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrNormalMapFragmentMainFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrVolumeFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +10 -10
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js +4 -0
- package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.js +16 -17
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.js +1 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +16 -0
- package/scene.js +13 -0
- package/scene.js.map +1 -1
|
@@ -35,13 +35,20 @@ export class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {
|
|
|
35
35
|
// returning true here to continue the propagation of the pointer event to the rest of the blocks
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
|
-
// check if the mesh is the picked mesh or a descendant
|
|
39
38
|
const mesh = this._getReferencedMesh(context);
|
|
40
|
-
|
|
39
|
+
const pickedMesh = pickedInfo.pickInfo?.pickedMesh;
|
|
40
|
+
// When no target mesh is configured, fire for any picked mesh.
|
|
41
|
+
// When a target is configured, require an exact match or descendant match.
|
|
42
|
+
// Match by reference first, then by descendant, then by stable name/id as a
|
|
43
|
+
// fallback for scene reloads where the object reference changes but the mesh
|
|
44
|
+
// identity (name) is preserved (uniqueId increments monotonically and is NOT
|
|
45
|
+
// stable across reloads).
|
|
46
|
+
const meshMatches = !mesh ? !!pickedMesh : !!(pickedMesh && (pickedMesh === mesh || _IsDescendantOf(pickedMesh, mesh) || pickedMesh.name === mesh.name));
|
|
47
|
+
if (meshMatches && pickedMesh) {
|
|
41
48
|
this.pointerId.setValue(pickedInfo.event.pointerId, context);
|
|
42
49
|
this.pickOrigin.setValue(pickedInfo.pickInfo.ray?.origin, context);
|
|
43
50
|
this.pickedPoint.setValue(pickedInfo.pickInfo.pickedPoint, context);
|
|
44
|
-
this.pickedMesh.setValue(
|
|
51
|
+
this.pickedMesh.setValue(pickedMesh, context);
|
|
45
52
|
this._execute(context);
|
|
46
53
|
// stop the propagation if the configuration says so
|
|
47
54
|
return !this.config?.stopPropagation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAiBjG;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAoChE;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,CAAC,CAAC;QAFE,WAAM,GAAN,MAAM,CAA4C;QATtE;;WAEG;QACsB,SAAI,gDAAmD;QAS5E,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QAC3E,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;QACzE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzG,CAAC;IAEM,kBAAkB,CAAC,OAAyB;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAEe,aAAa,CAAC,OAAyB,EAAE,UAAuB;QAC5E,uBAAuB;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,WAAW,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;YAClC,iGAAiG;YACjG,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,
|
|
1
|
+
{"version":3,"file":"flowGraphMeshPickEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAiBjG;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,mBAAmB;IAoChE;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,MAAM,CAAC,CAAC;Q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D,QAAQ;IACZ,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,6EAAyC;IAC7C,CAAC;CACJ;AACD,aAAa,wEAAoC,2BAA2B,CAAC,CAAC","sourcesContent":["import { type AbstractMesh } from \"../../../Meshes/abstractMesh\";\r\nimport { FlowGraphEventBlock } from \"../../flowGraphEventBlock\";\r\nimport { type PointerInfo, PointerEventTypes } from \"../../../Events/pointerEvents\";\r\nimport { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { _IsDescendantOf } from \"../../utils\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\nimport { type FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\r\nimport { RichTypeAny, RichTypeNumber, RichTypeVector3 } from \"core/FlowGraph/flowGraphRichTypes\";\r\nimport { type Vector3 } from \"core/Maths/math.vector\";\r\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\r\n/**\r\n * Configuration for the mesh pick event block.\r\n */\r\nexport interface IFlowGraphMeshPickEventBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * Should this mesh block propagation of the event.\r\n */\r\n stopPropagation?: boolean;\r\n\r\n /**\r\n * The mesh to listen to. Can also be set by the asset input.\r\n */\r\n targetMesh?: AbstractMesh;\r\n}\r\n/**\r\n * A block that activates when a mesh is picked.\r\n */\r\nexport class FlowGraphMeshPickEventBlock extends FlowGraphEventBlock {\r\n /**\r\n * Input connection: The mesh to listen to.\r\n */\r\n public readonly asset: FlowGraphDataConnection<AbstractMesh>;\r\n\r\n /**\r\n * Output connection: The picked point.\r\n */\r\n public readonly pickedPoint: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Output connection: The picked origin.\r\n */\r\n public readonly pickOrigin: FlowGraphDataConnection<Vector3>;\r\n\r\n /**\r\n * Output connection: The pointer id.\r\n */\r\n public readonly pointerId: FlowGraphDataConnection<number>;\r\n\r\n /**\r\n * Output connection: The picked mesh. Possibly NOT the same as the asset (could be a descendant).\r\n */\r\n public readonly pickedMesh: FlowGraphDataConnection<AbstractMesh>;\r\n\r\n /**\r\n * Input connection: The type of the pointer event.\r\n */\r\n public readonly pointerType: FlowGraphDataConnection<PointerEventTypes>;\r\n\r\n /**\r\n * the type of the event this block reacts to\r\n */\r\n public override readonly type: FlowGraphEventType = FlowGraphEventType.MeshPick;\r\n\r\n public constructor(\r\n /**\r\n * the configuration of the block\r\n */\r\n public override config?: IFlowGraphMeshPickEventBlockConfiguration\r\n ) {\r\n super(config);\r\n this.asset = this.registerDataInput(\"asset\", RichTypeAny, config?.targetMesh);\r\n this.pickedPoint = this.registerDataOutput(\"pickedPoint\", RichTypeVector3);\r\n this.pickOrigin = this.registerDataOutput(\"pickOrigin\", RichTypeVector3);\r\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\r\n this.pickedMesh = this.registerDataOutput(\"pickedMesh\", RichTypeAny);\r\n this.pointerType = this.registerDataInput(\"pointerType\", RichTypeAny, PointerEventTypes.POINTERPICK);\r\n }\r\n\r\n public _getReferencedMesh(context: FlowGraphContext): AbstractMesh {\r\n return this.asset.getValue(context);\r\n }\r\n\r\n public override _executeEvent(context: FlowGraphContext, pickedInfo: PointerInfo): boolean {\r\n // get the pointer type\r\n const pointerType = this.pointerType.getValue(context);\r\n if (pointerType !== pickedInfo.type) {\r\n // returning true here to continue the propagation of the pointer event to the rest of the blocks\r\n return true;\r\n }\r\n const mesh = this._getReferencedMesh(context);\r\n const pickedMesh = pickedInfo.pickInfo?.pickedMesh;\r\n // When no target mesh is configured, fire for any picked mesh.\r\n // When a target is configured, require an exact match or descendant match.\r\n // Match by reference first, then by descendant, then by stable name/id as a\r\n // fallback for scene reloads where the object reference changes but the mesh\r\n // identity (name) is preserved (uniqueId increments monotonically and is NOT\r\n // stable across reloads).\r\n const meshMatches = !mesh ? !!pickedMesh : !!(pickedMesh && (pickedMesh === mesh || _IsDescendantOf(pickedMesh, mesh) || pickedMesh.name === mesh.name));\r\n if (meshMatches && pickedMesh) {\r\n this.pointerId.setValue((pickedInfo.event as PointerEvent).pointerId, context);\r\n this.pickOrigin.setValue(pickedInfo.pickInfo!.ray?.origin!, context);\r\n this.pickedPoint.setValue(pickedInfo.pickInfo!.pickedPoint!, context);\r\n this.pickedMesh.setValue(pickedMesh, context);\r\n this._execute(context);\r\n // stop the propagation if the configuration says so\r\n return !this.config?.stopPropagation;\r\n } else {\r\n // reset the outputs\r\n this.pointerId.resetToDefaultValue(context);\r\n this.pickOrigin.resetToDefaultValue(context);\r\n this.pickedPoint.resetToDefaultValue(context);\r\n this.pickedMesh.resetToDefaultValue(context);\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _preparePendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _cancelPendingTasks(_context: FlowGraphContext): void {\r\n // no-op\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.MeshPickEvent;\r\n }\r\n}\r\nRegisterClass(FlowGraphBlockNames.MeshPickEvent, FlowGraphMeshPickEventBlock);\r\n"]}
|
|
@@ -45,20 +45,53 @@ export class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSign
|
|
|
45
45
|
getClassName() {
|
|
46
46
|
return "FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */;
|
|
47
47
|
}
|
|
48
|
+
_serializeValue(value) {
|
|
49
|
+
if (value === null || value === undefined) {
|
|
50
|
+
return String(value);
|
|
51
|
+
}
|
|
52
|
+
if (typeof value === "object") {
|
|
53
|
+
// Prefer the object's own toString() (e.g. Vector3 → "{X:1 Y:2 Z:3}").
|
|
54
|
+
// Only fall back to JSON.stringify when toString() is the unhelpful default.
|
|
55
|
+
const str = value.toString();
|
|
56
|
+
if (str === "[object Object]") {
|
|
57
|
+
try {
|
|
58
|
+
return JSON.stringify(value);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return str;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return str;
|
|
65
|
+
}
|
|
66
|
+
return String(value);
|
|
67
|
+
}
|
|
48
68
|
_getMessageValue(context) {
|
|
49
69
|
if (this.config?.messageTemplate) {
|
|
50
70
|
let template = this.config.messageTemplate;
|
|
51
71
|
const matches = this._getTemplateMatches(template);
|
|
72
|
+
// If the message input is an object, use its keys as the primary
|
|
73
|
+
// source for template placeholders, falling back to named data inputs.
|
|
74
|
+
const messageValue = this.message.getValue(context);
|
|
75
|
+
const messageObj = messageValue !== null && messageValue !== undefined && typeof messageValue === "object" ? messageValue : null;
|
|
52
76
|
for (const match of matches) {
|
|
53
|
-
|
|
77
|
+
let value;
|
|
78
|
+
if (messageObj !== null && match in messageObj) {
|
|
79
|
+
value = messageObj[match];
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
value = this.getDataInput(match)?.getValue(context);
|
|
83
|
+
}
|
|
54
84
|
if (value !== undefined) {
|
|
55
|
-
//
|
|
56
|
-
|
|
85
|
+
// Escape regex metacharacters in the placeholder name before building the pattern.
|
|
86
|
+
const escapedMatch = match.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
87
|
+
template = template.replace(new RegExp(`\\{${escapedMatch}\\}`, "g"), this._serializeValue(value));
|
|
57
88
|
}
|
|
58
89
|
}
|
|
59
90
|
return template;
|
|
60
91
|
}
|
|
61
92
|
else {
|
|
93
|
+
// No template — pass the raw value directly so Logger receives the original
|
|
94
|
+
// object (e.g. Vector3) rather than a stringified representation.
|
|
62
95
|
return this.message.getValue(context);
|
|
63
96
|
}
|
|
64
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphConsoleLogBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Execution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C;YACL,CAAC;YACD,OAAO,QAAQ,CAAC;QACpB,CAAC;aAAM,CAAC;YACJ,4EAA4E;YAC5E,kEAAkE;YAClE,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAEO,mBAAmB,CAAC,QAAgB;QACxC,MAAM,KAAK,GAAG,cAAc,CAAC;QAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC;QACV,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ;AAED,aAAa,kEAAiC,wBAAwB,CAAC,CAAC","sourcesContent":["import { type FlowGraphContext } from \"../../flowGraphContext\";\r\nimport { type FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport { FlowGraphExecutionBlockWithOutSignal } from \"../../flowGraphExecutionBlockWithOutSignal\";\r\nimport { RichTypeAny, RichTypeString } from \"../../flowGraphRichTypes\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { type IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\r\n\r\n/**\r\n * Configuration for the console log block.\r\n */\r\nexport interface IFlowGraphConsoleLogBlockConfiguration extends IFlowGraphBlockConfiguration {\r\n /**\r\n * An optional message template to use for the log message.\r\n * If provided, the template can hold placeholders for the message value.\r\n * For example, if the template is \"The message is: \\{data\\}\", a new data input called \"data\" will be created.\r\n * The value of the message input will be used to replace the placeholder in the template.\r\n */\r\n messageTemplate?: string;\r\n}\r\n\r\n/**\r\n * Block that logs a message to the console.\r\n */\r\nexport class FlowGraphConsoleLogBlock extends FlowGraphExecutionBlockWithOutSignal {\r\n /**\r\n * Input connection: The message to log.\r\n * Will be ignored if a message template is provided.\r\n */\r\n public readonly message: FlowGraphDataConnection<any>;\r\n\r\n /**\r\n * Input connection: The log type.\r\n */\r\n public readonly logType: FlowGraphDataConnection<\"log\" | \"warn\" | \"error\">;\r\n\r\n /**\r\n * Creates a new console log block.\r\n * @param config optional configuration\r\n */\r\n public constructor(config?: IFlowGraphConsoleLogBlockConfiguration) {\r\n super(config);\r\n this.message = this.registerDataInput(\"message\", RichTypeAny);\r\n this.logType = this.registerDataInput(\"logType\", RichTypeString, \"log\") as FlowGraphDataConnection<\"log\" | \"warn\" | \"error\">;\r\n if (config?.messageTemplate) {\r\n const matches = this._getTemplateMatches(config.messageTemplate);\r\n for (const match of matches) {\r\n this.registerDataInput(match, RichTypeAny);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n const typeValue = this.logType.getValue(context);\r\n const messageValue = this._getMessageValue(context);\r\n if (typeValue === \"warn\") {\r\n Logger.Warn(messageValue);\r\n } else if (typeValue === \"error\") {\r\n Logger.Error(messageValue);\r\n } else {\r\n Logger.Log(messageValue);\r\n }\r\n // activate the output flow block\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @returns class name of the block.\r\n */\r\n public override getClassName(): string {\r\n return FlowGraphBlockNames.ConsoleLog;\r\n }\r\n\r\n private _serializeValue(value: any): string {\r\n if (value === null || value === undefined) {\r\n return String(value);\r\n }\r\n if (typeof value === \"object\") {\r\n // Prefer the object's own toString() (e.g. Vector3 → \"{X:1 Y:2 Z:3}\").\r\n // Only fall back to JSON.stringify when toString() is the unhelpful default.\r\n const str = value.toString();\r\n if (str === \"[object Object]\") {\r\n try {\r\n return JSON.stringify(value);\r\n } catch {\r\n return str;\r\n }\r\n }\r\n return str;\r\n }\r\n return String(value);\r\n }\r\n\r\n private _getMessageValue(context: FlowGraphContext): string {\r\n if (this.config?.messageTemplate) {\r\n let template: string = this.config.messageTemplate;\r\n const matches = this._getTemplateMatches(template);\r\n // If the message input is an object, use its keys as the primary\r\n // source for template placeholders, falling back to named data inputs.\r\n const messageValue = this.message.getValue(context);\r\n const messageObj = messageValue !== null && messageValue !== undefined && typeof messageValue === \"object\" ? messageValue : null;\r\n for (const match of matches) {\r\n let value: any;\r\n if (messageObj !== null && match in messageObj) {\r\n value = messageObj[match];\r\n } else {\r\n value = this.getDataInput(match)?.getValue(context);\r\n }\r\n if (value !== undefined) {\r\n // Escape regex metacharacters in the placeholder name before building the pattern.\r\n const escapedMatch = match.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\r\n template = template.replace(new RegExp(`\\\\{${escapedMatch}\\\\}`, \"g\"), this._serializeValue(value));\r\n }\r\n }\r\n return template;\r\n } else {\r\n // No template — pass the raw value directly so Logger receives the original\r\n // object (e.g. Vector3) rather than a stringified representation.\r\n return this.message.getValue(context);\r\n }\r\n }\r\n\r\n private _getTemplateMatches(template: string): string[] {\r\n const regex = /\\{([^}]+)\\}/g;\r\n const matches: string[] = [];\r\n let match;\r\n while ((match = regex.exec(template)) !== null) {\r\n matches.push(match[1]);\r\n }\r\n return matches;\r\n }\r\n}\r\n\r\nRegisterClass(FlowGraphBlockNames.ConsoleLog, FlowGraphConsoleLogBlock);\r\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlowGraphAsyncExecutionBlock } from "./flowGraphAsyncExecutionBlock.js";
|
|
2
|
+
import { type IFlowGraphBlockConfiguration } from "./flowGraphBlock.js";
|
|
2
3
|
import { type FlowGraphContext } from "./flowGraphContext.js";
|
|
3
4
|
import { FlowGraphEventType } from "./flowGraphEventType.js";
|
|
4
5
|
/**
|
|
@@ -11,6 +12,18 @@ export declare abstract class FlowGraphEventBlock extends FlowGraphAsyncExecutio
|
|
|
11
12
|
* For example, scene start should have a negative priority because it should be initialized last.
|
|
12
13
|
*/
|
|
13
14
|
initPriority: number;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new event block.
|
|
17
|
+
* @param config optional configuration
|
|
18
|
+
*/
|
|
19
|
+
constructor(config?: IFlowGraphBlockConfiguration);
|
|
20
|
+
/**
|
|
21
|
+
* Deserializes from an object.
|
|
22
|
+
* Filters out the legacy "in" signal input that existed before event blocks
|
|
23
|
+
* stopped exposing it, so old serialized graphs load without error.
|
|
24
|
+
* @param serializationObject the object to deserialize from
|
|
25
|
+
*/
|
|
26
|
+
deserialize(serializationObject: any): void;
|
|
14
27
|
/**
|
|
15
28
|
* The type of the event
|
|
16
29
|
*/
|
|
@@ -4,8 +4,12 @@ import { FlowGraphAsyncExecutionBlock } from "./flowGraphAsyncExecutionBlock.js"
|
|
|
4
4
|
* its output signal when the event is triggered.
|
|
5
5
|
*/
|
|
6
6
|
export class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new event block.
|
|
9
|
+
* @param config optional configuration
|
|
10
|
+
*/
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super(config);
|
|
9
13
|
/**
|
|
10
14
|
* the priority of initialization of this block.
|
|
11
15
|
* For example, scene start should have a negative priority because it should be initialized last.
|
|
@@ -15,6 +19,21 @@ export class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock {
|
|
|
15
19
|
* The type of the event
|
|
16
20
|
*/
|
|
17
21
|
this.type = "NoTrigger" /* FlowGraphEventType.NoTrigger */;
|
|
22
|
+
// Event blocks are driven by scene events, not by an incoming signal.
|
|
23
|
+
// Remove the inherited `in` port so it is not shown in the editor UI
|
|
24
|
+
// and cannot be accidentally wired.
|
|
25
|
+
this._unregisterSignalInput("in");
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Deserializes from an object.
|
|
29
|
+
* Filters out the legacy "in" signal input that existed before event blocks
|
|
30
|
+
* stopped exposing it, so old serialized graphs load without error.
|
|
31
|
+
* @param serializationObject the object to deserialize from
|
|
32
|
+
*/
|
|
33
|
+
deserialize(serializationObject) {
|
|
34
|
+
const filtered = { ...serializationObject };
|
|
35
|
+
filtered.signalInputs = (serializationObject.signalInputs ?? []).filter((s) => s.name !== "in");
|
|
36
|
+
super.deserialize(filtered);
|
|
18
37
|
}
|
|
19
38
|
/**
|
|
20
39
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphEventBlock.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphEventBlock.js","sourceRoot":"","sources":["../../../../dev/core/src/FlowGraph/flowGraphEventBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAK9E;;;GAGG;AACH,MAAM,OAAgB,mBAAoB,SAAQ,4BAA4B;IAO1E;;;OAGG;IACH,YAAY,MAAqC;QAC7C,KAAK,CAAC,MAAM,CAAC,CAAC;QAXlB;;;WAGG;QACI,iBAAY,GAAW,CAAC,CAAC;QA0BhC;;WAEG;QACa,SAAI,kDAAoD;QArBpE,sEAAsE;QACtE,qEAAqE;QACrE,oCAAoC;QACpC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACa,WAAW,CAAC,mBAAwB;QAChD,MAAM,QAAQ,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;QAC5C,QAAQ,CAAC,YAAY,GAAG,CAAC,mBAAmB,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACrG,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAMD;;OAEG;IACI,QAAQ,CAAC,OAAyB;QACrC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACjC,iEAAiE;QACjE,2DAA2D;QAC3D,8DAA8D;QAC9D,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;OAQG;IACa,kBAAkB,CAAC,OAAyB;QACxD,IAAI,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC/B,mEAAmE;QACnE,mDAAmD;QACnD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CASJ","sourcesContent":["import { FlowGraphAsyncExecutionBlock } from \"./flowGraphAsyncExecutionBlock\";\r\nimport { type IFlowGraphBlockConfiguration } from \"./flowGraphBlock\";\r\nimport { type FlowGraphContext } from \"./flowGraphContext\";\r\nimport { FlowGraphEventType } from \"./flowGraphEventType\";\r\n\r\n/**\r\n * A type of block that listens to an event observable and activates\r\n * its output signal when the event is triggered.\r\n */\r\nexport abstract class FlowGraphEventBlock extends FlowGraphAsyncExecutionBlock {\r\n /**\r\n * the priority of initialization of this block.\r\n * For example, scene start should have a negative priority because it should be initialized last.\r\n */\r\n public initPriority: number = 0;\r\n\r\n /**\r\n * Creates a new event block.\r\n * @param config optional configuration\r\n */\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n // Event blocks are driven by scene events, not by an incoming signal.\r\n // Remove the inherited `in` port so it is not shown in the editor UI\r\n // and cannot be accidentally wired.\r\n this._unregisterSignalInput(\"in\");\r\n }\r\n\r\n /**\r\n * Deserializes from an object.\r\n * Filters out the legacy \"in\" signal input that existed before event blocks\r\n * stopped exposing it, so old serialized graphs load without error.\r\n * @param serializationObject the object to deserialize from\r\n */\r\n public override deserialize(serializationObject: any) {\r\n const filtered = { ...serializationObject };\r\n filtered.signalInputs = (serializationObject.signalInputs ?? []).filter((s: any) => s.name !== \"in\");\r\n super.deserialize(filtered);\r\n }\r\n\r\n /**\r\n * The type of the event\r\n */\r\n public readonly type: FlowGraphEventType = FlowGraphEventType.NoTrigger;\r\n /**\r\n * @internal\r\n */\r\n public _execute(context: FlowGraphContext): void {\r\n context._notifyExecuteNode(this);\r\n // Fire both signals: KHR_interactivity graphs connect to `done`,\r\n // while editor-authored graphs typically connect to `out`.\r\n // Both must fire so that either wiring style works correctly.\r\n this.done._activateSignal(context);\r\n this.out._activateSignal(context);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Override _startPendingTasks so that event blocks do NOT fire the\r\n * `out` signal at graph-start time. The base FlowGraphAsyncExecutionBlock\r\n * fires `out` immediately in _startPendingTasks (useful for async blocks\r\n * like PlayAnimation that start a task and let sync flow continue).\r\n * Event blocks should only fire their output signals when the actual\r\n * event occurs, which is handled by _execute.\r\n */\r\n public override _startPendingTasks(context: FlowGraphContext): void {\r\n if (context._getExecutionVariable(this, \"_initialized\", false)) {\r\n this._cancelPendingTasks(context);\r\n this._resetAfterCanceled(context);\r\n }\r\n this._preparePendingTasks(context);\r\n context._addPendingBlock(this);\r\n // Do NOT fire out._activateSignal — event blocks fire both out and\r\n // done in _execute when the actual event triggers.\r\n context._setExecutionVariable(this, \"_initialized\", true);\r\n }\r\n\r\n /**\r\n * Execute the event. This function should be called by the flow graph when the event is triggered.\r\n * @param context the context in which the event is executed\r\n * @param payload the payload of the event\r\n * @returns a boolean indicating if the event should stop propagation. if false, the event will stop propagating.\r\n */\r\n public abstract _executeEvent(context: FlowGraphContext, payload: any): boolean;\r\n}\r\n"]}
|
|
@@ -22,9 +22,17 @@ import { NodeRenderGraphCullObjectsBlock } from "./Blocks/cullObjectsBlock.js";
|
|
|
22
22
|
export class NodeRenderGraph {
|
|
23
23
|
/** @returns the inspector from bundle or global */
|
|
24
24
|
_getGlobalNodeRenderGraphEditor() {
|
|
25
|
-
// UMD
|
|
25
|
+
// UMD global name detection from bundle metadata.
|
|
26
|
+
// Note: rollup-built UMD bundles do not expose the editor class
|
|
27
|
+
// directly on the namespace - it lives on `.default.NodeRenderGraphEditor` -
|
|
28
|
+
// so we unwrap that case before falling back to the BABYLON global.
|
|
26
29
|
if (typeof NODERENDERGRAPHEDITOR !== "undefined") {
|
|
27
|
-
|
|
30
|
+
if (NODERENDERGRAPHEDITOR.NodeRenderGraphEditor) {
|
|
31
|
+
return NODERENDERGRAPHEDITOR;
|
|
32
|
+
}
|
|
33
|
+
if (NODERENDERGRAPHEDITOR.default?.NodeRenderGraphEditor) {
|
|
34
|
+
return NODERENDERGRAPHEDITOR.default;
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
// In case of module let's check the global emitted from the editor entry point.
|
|
30
38
|
if (typeof BABYLON !== "undefined" && typeof BABYLON.NodeRenderGraphEditor !== "undefined") {
|
|
@@ -709,7 +717,7 @@ export class NodeRenderGraph {
|
|
|
709
717
|
}
|
|
710
718
|
NodeRenderGraph._BuildIdGenerator = 0;
|
|
711
719
|
/** Define the Url to load node editor script */
|
|
712
|
-
NodeRenderGraph.EditorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/
|
|
720
|
+
NodeRenderGraph.EditorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/nodeRenderGraphEditor/babylon.nodeRenderGraphEditor.js`;
|
|
713
721
|
/** Define the Url to load snippets */
|
|
714
722
|
NodeRenderGraph.SnippetUrl = `https://snippet.babylonjs.com`;
|
|
715
723
|
/** Description of custom blocks to use in the node render graph editor */
|
|
@@ -1 +1 @@
|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;YAEH,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AA90Bc,iCAAiB,GAAW,CAAC,AAAZ,CAAa;AAI7C,gDAAgD;AAClC,yBAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,MAAM,CAAC,OAAO,6CAA6C,AAA1F,CAA2F;AAElH,sCAAsC;AACxB,0BAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AAEhD,0EAA0E;AAC5D,uCAAuB,GAA6C,EAAE,AAA/C,CAAgD;AA4D9E;IADN,SAAS,EAAE;6CACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;gDACE","sourcesContent":["import {\r\n type Observer,\r\n type Nullable,\r\n type NodeRenderGraphBlock,\r\n type NodeRenderGraphTeleportOutBlock,\r\n type NodeRenderGraphTeleportInBlock,\r\n type AbstractEngine,\r\n type INodeRenderGraphCreateOptions,\r\n type INodeRenderGraphEditorOptions,\r\n type Scene,\r\n type WritableObject,\r\n type IShadowLight,\r\n type INodeRenderGraphCustomBlockDescription,\r\n type Immutable,\r\n type Camera,\r\n} from \"core/index\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { NodeRenderGraphOutputBlock } from \"./Blocks/outputBlock\";\r\nimport { FrameGraph } from \"../frameGraph\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebRequest } from \"../../Misc/webRequest\";\r\nimport { NodeRenderGraphInputBlock } from \"./Blocks/inputBlock\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport { Engine } from \"../../Engines/engine\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"./Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphClearBlock } from \"./Blocks/Textures/clearBlock\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"./Blocks/Rendering/baseObjectRendererBlock\";\r\nimport { NodeRenderGraphObjectRendererBlock } from \"./Blocks/Rendering/objectRendererBlock\";\r\nimport { NodeRenderGraphBuildState } from \"./nodeRenderGraphBuildState\";\r\nimport { NodeRenderGraphCullObjectsBlock } from \"./Blocks/cullObjectsBlock\";\r\n\r\n// declare NODERENDERGRAPHEDITOR namespace for compilation issue\r\ndeclare let NODERENDERGRAPHEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Defines a node render graph\r\n */\r\nexport class NodeRenderGraph {\r\n private static _BuildIdGenerator: number = 0;\r\n\r\n private _buildId: number = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/NodeRenderGraph/babylon.nodeRenderGraph.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /** Description of custom blocks to use in the node render graph editor */\r\n public static CustomBlockDescriptions: INodeRenderGraphCustomBlockDescription[] = [];\r\n\r\n private BJSNODERENDERGRAPHEDITOR = this._getGlobalNodeRenderGraphEditor();\r\n\r\n /** @returns the inspector from bundle or global */\r\n private _getGlobalNodeRenderGraphEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODERENDERGRAPHEDITOR !== \"undefined\") {\r\n return NODERENDERGRAPHEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeRenderGraphEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://nrge.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeRenderGraphBlock[] = [];\r\n\r\n /**\r\n * Observable raised before the node render graph is built\r\n */\r\n public onBeforeBuildObservable = new Observable<FrameGraph>();\r\n\r\n /**\r\n * Observable raised after the node render graph is built\r\n * Note that this is the same observable as the one in the underlying FrameGraph!\r\n */\r\n public get onBuildObservable() {\r\n return this._frameGraph.onBuildObservable;\r\n }\r\n\r\n /**\r\n * Observable raised when an error is detected\r\n */\r\n public onBuildErrorObservable = new Observable<string>();\r\n\r\n /** Gets or sets the RenderGraphOutputBlock used to gather the final node render graph data */\r\n public outputBlock: Nullable<NodeRenderGraphOutputBlock> = null;\r\n\r\n /**\r\n * Snippet ID if the graph was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The name of the node render graph\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the graph\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _scene: Scene;\r\n private readonly _resizeObserver: Nullable<Observer<AbstractEngine>> = null;\r\n private readonly _frameGraph: FrameGraph;\r\n private readonly _options: INodeRenderGraphCreateOptions;\r\n\r\n /**\r\n * Gets the frame graph used by this node render graph\r\n */\r\n public get frameGraph() {\r\n return this._frameGraph;\r\n }\r\n\r\n /**\r\n * Gets the scene used by this node render graph\r\n * @returns the scene used by this node render graph\r\n */\r\n public getScene() {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * Gets the options used to create this node render graph\r\n */\r\n public get options(): Immutable<INodeRenderGraphCreateOptions> {\r\n return this._options;\r\n }\r\n\r\n /**\r\n * Creates a new node render graph\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use to execute the graph\r\n * @param options defines the options to use when creating the graph\r\n */\r\n public constructor(name: string, scene: Scene, options?: INodeRenderGraphCreateOptions) {\r\n this.name = name;\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n\r\n options = {\r\n debugTextures: false,\r\n autoConfigure: false,\r\n verbose: false,\r\n rebuildGraphOnEngineResize: true,\r\n autoFillExternalInputs: true,\r\n ...options,\r\n };\r\n\r\n this._options = options;\r\n\r\n this._frameGraph = new FrameGraph(this._scene, options.debugTextures, this);\r\n this._frameGraph.name = name;\r\n\r\n if (options.rebuildGraphOnEngineResize) {\r\n this._resizeObserver = this._engine.onResizeObservable.add(async () => {\r\n await this.buildAsync(false, true, false);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current class name (\"NodeRenderGraph\")\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeRenderGraph\";\r\n }\r\n\r\n /**\r\n * Gets a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName<T extends NodeRenderGraphBlock>(name: string): Nullable<T> {\r\n let result: Nullable<T> = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block as T;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): Nullable<T> {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block as T;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get all blocks that match a predicate\r\n * @param predicate defines the predicate used to find the good candidate(s)\r\n * @returns the list of blocks found\r\n */\r\n public getBlocksByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): T[] {\r\n const blocks: T[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n blocks.push(block as T);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public getInputBlocks() {\r\n const blocks: NodeRenderGraphInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as NodeRenderGraphInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Replaces a camera in all camera input blocks of this node render graph.\r\n * If the current camera is found in any input block, it is replaced by the new camera,\r\n * optionally updating the scene's pointer camera and rebuilding the graph.\r\n * @param currentCamera The camera to replace.\r\n * @param newCamera The new camera to assign to the matching input blocks.\r\n * @param updateCameraToUseForPointers If true (default), updates `scene.cameraToUseForPointers` to the new camera when a replacement occurs.\r\n * @param rebuildGraph If true (default), rebuilds the graph asynchronously after the replacement.\r\n * @returns A promise that resolves to true if at least one input block was updated, false otherwise.\r\n */\r\n public async replaceCameraAsync(currentCamera: Nullable<Camera>, newCamera: Camera, updateCameraToUseForPointers = true, rebuildGraph = true) {\r\n const inputBlocks = this.getInputBlocks();\r\n\r\n let updated = false;\r\n for (const block of inputBlocks) {\r\n if (block.isCamera() && block.value === currentCamera) {\r\n block.value = newCamera;\r\n updated = true;\r\n }\r\n }\r\n\r\n if (updated) {\r\n if (updateCameraToUseForPointers) {\r\n this._scene.cameraToUseForPointers = newCamera;\r\n }\r\n\r\n if (rebuildGraph) {\r\n const currentAutoFill = this._options.autoFillExternalInputs;\r\n try {\r\n this._options.autoFillExternalInputs = false; // makes sure that the camera input block(s) we just updated don't get overwritten by autoFillExternalInputs\r\n\r\n await this.buildAsync();\r\n } finally {\r\n this._options.autoFillExternalInputs = currentAutoFill;\r\n }\r\n }\r\n }\r\n\r\n return updated;\r\n }\r\n\r\n /**\r\n * Launch the node render graph editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: INodeRenderGraphEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n if (typeof this.BJSNODERENDERGRAPHEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeRenderGraph.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the node editor window.\r\n * @param additionalConfig Additional configuration for the FGE\r\n */\r\n private _createNodeEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeRenderGraph: this,\r\n customBlockDescriptions: NodeRenderGraph.CustomBlockDescriptions,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Build the final list of blocks that will be executed by the \"execute\" method.\r\n * It also builds the underlying frame graph unless specified otherwise.\r\n * @param dontBuildFrameGraph If the underlying frame graph should not be built (default: false)\r\n * @param waitForReadiness If the method should wait for the frame graph to be ready before resolving (default: true). Note that this parameter has no effect if \"dontBuildFrameGraph\" is true.\r\n * @param setAsSceneFrameGraph If the built frame graph must be set as the scene's frame graph (default: true)\r\n */\r\n public async buildAsync(dontBuildFrameGraph = false, waitForReadiness = true, setAsSceneFrameGraph = true): Promise<void> {\r\n if (!this.outputBlock) {\r\n throw new Error(\"You must define the outputBlock property before building the node render graph\");\r\n }\r\n\r\n if (setAsSceneFrameGraph) {\r\n this._scene.frameGraph = this._frameGraph;\r\n }\r\n\r\n this._initializeBlock(this.outputBlock);\r\n\r\n this._frameGraph.clear();\r\n\r\n const state = new NodeRenderGraphBuildState();\r\n\r\n state.buildId = this._buildId;\r\n state.verbose = this._options.verbose!;\r\n\r\n if (this._options.autoFillExternalInputs) {\r\n this._autoFillExternalInputs();\r\n }\r\n\r\n this.onBeforeBuildObservable.notifyObservers(this._frameGraph);\r\n\r\n // Make sure that one of the object renderer is flagged as the main object renderer\r\n const objectRendererBlocks = this.getBlocksByPredicate<NodeRenderGraphBaseObjectRendererBlock>((block) => block instanceof NodeRenderGraphBaseObjectRendererBlock);\r\n if (objectRendererBlocks.length > 0 && !objectRendererBlocks.find((block) => block.isMainObjectRenderer)) {\r\n objectRendererBlocks[0].isMainObjectRenderer = true;\r\n }\r\n\r\n try {\r\n this.outputBlock.build(state);\r\n\r\n if (!dontBuildFrameGraph) {\r\n await this._frameGraph.buildAsync(waitForReadiness);\r\n }\r\n } finally {\r\n this._buildId = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n state.emitErrors(this.onBuildErrorObservable);\r\n }\r\n }\r\n\r\n private _autoFillExternalInputs() {\r\n const allInputs = this.getInputBlocks();\r\n\r\n const shadowLights: IShadowLight[] = [];\r\n for (const light of this._scene.lights) {\r\n if ((light as IShadowLight).setShadowProjectionMatrix !== undefined) {\r\n shadowLights.push(light as IShadowLight);\r\n }\r\n }\r\n\r\n let cameraIndex = 0;\r\n let lightIndex = 0;\r\n for (const input of allInputs) {\r\n if (!input.isExternal) {\r\n continue;\r\n }\r\n if (!input.isAnAncestorOfType(\"NodeRenderGraphOutputBlock\")) {\r\n continue;\r\n }\r\n if ((input.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n // nothing to do\r\n } else if (input.isCamera()) {\r\n const camera = this._scene.cameras[cameraIndex++] || this._scene.cameras[0];\r\n if (!this._scene.cameraToUseForPointers) {\r\n this._scene.cameraToUseForPointers = camera;\r\n }\r\n\r\n input.value = camera;\r\n } else if (input.isObjectList()) {\r\n input.value = { meshes: this._scene.meshes, particleSystems: this._scene.particleSystems };\r\n } else if (input.isShadowLight()) {\r\n if (lightIndex < shadowLights.length) {\r\n input.value = shadowLights[lightIndex++];\r\n lightIndex = lightIndex % shadowLights.length;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns a promise that resolves when the node render graph is ready to be executed\r\n * This method must be called after the graph has been built (NodeRenderGraph.build called)!\r\n * @param timeStep Time step in ms between retries (default is 16)\r\n * @param maxTimeout Maximum time in ms to wait for the graph to be ready (default is 10000)\r\n * @returns The promise that resolves when the graph is ready\r\n */\r\n public async whenReadyAsync(timeStep = 16, maxTimeout = 10000): Promise<void> {\r\n this._frameGraph.pausedExecution = true;\r\n await this._frameGraph.whenReadyAsync(timeStep, maxTimeout);\r\n this._frameGraph.pausedExecution = false;\r\n }\r\n\r\n /**\r\n * Execute the graph (the graph must have been built before!)\r\n */\r\n public execute() {\r\n this._frameGraph.execute();\r\n }\r\n\r\n private _initializeBlock(node: NodeRenderGraphBlock) {\r\n node.initialize();\r\n if (this._options.autoConfigure) {\r\n node.autoConfigure();\r\n }\r\n\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph\r\n */\r\n public clear() {\r\n this.outputBlock = null;\r\n this.attachedBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Remove a block from the current graph\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeRenderGraphBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block === this.outputBlock) {\r\n this.outputBlock = null;\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the graph\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeRenderGraphBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType: typeof NodeRenderGraphBlock = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const additionalConstructionParameters = parsedBlock.additionalConstructionParameters;\r\n const block: NodeRenderGraphBlock = additionalConstructionParameters\r\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\r\n : new blockType(\"\", this._frameGraph, this._scene);\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as NodeRenderGraphTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as NodeRenderGraphTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // Outputs\r\n if (source.outputNodeId) {\r\n this.outputBlock = map[source.outputNodeId] as NodeRenderGraphOutputBlock;\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: { [key: number]: number } = {};\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeRenderGraphBlock, source: any, map: { [key: number]: NodeRenderGraphBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Generate a string containing the code declaration required to create an equivalent of this node render graph\r\n * @returns a string\r\n */\r\n public generateCode() {\r\n let alreadyDumped: NodeRenderGraphBlock[] = [];\r\n const blocks: NodeRenderGraphBlock[] = [];\r\n const uniqueNames: string[] = [\"const\", \"var\", \"let\"];\r\n // Gets active blocks\r\n if (this.outputBlock) {\r\n this._gatherBlocks(this.outputBlock, blocks);\r\n }\r\n\r\n // Generate\r\n const options = JSON.stringify(this._options);\r\n let codeString = `let nodeRenderGraph = new BABYLON.NodeRenderGraph(\"${this.name || \"render graph\"}\", scene, ${options});\\n`;\r\n for (const node of blocks) {\r\n if (node.isInput && alreadyDumped.indexOf(node) === -1) {\r\n codeString += node._dumpCode(uniqueNames, alreadyDumped) + \"\\n\";\r\n }\r\n }\r\n\r\n if (this.outputBlock) {\r\n // Connections\r\n alreadyDumped = [];\r\n codeString += \"// Connections\\n\";\r\n codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n // Output nodes\r\n codeString += \"// Output nodes\\n\";\r\n codeString += `nodeRenderGraph.outputBlock = ${this.outputBlock._codeVariableName};\\n`;\r\n codeString += `nodeRenderGraph.build();\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n private _gatherBlocks(rootNode: NodeRenderGraphBlock, list: NodeRenderGraphBlock[]) {\r\n if (list.indexOf(rootNode) !== -1) {\r\n return;\r\n }\r\n list.push(rootNode);\r\n\r\n for (const input of rootNode.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== rootNode) {\r\n this._gatherBlocks(block, list);\r\n }\r\n }\r\n }\r\n\r\n // Teleportation\r\n if (rootNode.isTeleportOut) {\r\n const block = rootNode as NodeRenderGraphTeleportOutBlock;\r\n if (block.entryPoint) {\r\n this._gatherBlocks(block.entryPoint, list);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and set it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Source textures\r\n const colorTexture = new NodeRenderGraphInputBlock(\"Color Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n colorTexture.creationOptions.options.samples = 4;\r\n\r\n const depthTexture = new NodeRenderGraphInputBlock(\"Depth Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n depthTexture.creationOptions.options.samples = 4;\r\n\r\n // Clear texture\r\n const clear = new NodeRenderGraphClearBlock(\"Clear\", this._frameGraph, this._scene);\r\n clear.clearDepth = true;\r\n clear.clearStencil = true;\r\n\r\n colorTexture.output.connectTo(clear.target);\r\n depthTexture.output.connectTo(clear.depth);\r\n\r\n // Object list and culling\r\n const camera = new NodeRenderGraphInputBlock(\"Camera\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n const objectList = new NodeRenderGraphInputBlock(\"Object List\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n const cull = new NodeRenderGraphCullObjectsBlock(\"Cull\", this._frameGraph, this._scene);\r\n\r\n camera.output.connectTo(cull.camera);\r\n objectList.output.connectTo(cull.objects);\r\n\r\n // Render objects\r\n const mainRendering = new NodeRenderGraphObjectRendererBlock(\"Main Rendering\", this._frameGraph, this._scene);\r\n\r\n camera.output.connectTo(mainRendering.camera);\r\n cull.output.connectTo(mainRendering.objects);\r\n clear.output.connectTo(mainRendering.target);\r\n clear.outputDepth.connectTo(mainRendering.depth);\r\n\r\n // Final output\r\n const output = new NodeRenderGraphOutputBlock(\"Output\", this._frameGraph, this._scene);\r\n mainRendering.output.connectTo(output.texture);\r\n\r\n this.outputBlock = output;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current node render graph.\r\n * Note that you should call buildAsync() on the returned graph to make it usable.\r\n * @param name defines the name to use for the new node render graph\r\n * @returns the new node render graph\r\n */\r\n public clone(name: string): NodeRenderGraph {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeRenderGraph(name, this._scene), this);\r\n clone.name = name;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this node render graph in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node render graph will be saved)\r\n * @returns the serialized node render graph object\r\n */\r\n public serialize(selectedBlocks?: NodeRenderGraphBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeRenderGraphBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeRenderGraph\";\r\n if (this.outputBlock) {\r\n serializationObject.outputNodeId = this.outputBlock.uniqueId;\r\n }\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this._frameGraph.dispose();\r\n (this._frameGraph as WritableObject<FrameGraph>) = undefined as any;\r\n\r\n this._engine.onResizeObservable.remove(this._resizeObserver);\r\n (this._resizeObserver as WritableObject<Nullable<Observer<AbstractEngine>>>) = null;\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildErrorObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node render graph set to default basic configuration\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @returns a new NodeRenderGraph\r\n */\r\n public static async CreateDefaultAsync(name: string, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions): Promise<NodeRenderGraph> {\r\n const renderGraph = new NodeRenderGraph(name, scene, nodeRenderGraphOptions);\r\n\r\n renderGraph.setToDefault();\r\n await renderGraph.buildAsync(false, true, false);\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from parsed graph data\r\n * @param source defines the JSON representation of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a new node render graph\r\n */\r\n public static Parse(source: any, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions, skipBuild: boolean = true): NodeRenderGraph {\r\n const renderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(source.name, scene, nodeRenderGraphOptions), source, null);\r\n\r\n renderGraph.parseSerializedObject(source);\r\n if (!skipBuild) {\r\n void renderGraph.buildAsync();\r\n }\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from a snippet saved by the node render graph editor\r\n * @param snippetId defines the snippet to load\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @param nodeRenderGraph defines a node render graph to update (instead of creating a new one)\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a promise that will resolve to the new node render graph\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(\r\n snippetId: string,\r\n scene: Scene,\r\n nodeRenderGraphOptions?: INodeRenderGraphCreateOptions,\r\n nodeRenderGraph?: NodeRenderGraph,\r\n skipBuild: boolean = true\r\n ): Promise<NodeRenderGraph> {\r\n if (snippetId === \"_BLANK\") {\r\n return NodeRenderGraph.CreateDefaultAsync(\"blank\", scene, nodeRenderGraphOptions);\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", async () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeRenderGraph);\r\n\r\n if (!nodeRenderGraph) {\r\n nodeRenderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(snippetId, scene, nodeRenderGraphOptions), serializationObject, null);\r\n }\r\n\r\n nodeRenderGraph.parseSerializedObject(serializationObject);\r\n nodeRenderGraph.snippetId = snippetId;\r\n\r\n try {\r\n if (!skipBuild) {\r\n await nodeRenderGraph.buildAsync();\r\n }\r\n resolve(nodeRenderGraph);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeRenderGraph.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraph.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,wCAAwC,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO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er,\r\n type Nullable,\r\n type NodeRenderGraphBlock,\r\n type NodeRenderGraphTeleportOutBlock,\r\n type NodeRenderGraphTeleportInBlock,\r\n type AbstractEngine,\r\n type INodeRenderGraphCreateOptions,\r\n type INodeRenderGraphEditorOptions,\r\n type Scene,\r\n type WritableObject,\r\n type IShadowLight,\r\n type INodeRenderGraphCustomBlockDescription,\r\n type Immutable,\r\n type Camera,\r\n} from \"core/index\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { NodeRenderGraphOutputBlock } from \"./Blocks/outputBlock\";\r\nimport { FrameGraph } from \"../frameGraph\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebRequest } from \"../../Misc/webRequest\";\r\nimport { NodeRenderGraphInputBlock } from \"./Blocks/inputBlock\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport { Engine } from \"../../Engines/engine\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"./Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphClearBlock } from \"./Blocks/Textures/clearBlock\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"./Blocks/Rendering/baseObjectRendererBlock\";\r\nimport { NodeRenderGraphObjectRendererBlock } from \"./Blocks/Rendering/objectRendererBlock\";\r\nimport { NodeRenderGraphBuildState } from \"./nodeRenderGraphBuildState\";\r\nimport { NodeRenderGraphCullObjectsBlock } from \"./Blocks/cullObjectsBlock\";\r\n\r\n// declare NODERENDERGRAPHEDITOR namespace for compilation issue\r\ndeclare let NODERENDERGRAPHEDITOR: any;\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Defines a node render graph\r\n */\r\nexport class NodeRenderGraph {\r\n private static _BuildIdGenerator: number = 0;\r\n\r\n private _buildId: number = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/nodeRenderGraphEditor/babylon.nodeRenderGraphEditor.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n /** Description of custom blocks to use in the node render graph editor */\r\n public static CustomBlockDescriptions: INodeRenderGraphCustomBlockDescription[] = [];\r\n\r\n private BJSNODERENDERGRAPHEDITOR = this._getGlobalNodeRenderGraphEditor();\r\n\r\n /** @returns the inspector from bundle or global */\r\n private _getGlobalNodeRenderGraphEditor(): any {\r\n // UMD global name detection from bundle metadata.\r\n // Note: rollup-built UMD bundles do not expose the editor class\r\n // directly on the namespace - it lives on `.default.NodeRenderGraphEditor` -\r\n // so we unwrap that case before falling back to the BABYLON global.\r\n if (typeof NODERENDERGRAPHEDITOR !== \"undefined\") {\r\n if ((NODERENDERGRAPHEDITOR as any).NodeRenderGraphEditor) {\r\n return NODERENDERGRAPHEDITOR;\r\n }\r\n if ((NODERENDERGRAPHEDITOR as any).default?.NodeRenderGraphEditor) {\r\n return (NODERENDERGRAPHEDITOR as any).default;\r\n }\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeRenderGraphEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://nrge.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeRenderGraphBlock[] = [];\r\n\r\n /**\r\n * Observable raised before the node render graph is built\r\n */\r\n public onBeforeBuildObservable = new Observable<FrameGraph>();\r\n\r\n /**\r\n * Observable raised after the node render graph is built\r\n * Note that this is the same observable as the one in the underlying FrameGraph!\r\n */\r\n public get onBuildObservable() {\r\n return this._frameGraph.onBuildObservable;\r\n }\r\n\r\n /**\r\n * Observable raised when an error is detected\r\n */\r\n public onBuildErrorObservable = new Observable<string>();\r\n\r\n /** Gets or sets the RenderGraphOutputBlock used to gather the final node render graph data */\r\n public outputBlock: Nullable<NodeRenderGraphOutputBlock> = null;\r\n\r\n /**\r\n * Snippet ID if the graph was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The name of the node render graph\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the graph\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _scene: Scene;\r\n private readonly _resizeObserver: Nullable<Observer<AbstractEngine>> = null;\r\n private readonly _frameGraph: FrameGraph;\r\n private readonly _options: INodeRenderGraphCreateOptions;\r\n\r\n /**\r\n * Gets the frame graph used by this node render graph\r\n */\r\n public get frameGraph() {\r\n return this._frameGraph;\r\n }\r\n\r\n /**\r\n * Gets the scene used by this node render graph\r\n * @returns the scene used by this node render graph\r\n */\r\n public getScene() {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * Gets the options used to create this node render graph\r\n */\r\n public get options(): Immutable<INodeRenderGraphCreateOptions> {\r\n return this._options;\r\n }\r\n\r\n /**\r\n * Creates a new node render graph\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use to execute the graph\r\n * @param options defines the options to use when creating the graph\r\n */\r\n public constructor(name: string, scene: Scene, options?: INodeRenderGraphCreateOptions) {\r\n this.name = name;\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n\r\n options = {\r\n debugTextures: false,\r\n autoConfigure: false,\r\n verbose: false,\r\n rebuildGraphOnEngineResize: true,\r\n autoFillExternalInputs: true,\r\n ...options,\r\n };\r\n\r\n this._options = options;\r\n\r\n this._frameGraph = new FrameGraph(this._scene, options.debugTextures, this);\r\n this._frameGraph.name = name;\r\n\r\n if (options.rebuildGraphOnEngineResize) {\r\n this._resizeObserver = this._engine.onResizeObservable.add(async () => {\r\n await this.buildAsync(false, true, false);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current class name (\"NodeRenderGraph\")\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeRenderGraph\";\r\n }\r\n\r\n /**\r\n * Gets a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName<T extends NodeRenderGraphBlock>(name: string): Nullable<T> {\r\n let result: Nullable<T> = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block as T;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): Nullable<T> {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block as T;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get all blocks that match a predicate\r\n * @param predicate defines the predicate used to find the good candidate(s)\r\n * @returns the list of blocks found\r\n */\r\n public getBlocksByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): T[] {\r\n const blocks: T[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n blocks.push(block as T);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public getInputBlocks() {\r\n const blocks: NodeRenderGraphInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as NodeRenderGraphInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Replaces a camera in all camera input blocks of this node render graph.\r\n * If the current camera is found in any input block, it is replaced by the new camera,\r\n * optionally updating the scene's pointer camera and rebuilding the graph.\r\n * @param currentCamera The camera to replace.\r\n * @param newCamera The new camera to assign to the matching input blocks.\r\n * @param updateCameraToUseForPointers If true (default), updates `scene.cameraToUseForPointers` to the new camera when a replacement occurs.\r\n * @param rebuildGraph If true (default), rebuilds the graph asynchronously after the replacement.\r\n * @returns A promise that resolves to true if at least one input block was updated, false otherwise.\r\n */\r\n public async replaceCameraAsync(currentCamera: Nullable<Camera>, newCamera: Camera, updateCameraToUseForPointers = true, rebuildGraph = true) {\r\n const inputBlocks = this.getInputBlocks();\r\n\r\n let updated = false;\r\n for (const block of inputBlocks) {\r\n if (block.isCamera() && block.value === currentCamera) {\r\n block.value = newCamera;\r\n updated = true;\r\n }\r\n }\r\n\r\n if (updated) {\r\n if (updateCameraToUseForPointers) {\r\n this._scene.cameraToUseForPointers = newCamera;\r\n }\r\n\r\n if (rebuildGraph) {\r\n const currentAutoFill = this._options.autoFillExternalInputs;\r\n try {\r\n this._options.autoFillExternalInputs = false; // makes sure that the camera input block(s) we just updated don't get overwritten by autoFillExternalInputs\r\n\r\n await this.buildAsync();\r\n } finally {\r\n this._options.autoFillExternalInputs = currentAutoFill;\r\n }\r\n }\r\n }\r\n\r\n return updated;\r\n }\r\n\r\n /**\r\n * Launch the node render graph editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: INodeRenderGraphEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n if (typeof this.BJSNODERENDERGRAPHEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeRenderGraph.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the node editor window.\r\n * @param additionalConfig Additional configuration for the FGE\r\n */\r\n private _createNodeEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeRenderGraph: this,\r\n customBlockDescriptions: NodeRenderGraph.CustomBlockDescriptions,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Build the final list of blocks that will be executed by the \"execute\" method.\r\n * It also builds the underlying frame graph unless specified otherwise.\r\n * @param dontBuildFrameGraph If the underlying frame graph should not be built (default: false)\r\n * @param waitForReadiness If the method should wait for the frame graph to be ready before resolving (default: true). Note that this parameter has no effect if \"dontBuildFrameGraph\" is true.\r\n * @param setAsSceneFrameGraph If the built frame graph must be set as the scene's frame graph (default: true)\r\n */\r\n public async buildAsync(dontBuildFrameGraph = false, waitForReadiness = true, setAsSceneFrameGraph = true): Promise<void> {\r\n if (!this.outputBlock) {\r\n throw new Error(\"You must define the outputBlock property before building the node render graph\");\r\n }\r\n\r\n if (setAsSceneFrameGraph) {\r\n this._scene.frameGraph = this._frameGraph;\r\n }\r\n\r\n this._initializeBlock(this.outputBlock);\r\n\r\n this._frameGraph.clear();\r\n\r\n const state = new NodeRenderGraphBuildState();\r\n\r\n state.buildId = this._buildId;\r\n state.verbose = this._options.verbose!;\r\n\r\n if (this._options.autoFillExternalInputs) {\r\n this._autoFillExternalInputs();\r\n }\r\n\r\n this.onBeforeBuildObservable.notifyObservers(this._frameGraph);\r\n\r\n // Make sure that one of the object renderer is flagged as the main object renderer\r\n const objectRendererBlocks = this.getBlocksByPredicate<NodeRenderGraphBaseObjectRendererBlock>((block) => block instanceof NodeRenderGraphBaseObjectRendererBlock);\r\n if (objectRendererBlocks.length > 0 && !objectRendererBlocks.find((block) => block.isMainObjectRenderer)) {\r\n objectRendererBlocks[0].isMainObjectRenderer = true;\r\n }\r\n\r\n try {\r\n this.outputBlock.build(state);\r\n\r\n if (!dontBuildFrameGraph) {\r\n await this._frameGraph.buildAsync(waitForReadiness);\r\n }\r\n } finally {\r\n this._buildId = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n state.emitErrors(this.onBuildErrorObservable);\r\n }\r\n }\r\n\r\n private _autoFillExternalInputs() {\r\n const allInputs = this.getInputBlocks();\r\n\r\n const shadowLights: IShadowLight[] = [];\r\n for (const light of this._scene.lights) {\r\n if ((light as IShadowLight).setShadowProjectionMatrix !== undefined) {\r\n shadowLights.push(light as IShadowLight);\r\n }\r\n }\r\n\r\n let cameraIndex = 0;\r\n let lightIndex = 0;\r\n for (const input of allInputs) {\r\n if (!input.isExternal) {\r\n continue;\r\n }\r\n if (!input.isAnAncestorOfType(\"NodeRenderGraphOutputBlock\")) {\r\n continue;\r\n }\r\n if ((input.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n // nothing to do\r\n } else if (input.isCamera()) {\r\n const camera = this._scene.cameras[cameraIndex++] || this._scene.cameras[0];\r\n if (!this._scene.cameraToUseForPointers) {\r\n this._scene.cameraToUseForPointers = camera;\r\n }\r\n\r\n input.value = camera;\r\n } else if (input.isObjectList()) {\r\n input.value = { meshes: this._scene.meshes, particleSystems: this._scene.particleSystems };\r\n } else if (input.isShadowLight()) {\r\n if (lightIndex < shadowLights.length) {\r\n input.value = shadowLights[lightIndex++];\r\n lightIndex = lightIndex % shadowLights.length;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns a promise that resolves when the node render graph is ready to be executed\r\n * This method must be called after the graph has been built (NodeRenderGraph.build called)!\r\n * @param timeStep Time step in ms between retries (default is 16)\r\n * @param maxTimeout Maximum time in ms to wait for the graph to be ready (default is 10000)\r\n * @returns The promise that resolves when the graph is ready\r\n */\r\n public async whenReadyAsync(timeStep = 16, maxTimeout = 10000): Promise<void> {\r\n this._frameGraph.pausedExecution = true;\r\n await this._frameGraph.whenReadyAsync(timeStep, maxTimeout);\r\n this._frameGraph.pausedExecution = false;\r\n }\r\n\r\n /**\r\n * Execute the graph (the graph must have been built before!)\r\n */\r\n public execute() {\r\n this._frameGraph.execute();\r\n }\r\n\r\n private _initializeBlock(node: NodeRenderGraphBlock) {\r\n node.initialize();\r\n if (this._options.autoConfigure) {\r\n node.autoConfigure();\r\n }\r\n\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph\r\n */\r\n public clear() {\r\n this.outputBlock = null;\r\n this.attachedBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Remove a block from the current graph\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeRenderGraphBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block === this.outputBlock) {\r\n this.outputBlock = null;\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the graph\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeRenderGraphBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType: typeof NodeRenderGraphBlock = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const additionalConstructionParameters = parsedBlock.additionalConstructionParameters;\r\n const block: NodeRenderGraphBlock = additionalConstructionParameters\r\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\r\n : new blockType(\"\", this._frameGraph, this._scene);\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as NodeRenderGraphTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as NodeRenderGraphTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // Outputs\r\n if (source.outputNodeId) {\r\n this.outputBlock = map[source.outputNodeId] as NodeRenderGraphOutputBlock;\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: { [key: number]: number } = {};\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeRenderGraphBlock, source: any, map: { [key: number]: NodeRenderGraphBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Generate a string containing the code declaration required to create an equivalent of this node render graph\r\n * @returns a string\r\n */\r\n public generateCode() {\r\n let alreadyDumped: NodeRenderGraphBlock[] = [];\r\n const blocks: NodeRenderGraphBlock[] = [];\r\n const uniqueNames: string[] = [\"const\", \"var\", \"let\"];\r\n // Gets active blocks\r\n if (this.outputBlock) {\r\n this._gatherBlocks(this.outputBlock, blocks);\r\n }\r\n\r\n // Generate\r\n const options = JSON.stringify(this._options);\r\n let codeString = `let nodeRenderGraph = new BABYLON.NodeRenderGraph(\"${this.name || \"render graph\"}\", scene, ${options});\\n`;\r\n for (const node of blocks) {\r\n if (node.isInput && alreadyDumped.indexOf(node) === -1) {\r\n codeString += node._dumpCode(uniqueNames, alreadyDumped) + \"\\n\";\r\n }\r\n }\r\n\r\n if (this.outputBlock) {\r\n // Connections\r\n alreadyDumped = [];\r\n codeString += \"// Connections\\n\";\r\n codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n // Output nodes\r\n codeString += \"// Output nodes\\n\";\r\n codeString += `nodeRenderGraph.outputBlock = ${this.outputBlock._codeVariableName};\\n`;\r\n codeString += `nodeRenderGraph.build();\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n private _gatherBlocks(rootNode: NodeRenderGraphBlock, list: NodeRenderGraphBlock[]) {\r\n if (list.indexOf(rootNode) !== -1) {\r\n return;\r\n }\r\n list.push(rootNode);\r\n\r\n for (const input of rootNode.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== rootNode) {\r\n this._gatherBlocks(block, list);\r\n }\r\n }\r\n }\r\n\r\n // Teleportation\r\n if (rootNode.isTeleportOut) {\r\n const block = rootNode as NodeRenderGraphTeleportOutBlock;\r\n if (block.entryPoint) {\r\n this._gatherBlocks(block.entryPoint, list);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and set it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Source textures\r\n const colorTexture = new NodeRenderGraphInputBlock(\"Color Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n colorTexture.creationOptions.options.samples = 4;\r\n\r\n const depthTexture = new NodeRenderGraphInputBlock(\"Depth Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n depthTexture.creationOptions.options.samples = 4;\r\n\r\n // Clear texture\r\n const clear = new NodeRenderGraphClearBlock(\"Clear\", this._frameGraph, this._scene);\r\n clear.clearDepth = true;\r\n clear.clearStencil = true;\r\n\r\n colorTexture.output.connectTo(clear.target);\r\n depthTexture.output.connectTo(clear.depth);\r\n\r\n // Object list and culling\r\n const camera = new NodeRenderGraphInputBlock(\"Camera\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n const objectList = new NodeRenderGraphInputBlock(\"Object List\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n const cull = new NodeRenderGraphCullObjectsBlock(\"Cull\", this._frameGraph, this._scene);\r\n\r\n camera.output.connectTo(cull.camera);\r\n objectList.output.connectTo(cull.objects);\r\n\r\n // Render objects\r\n const mainRendering = new NodeRenderGraphObjectRendererBlock(\"Main Rendering\", this._frameGraph, this._scene);\r\n\r\n camera.output.connectTo(mainRendering.camera);\r\n cull.output.connectTo(mainRendering.objects);\r\n clear.output.connectTo(mainRendering.target);\r\n clear.outputDepth.connectTo(mainRendering.depth);\r\n\r\n // Final output\r\n const output = new NodeRenderGraphOutputBlock(\"Output\", this._frameGraph, this._scene);\r\n mainRendering.output.connectTo(output.texture);\r\n\r\n this.outputBlock = output;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current node render graph.\r\n * Note that you should call buildAsync() on the returned graph to make it usable.\r\n * @param name defines the name to use for the new node render graph\r\n * @returns the new node render graph\r\n */\r\n public clone(name: string): NodeRenderGraph {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeRenderGraph(name, this._scene), this);\r\n clone.name = name;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this node render graph in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node render graph will be saved)\r\n * @returns the serialized node render graph object\r\n */\r\n public serialize(selectedBlocks?: NodeRenderGraphBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeRenderGraphBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeRenderGraph\";\r\n if (this.outputBlock) {\r\n serializationObject.outputNodeId = this.outputBlock.uniqueId;\r\n }\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this._frameGraph.dispose();\r\n (this._frameGraph as WritableObject<FrameGraph>) = undefined as any;\r\n\r\n this._engine.onResizeObservable.remove(this._resizeObserver);\r\n (this._resizeObserver as WritableObject<Nullable<Observer<AbstractEngine>>>) = null;\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildErrorObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node render graph set to default basic configuration\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @returns a new NodeRenderGraph\r\n */\r\n public static async CreateDefaultAsync(name: string, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions): Promise<NodeRenderGraph> {\r\n const renderGraph = new NodeRenderGraph(name, scene, nodeRenderGraphOptions);\r\n\r\n renderGraph.setToDefault();\r\n await renderGraph.buildAsync(false, true, false);\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from parsed graph data\r\n * @param source defines the JSON representation of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a new node render graph\r\n */\r\n public static Parse(source: any, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions, skipBuild: boolean = true): NodeRenderGraph {\r\n const renderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(source.name, scene, nodeRenderGraphOptions), source, null);\r\n\r\n renderGraph.parseSerializedObject(source);\r\n if (!skipBuild) {\r\n void renderGraph.buildAsync();\r\n }\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from a snippet saved by the node render graph editor\r\n * @param snippetId defines the snippet to load\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @param nodeRenderGraph defines a node render graph to update (instead of creating a new one)\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a promise that will resolve to the new node render graph\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(\r\n snippetId: string,\r\n scene: Scene,\r\n nodeRenderGraphOptions?: INodeRenderGraphCreateOptions,\r\n nodeRenderGraph?: NodeRenderGraph,\r\n skipBuild: boolean = true\r\n ): Promise<NodeRenderGraph> {\r\n if (snippetId === \"_BLANK\") {\r\n return NodeRenderGraph.CreateDefaultAsync(\"blank\", scene, nodeRenderGraphOptions);\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", async () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeRenderGraph);\r\n\r\n if (!nodeRenderGraph) {\r\n nodeRenderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(snippetId, scene, nodeRenderGraphOptions), serializationObject, null);\r\n }\r\n\r\n nodeRenderGraph.parseSerializedObject(serializationObject);\r\n nodeRenderGraph.snippetId = snippetId;\r\n\r\n try {\r\n if (!skipBuild) {\r\n await nodeRenderGraph.buildAsync();\r\n }\r\n resolve(nodeRenderGraph);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -913,6 +913,32 @@ export class FrameGraphTextureManager {
|
|
|
913
913
|
return { width: 4, height: 4, length: 8 };
|
|
914
914
|
case 37808:
|
|
915
915
|
return { width: 4, height: 4, length: 16 };
|
|
916
|
+
case 37809:
|
|
917
|
+
return { width: 5, height: 4, length: 16 };
|
|
918
|
+
case 37810:
|
|
919
|
+
return { width: 5, height: 5, length: 16 };
|
|
920
|
+
case 37811:
|
|
921
|
+
return { width: 6, height: 5, length: 16 };
|
|
922
|
+
case 37812:
|
|
923
|
+
return { width: 6, height: 6, length: 16 };
|
|
924
|
+
case 37813:
|
|
925
|
+
return { width: 8, height: 5, length: 16 };
|
|
926
|
+
case 37814:
|
|
927
|
+
return { width: 8, height: 6, length: 16 };
|
|
928
|
+
case 37815:
|
|
929
|
+
return { width: 8, height: 8, length: 16 };
|
|
930
|
+
case 37816:
|
|
931
|
+
return { width: 10, height: 5, length: 16 };
|
|
932
|
+
case 37817:
|
|
933
|
+
return { width: 10, height: 6, length: 16 };
|
|
934
|
+
case 37818:
|
|
935
|
+
return { width: 10, height: 8, length: 16 };
|
|
936
|
+
case 37819:
|
|
937
|
+
return { width: 10, height: 10, length: 16 };
|
|
938
|
+
case 37820:
|
|
939
|
+
return { width: 12, height: 10, length: 16 };
|
|
940
|
+
case 37821:
|
|
941
|
+
return { width: 12, height: 12, length: 16 };
|
|
916
942
|
case 36196:
|
|
917
943
|
case 37492:
|
|
918
944
|
return { width: 4, height: 4, length: 8 };
|