@babylonjs/core 7.39.1 → 7.39.2
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/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Debug/directionalLightFrustumViewer.d.ts +2 -1
- package/Debug/directionalLightFrustumViewer.js +4 -3
- package/Debug/directionalLightFrustumViewer.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +1 -0
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +8 -0
- package/Engines/constants.js +8 -0
- package/Engines/constants.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/blackAndWhitePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/bloomPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/blurPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js +5 -17
- package/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js +5 -17
- package/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js +3 -9
- package/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +6 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +40 -20
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +77 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +250 -0
- package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +57 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +169 -0
- package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Rendering/cullObjectsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +4 -13
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.d.ts +6 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js +27 -0
- package/FrameGraph/Node/Blocks/Rendering/objectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.d.ts +19 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +28 -0
- package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +3 -9
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +2 -5
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/executeBlock.d.ts +29 -0
- package/FrameGraph/Node/Blocks/executeBlock.js +43 -0
- package/FrameGraph/Node/Blocks/executeBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +4 -0
- package/FrameGraph/Node/Blocks/index.js +4 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +7 -2
- package/FrameGraph/Node/Blocks/inputBlock.js +13 -0
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/resourceContainerBlock.d.ts +55 -0
- package/FrameGraph/Node/Blocks/resourceContainerBlock.js +97 -0
- package/FrameGraph/Node/Blocks/resourceContainerBlock.js.map +1 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +13 -10
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +11 -4
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +32 -4
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.d.ts +1 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js +11 -0
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +18 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +24 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Passes/cullPass.d.ts +1 -1
- package/FrameGraph/Passes/cullPass.js.map +1 -1
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +22 -0
- package/FrameGraph/Tasks/Misc/executeTask.js +28 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +72 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +183 -0
- package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +16 -5
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +46 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +107 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +264 -0
- package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +7 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +9 -0
- package/FrameGraph/frameGraph.js +12 -3
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.js +4 -1
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/index.d.ts +5 -0
- package/FrameGraph/index.js +5 -0
- package/FrameGraph/index.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +1 -1
- package/Inputs/scene.inputManager.js +8 -1
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.d.ts +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -7
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/directionalLight.d.ts +5 -4
- package/Lights/directionalLight.js +7 -9
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/shadowLight.d.ts +4 -4
- package/Lights/shadowLight.js +3 -2
- package/Lights/shadowLight.js.map +1 -1
- package/Lights/spotLight.d.ts +2 -2
- package/Lights/spotLight.js +3 -2
- package/Lights/spotLight.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +18 -6
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js +18 -6
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -0
- package/Materials/Textures/renderTargetTexture.js +18 -8
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/material.js +3 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +4 -0
- package/Materials/materialPluginBase.js +4 -0
- package/Materials/materialPluginBase.js.map +1 -1
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/lattice.material.d.ts +3 -8
- package/Meshes/lattice.material.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/filesInput.d.ts +3 -1
- package/Misc/filesInput.js +8 -4
- package/Misc/filesInput.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +2 -2
- package/PostProcesses/postProcess.js +4 -4
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +1 -1
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +1 -1
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/default.fragment.js +2 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +2 -1
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.js +2 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.js +2 -1
- package/Shaders/pbr.vertex.js.map +1 -1
- package/XR/webXRCamera.js +3 -0
- package/XR/webXRCamera.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +7 -0
- package/scene.js +10 -1
- package/scene.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circleOfConfusionPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,8DAAkE;AAC5G,OAAO,EAAE,gCAAgC,EAAE,sEAA4D;AAEvG;;GAEG;AACH,MAAM,OAAO,gDAAiD,SAAQ,oBAAoB;IAGtF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,wCAAwC,CAAC,gBAAgB,CAAC,CAAC;QAC/F,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC1F,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,MAAM,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,wCAAwC,CAAC,YAAY,CAAC,CAAC;QAErF,IAAI,CAAC,MAAM,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,uBAAuB,CAAC,CAAC;QAC9G,IAAI,CAAC,WAA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GjG;AAQD;IADC,sBAAsB,CAAC,qBAAqB,+CAAuC,YAAY,CAAC;yFAGhG;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;gFAG/E;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;6EAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;qFAGpF;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;mFAGlF;AA8GL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\n\r\n/**\r\n * Block that implements the circle of confusion post process\r\n */\r\nexport class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphCircleOfConfusionTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphCircleOfConfusionTask(\r\n this.name,\r\n frameGraph,\r\n new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true })\r\n );\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.postProcess.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.postProcess.lensSize = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.postProcess.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.postProcess.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.postProcess.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.postProcess.focusDistance = value;\r\n }\r\n\r\n /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.postProcess.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.postProcess.focalLength = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphCircleOfConfusionPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;\r\n if (geomViewDepthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock\", NodeRenderGraphCircleOfConfusionPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"circleOfConfusionPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/circleOfConfusionPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,+BAA+B,EAAE,8DAAkE;AAC5G,OAAO,EAAE,gCAAgC,EAAE,sEAA4D;AAEvG;;GAEG;AACH,MAAM,OAAO,gDAAiD,SAAQ,oBAAoB;IAGtF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;OAKG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY;QACjE,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;QAC/E,IAAI,CAAC,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AAC,sBAAsB,+CAAuC,YAAY,CAAC;0FAGjG;AAQD;IADC,sBAAsB,CAAC,qBAAqB,+CAAuC,YAAY,CAAC;yFAGhG;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;gFAG/E;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;6EAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;qFAGpF;AAQD;IADC,sBAAsB,CAAC,cAAc,wCAAgC,YAAY,CAAC;mFAGlF;AA6FL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphCircleOfConfusionTask } from \"core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask\";\r\nimport { ThinCircleOfConfusionPostProcess } from \"core/PostProcesses/thinCircleOfConfusionPostProcess\";\r\n\r\n/**\r\n * Block that implements the circle of confusion post process\r\n */\r\nexport class NodeRenderGraphCircleOfConfusionPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphCircleOfConfusionTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphCircleOfConfusionPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphCircleOfConfusionTask(\r\n this.name,\r\n frameGraph,\r\n new ThinCircleOfConfusionPostProcess(name, scene.getEngine(), { depthNotNormalized: true })\r\n );\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.postProcess.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.postProcess.lensSize = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.postProcess.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.postProcess.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.postProcess.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.postProcess.focusDistance = value;\r\n }\r\n\r\n /** Focal length of the effect's camera in scene units/1000 (eg. millimeter) */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.postProcess.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.postProcess.focalLength = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphCircleOfConfusionPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphCircleOfConfusionPostProcessBlock\", NodeRenderGraphCircleOfConfusionPostProcessBlock);\r\n"]}
|
|
@@ -29,6 +29,7 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
|
|
|
29
29
|
this.registerInput("geomViewDepth", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);
|
|
30
30
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
31
31
|
this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
|
|
32
|
+
this._addDependenciesInput();
|
|
32
33
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
34
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
34
35
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -149,24 +150,11 @@ export class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraph
|
|
|
149
150
|
}
|
|
150
151
|
_buildBlock(state) {
|
|
151
152
|
super._buildBlock(state);
|
|
152
|
-
this._frameGraphTask.name = this.name;
|
|
153
153
|
this.output.value = this._frameGraphTask.outputTexture;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;
|
|
159
|
-
if (geomViewDepthConnectedPoint) {
|
|
160
|
-
this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value;
|
|
161
|
-
}
|
|
162
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
163
|
-
if (destinationConnectedPoint) {
|
|
164
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
165
|
-
}
|
|
166
|
-
const cameraConnectedPoint = this.camera.connectedPoint;
|
|
167
|
-
if (cameraConnectedPoint) {
|
|
168
|
-
this._frameGraphTask.camera = cameraConnectedPoint.value;
|
|
169
|
-
}
|
|
154
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
155
|
+
this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value;
|
|
156
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
157
|
+
this._frameGraphTask.camera = this.camera.connectedPoint?.value;
|
|
170
158
|
}
|
|
171
159
|
_dumpPropertiesCode() {
|
|
172
160
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,oBAAoB;IAGjF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,uDAAgF,EAAE,GAAG,GAAG,KAAK;QAChK,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;QAE1D,IAAI,CAAC,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Ac,wCAAgC,YAAY,CAAC;8EAGlF;AAQD;IADC,sBAAsB,CAAC,QAAQ,wCAAgC,YAAY,CAAC;wEAG5E;AAQD;IADC,sBAAsB,CAAC,gBAAgB,wCAAgC,YAAY,CAAC;gFAGpF;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,CAAC;2EAG/E;AA8GL,aAAa,CAAC,qDAAqD,EAAE,2CAA2C,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphDepthOfFieldTask } from \"../../../Tasks/PostProcesses/depthOfFieldTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphDepthOfFieldTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);\r\n }\r\n\r\n private _createTask(blurLevel: ThinDepthOfFieldEffectBlurLevel, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const depthSamplingMode = this._frameGraphTask.depthSamplingMode;\r\n const focalLength = this._frameGraphTask.depthOfField.focalLength;\r\n const fStop = this._frameGraphTask.depthOfField.fStop;\r\n const focusDistance = this._frameGraphTask.depthOfField.focusDistance;\r\n const lensSize = this._frameGraphTask.depthOfField.lensSize;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.depthSamplingMode = depthSamplingMode;\r\n this._frameGraphTask.depthOfField.focalLength = focalLength;\r\n this._frameGraphTask.depthOfField.fStop = fStop;\r\n this._frameGraphTask.depthOfField.focusDistance = focusDistance;\r\n this._frameGraphTask.depthOfField.lensSize = lensSize;\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Blur level\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ThinDepthOfFieldEffectBlurLevel.Low },\r\n { label: \"Medium\", value: ThinDepthOfFieldEffectBlurLevel.Medium },\r\n { label: \"High\", value: ThinDepthOfFieldEffectBlurLevel.High },\r\n ],\r\n })\r\n public get blurLevel(): ThinDepthOfFieldEffectBlurLevel {\r\n return this._frameGraphTask.depthOfField.blurLevel;\r\n }\r\n\r\n public set blurLevel(value: ThinDepthOfFieldEffectBlurLevel) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.depthOfField.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.depthOfField.focalLength = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.depthOfField.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.depthOfField.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.depthOfField.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.depthOfField.focusDistance = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.depthOfField.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.depthOfField.lensSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphDepthOfFieldPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n const sourceConnectedPoint = this.source.connectedPoint;\r\n if (sourceConnectedPoint) {\r\n this._frameGraphTask.sourceTexture = sourceConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const geomViewDepthConnectedPoint = this.geomViewDepth.connectedPoint;\r\n if (geomViewDepthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = geomViewDepthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock\", NodeRenderGraphDepthOfFieldPostProcessBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"depthOfFieldPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/depthOfFieldPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F;;GAEG;AACH,MAAM,OAAO,2CAA4C,SAAQ,oBAAoB;IAGjF;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;OAOG;IACH,YAAmB,IAAY,EAAE,UAAsB,EAAE,KAAY,EAAE,uDAAgF,EAAE,GAAG,GAAG,KAAK;QAChK,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,K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CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph, Camera } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphDepthOfFieldTask } from \"../../../Tasks/PostProcesses/depthOfFieldTask\";\r\nimport { ThinDepthOfFieldEffectBlurLevel } from \"core/PostProcesses/thinDepthOfFieldEffect\";\r\n\r\n/**\r\n * Block that implements the depth of field post process\r\n */\r\nexport class NodeRenderGraphDepthOfFieldPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphDepthOfFieldTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphDepthOfFieldPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param blurLevel The quality of the depth of field effect (default: ThinDepthOfFieldEffectBlurLevel.Low)\r\n * @param hdr If high dynamic range textures should be used (default: false)\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, blurLevel: ThinDepthOfFieldEffectBlurLevel = ThinDepthOfFieldEffectBlurLevel.Low, hdr = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"geomViewDepth\", NodeRenderGraphBlockConnectionPointTypes.TextureViewDepth);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, frameGraph, scene.getEngine(), blurLevel, hdr);\r\n }\r\n\r\n private _createTask(blurLevel: ThinDepthOfFieldEffectBlurLevel, hdr: boolean) {\r\n const sourceSamplingMode = this._frameGraphTask.sourceSamplingMode;\r\n const depthSamplingMode = this._frameGraphTask.depthSamplingMode;\r\n const focalLength = this._frameGraphTask.depthOfField.focalLength;\r\n const fStop = this._frameGraphTask.depthOfField.fStop;\r\n const focusDistance = this._frameGraphTask.depthOfField.focusDistance;\r\n const lensSize = this._frameGraphTask.depthOfField.lensSize;\r\n\r\n this._frameGraphTask.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphDepthOfFieldTask(this.name, this._frameGraph, this._scene.getEngine(), blurLevel, hdr);\r\n this._frameGraphTask.sourceSamplingMode = sourceSamplingMode;\r\n this._frameGraphTask.depthSamplingMode = depthSamplingMode;\r\n this._frameGraphTask.depthOfField.focalLength = focalLength;\r\n this._frameGraphTask.depthOfField.fStop = fStop;\r\n this._frameGraphTask.depthOfField.focusDistance = focusDistance;\r\n this._frameGraphTask.depthOfField.lensSize = lensSize;\r\n\r\n this._additionalConstructionParameters = [blurLevel, hdr];\r\n }\r\n\r\n /** The quality of the blur effect */\r\n @editableInPropertyPage(\"Blur level\", PropertyTypeForEdition.List, \"PROPERTIES\", {\r\n options: [\r\n { label: \"Low\", value: ThinDepthOfFieldEffectBlurLevel.Low },\r\n { label: \"Medium\", value: ThinDepthOfFieldEffectBlurLevel.Medium },\r\n { label: \"High\", value: ThinDepthOfFieldEffectBlurLevel.High },\r\n ],\r\n })\r\n public get blurLevel(): ThinDepthOfFieldEffectBlurLevel {\r\n return this._frameGraphTask.depthOfField.blurLevel;\r\n }\r\n\r\n public set blurLevel(value: ThinDepthOfFieldEffectBlurLevel) {\r\n this._createTask(value, this._frameGraphTask.hdr);\r\n }\r\n\r\n /** If high dynamic range textures should be used */\r\n @editableInPropertyPage(\"HDR\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get hdr(): boolean {\r\n return this._frameGraphTask.hdr;\r\n }\r\n\r\n public set hdr(value: boolean) {\r\n this._createTask(this._frameGraphTask.depthOfField.blurLevel, value);\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** Sampling mode used to sample from the depth texture */\r\n @editableInPropertyPage(\"Depth sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get depthSamplingMode() {\r\n return this._frameGraphTask.depthSamplingMode;\r\n }\r\n\r\n public set depthSamplingMode(value: number) {\r\n this._frameGraphTask.depthSamplingMode = value;\r\n }\r\n\r\n /** The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focal length\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focalLength(): number {\r\n return this._frameGraphTask.depthOfField.focalLength;\r\n }\r\n\r\n public set focalLength(value: number) {\r\n this._frameGraphTask.depthOfField.focalLength = value;\r\n }\r\n\r\n /** F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"F-Stop\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get fStop(): number {\r\n return this._frameGraphTask.depthOfField.fStop;\r\n }\r\n\r\n public set fStop(value: number) {\r\n this._frameGraphTask.depthOfField.fStop = value;\r\n }\r\n\r\n /** Distance away from the camera to focus on in scene units/1000 (eg. millimeter). */\r\n @editableInPropertyPage(\"Focus distance\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get focusDistance(): number {\r\n return this._frameGraphTask.depthOfField.focusDistance;\r\n }\r\n\r\n public set focusDistance(value: number) {\r\n this._frameGraphTask.depthOfField.focusDistance = value;\r\n }\r\n\r\n /** Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. The diameter of the resulting aperture can be computed by lensSize/fStop. */\r\n @editableInPropertyPage(\"Lens size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get lensSize(): number {\r\n return this._frameGraphTask.depthOfField.lensSize;\r\n }\r\n\r\n public set lensSize(value: number) {\r\n this._frameGraphTask.depthOfField.lensSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphDepthOfFieldPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the geometry view depth input component\r\n */\r\n public get geomViewDepth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.geomViewDepth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.lensSize = ${this.lensSize};`);\r\n codes.push(`${this._codeVariableName}.fStop = ${this.fStop};`);\r\n codes.push(`${this._codeVariableName}.focusDistance = ${this.focusDistance};`);\r\n codes.push(`${this._codeVariableName}.focalLength = ${this.focalLength};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n codes.push(`${this._codeVariableName}.depthSamplingMode = ${this.depthSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.lensSize = this.lensSize;\r\n serializationObject.fStop = this.fStop;\r\n serializationObject.focusDistance = this.focusDistance;\r\n serializationObject.focalLength = this.focalLength;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n serializationObject.depthSamplingMode = this.depthSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.lensSize = serializationObject.lensSize;\r\n this.fStop = serializationObject.fStop;\r\n this.focusDistance = serializationObject.focusDistance;\r\n this.focalLength = serializationObject.focalLength;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n this.depthSamplingMode = serializationObject.depthSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphDepthOfFieldPostProcessBlock\", NodeRenderGraphDepthOfFieldPostProcessBlock);\r\n"]}
|
|
@@ -25,6 +25,7 @@ export class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRender
|
|
|
25
25
|
super(name, frameGraph, scene);
|
|
26
26
|
this.registerInput("source", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
27
27
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
28
|
+
this._addDependenciesInput();
|
|
28
29
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
29
30
|
this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
30
31
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);
|
|
@@ -74,16 +75,9 @@ export class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRender
|
|
|
74
75
|
}
|
|
75
76
|
_buildBlock(state) {
|
|
76
77
|
super._buildBlock(state);
|
|
77
|
-
this._frameGraphTask.name = this.name;
|
|
78
78
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this._frameGraphTask.sourceTexture = sourceConnectedPoint.value;
|
|
82
|
-
}
|
|
83
|
-
const destinationConnectedPoint = this.destination.connectedPoint;
|
|
84
|
-
if (destinationConnectedPoint) {
|
|
85
|
-
this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;
|
|
86
|
-
}
|
|
79
|
+
this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value;
|
|
80
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
87
81
|
}
|
|
88
82
|
_dumpPropertiesCode() {
|
|
89
83
|
const codes = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractHighlightsPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.ts"],"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UAAU,EAAE,IAAI,gCAAgC,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACrJ,CAAC;IAED,2DAA2D;IAE3D,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;IACnD,CAAC;IAED,IAAW,kBAAkB,CAAC,KAAa;QACvC,IAAI,CAAC,eAAe,CAAC,kBAAkB,GAAG,KAAK,CAAC;IACpD,CAAC;IAED,6EAA6E;IAE7E,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC;IACtD,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QAC9B,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,GAAG,KAAK,CAAC;IACvD,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,kDAAkD,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEkB,WAAW,CAAC,KAAgC;QAC3D,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"extractHighlightsPostProcessBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/PostProcesses/extractHighlightsPostProcessBlock.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,E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B,gBAAgB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACvE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,yBAAyB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC;QACzF,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/C,mBAAmB,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;QACjE,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,kBAAkB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC;IACrE,CAAC;CACJ;AA3EG;IADC,sBAAsB,CAAC,sBAAsB,+CAAuC,YAAY,CAAC;0FAGjG;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;iFAGnG;AAiEL,aAAa,CAAC,0DAA0D,EAAE,gDAAgD,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraphTextureHandle, FrameGraph } from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphExtractHighlightsTask } from \"core/FrameGraph/Tasks/PostProcesses/extractHighlightsTask\";\r\nimport { ThinExtractHighlightsPostProcess } from \"core/PostProcesses/thinExtractHighlightsPostProcess\";\r\n\r\n/**\r\n * Block that implements the extract highlights post process\r\n */\r\nexport class NodeRenderGraphExtractHighlightsPostProcessBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphExtractHighlightsTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new ExtractHighlightsPostProcessBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"source\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this._addDependenciesInput();\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.source.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\r\n this.output._typeConnectionSource = () => {\r\n return this.destination.isConnected ? this.destination : this.source;\r\n };\r\n\r\n this._frameGraphTask = new FrameGraphExtractHighlightsTask(this.name, frameGraph, new ThinExtractHighlightsPostProcess(name, scene.getEngine()));\r\n }\r\n\r\n /** Sampling mode used to sample from the source texture */\r\n @editableInPropertyPage(\"Source sampling mode\", PropertyTypeForEdition.SamplingMode, \"PROPERTIES\")\r\n public get sourceSamplingMode() {\r\n return this._frameGraphTask.sourceSamplingMode;\r\n }\r\n\r\n public set sourceSamplingMode(value: number) {\r\n this._frameGraphTask.sourceSamplingMode = value;\r\n }\r\n\r\n /** The luminance threshold, pixels below this value will be set to black. */\r\n @editableInPropertyPage(\"Threshold\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 1 })\r\n public get threshold(): number {\r\n return this._frameGraphTask.postProcess.threshold;\r\n }\r\n\r\n public set threshold(value: number) {\r\n this._frameGraphTask.postProcess.threshold = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphExtractHighlightsPostProcessBlock\";\r\n }\r\n\r\n /**\r\n * Gets the source input component\r\n */\r\n public get source(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the destination input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this._frameGraphTask.sourceTexture = this.source.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.threshold = ${this.threshold};`);\r\n codes.push(`${this._codeVariableName}.sourceSamplingMode = ${this.sourceSamplingMode};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.threshold = this.threshold;\r\n serializationObject.sourceSamplingMode = this.sourceSamplingMode;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.threshold = serializationObject.threshold;\r\n this.sourceSamplingMode = serializationObject.sourceSamplingMode;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphExtractHighlightsPostProcessBlock\", NodeRenderGraphExtractHighlightsPostProcessBlock);\r\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphObjectRendererTask } from "../../../../index.js";
|
|
2
2
|
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
import { NodeRenderGraphConnectionPoint } from "../../nodeRenderGraphBlockConnectionPoint";
|
|
3
4
|
/**
|
|
4
5
|
* @internal
|
|
5
6
|
*/
|
|
@@ -47,6 +48,10 @@ export declare class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGr
|
|
|
47
48
|
* Gets the dependencies input component
|
|
48
49
|
*/
|
|
49
50
|
get dependencies(): NodeRenderGraphConnectionPoint;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the shadowGenerators input component
|
|
53
|
+
*/
|
|
54
|
+
get shadowGenerators(): NodeRenderGraphConnectionPoint;
|
|
50
55
|
/**
|
|
51
56
|
* Gets the output component
|
|
52
57
|
*/
|
|
@@ -2,6 +2,7 @@ import { __decorate } from "../../../../tslib.es6.js";
|
|
|
2
2
|
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
3
|
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
4
4
|
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
5
|
+
import { NodeRenderGraphConnectionPoint } from "../../nodeRenderGraphBlockConnectionPoint.js";
|
|
5
6
|
/**
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
@@ -24,12 +25,13 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
24
25
|
this.registerInput("depth", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);
|
|
25
26
|
this.registerInput("camera", NodeRenderGraphBlockConnectionPointTypes.Camera);
|
|
26
27
|
this.registerInput("objects", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
|
|
27
|
-
this.
|
|
28
|
+
this._addDependenciesInput();
|
|
29
|
+
this.registerInput("shadowGenerators", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);
|
|
28
30
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
29
31
|
this.registerOutput("outputDepth", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
30
32
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
|
|
31
33
|
this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);
|
|
32
|
-
this.
|
|
34
|
+
this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);
|
|
33
35
|
this.output._typeConnectionSource = this.destination;
|
|
34
36
|
this.outputDepth._typeConnectionSource = this.depth;
|
|
35
37
|
}
|
|
@@ -84,6 +86,12 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
84
86
|
get dependencies() {
|
|
85
87
|
return this._inputs[4];
|
|
86
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Gets the shadowGenerators input component
|
|
91
|
+
*/
|
|
92
|
+
get shadowGenerators() {
|
|
93
|
+
return this._inputs[5];
|
|
94
|
+
}
|
|
87
95
|
/**
|
|
88
96
|
* Gets the output component
|
|
89
97
|
*/
|
|
@@ -98,29 +106,41 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
98
106
|
}
|
|
99
107
|
_buildBlock(state) {
|
|
100
108
|
super._buildBlock(state);
|
|
101
|
-
this._frameGraphTask.name = this.name;
|
|
102
109
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
103
110
|
this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the "outputDepth" texture of the task
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const depthConnectedPoint = this.depth.connectedPoint;
|
|
109
|
-
if (depthConnectedPoint) {
|
|
110
|
-
this._frameGraphTask.depthTexture = depthConnectedPoint.value;
|
|
111
|
-
}
|
|
112
|
-
const cameraConnectedPoint = this.camera.connectedPoint;
|
|
113
|
-
if (cameraConnectedPoint) {
|
|
114
|
-
this._frameGraphTask.camera = cameraConnectedPoint.value;
|
|
115
|
-
}
|
|
116
|
-
const objectsConnectedPoint = this.objects.connectedPoint;
|
|
117
|
-
if (objectsConnectedPoint) {
|
|
118
|
-
this._frameGraphTask.objectList = objectsConnectedPoint.value;
|
|
119
|
-
}
|
|
111
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
112
|
+
this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value;
|
|
113
|
+
this._frameGraphTask.camera = this.camera.connectedPoint?.value;
|
|
114
|
+
this._frameGraphTask.objectList = this.objects.connectedPoint?.value;
|
|
120
115
|
this._frameGraphTask.dependencies = [];
|
|
121
116
|
const dependenciesConnectedPoint = this.dependencies.connectedPoint;
|
|
122
117
|
if (dependenciesConnectedPoint) {
|
|
123
|
-
|
|
118
|
+
if (dependenciesConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {
|
|
119
|
+
const container = dependenciesConnectedPoint.ownerBlock;
|
|
120
|
+
container.inputs.forEach((input) => {
|
|
121
|
+
if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsTextureHandle(input.connectedPoint.value)) {
|
|
122
|
+
this._frameGraphTask.dependencies.push(input.connectedPoint.value);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
else if (NodeRenderGraphConnectionPoint.IsTextureHandle(dependenciesConnectedPoint.value)) {
|
|
127
|
+
this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
this._frameGraphTask.shadowGenerators = [];
|
|
131
|
+
const shadowGeneratorsConnectedPoint = this.shadowGenerators.connectedPoint;
|
|
132
|
+
if (shadowGeneratorsConnectedPoint) {
|
|
133
|
+
if (shadowGeneratorsConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {
|
|
134
|
+
const container = shadowGeneratorsConnectedPoint.ownerBlock;
|
|
135
|
+
container.inputs.forEach((input) => {
|
|
136
|
+
if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsShadowGenerator(input.connectedPoint.value)) {
|
|
137
|
+
this._frameGraphTask.shadowGenerators.push(input.connectedPoint.value);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else if (NodeRenderGraphConnectionPoint.IsShadowGenerator(shadowGeneratorsConnectedPoint.value)) {
|
|
142
|
+
this._frameGraphTask.shadowGenerators[0] = shadowGeneratorsConnectedPoint.value;
|
|
143
|
+
}
|
|
124
144
|
}
|
|
125
145
|
}
|
|
126
146
|
_dumpPropertiesCode() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseObjectRendererBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.ts"],"names":[],"mappings":";AAWA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,sCAAuC,SAAQ,oBAAoB;IAG5E;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAA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,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACzE,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/C,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;IACrD,CAAC;CACJ;AAnIG;IADC,sBAAsB,CAAC,YAAY,0CAAkC,YAAY,CAAC;uEAGlF;AAQD;IADC,sBAAsB,CAAC,aAAa,0CAAkC,YAAY,CAAC;wEAGnF","sourcesContent":["import type {\r\n NodeRenderGraphConnectionPoint,\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n FrameGraphObjectRendererTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphObjectRendererTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBaseObjectRendererBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this.registerInput(\"dependencies\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n this.dependencies.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n this.outputDepth._typeConnectionSource = this.depth;\r\n }\r\n\r\n /** Indicates if depth testing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth test\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthTest() {\r\n return this._frameGraphTask.depthTest;\r\n }\r\n\r\n public set depthTest(value: boolean) {\r\n this._frameGraphTask.depthTest = value;\r\n }\r\n\r\n /** Indicates if depth writing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth write\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthWrite() {\r\n return this._frameGraphTask.depthWrite;\r\n }\r\n\r\n public set depthWrite(value: boolean) {\r\n this._frameGraphTask.depthWrite = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBaseObjectRendererBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output depth component\r\n */\r\n public get outputDepth(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this._frameGraphTask.name = this.name;\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\r\n\r\n const destinationConnectedPoint = this.destination.connectedPoint;\r\n if (destinationConnectedPoint) {\r\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const depthConnectedPoint = this.depth.connectedPoint;\r\n if (depthConnectedPoint) {\r\n this._frameGraphTask.depthTexture = depthConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n\r\n const cameraConnectedPoint = this.camera.connectedPoint;\r\n if (cameraConnectedPoint) {\r\n this._frameGraphTask.camera = cameraConnectedPoint.value as Camera;\r\n }\r\n\r\n const objectsConnectedPoint = this.objects.connectedPoint;\r\n if (objectsConnectedPoint) {\r\n this._frameGraphTask.objectList = objectsConnectedPoint.value as FrameGraphObjectList;\r\n }\r\n\r\n this._frameGraphTask.dependencies = [];\r\n\r\n const dependenciesConnectedPoint = this.dependencies.connectedPoint;\r\n if (dependenciesConnectedPoint) {\r\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\r\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.depthTest = this.depthTest;\r\n serializationObject.depthWrite = this.depthWrite;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthTest = serializationObject.depthTest;\r\n this.depthWrite = serializationObject.depthWrite;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"baseObjectRendererBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,wCAAwC,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CA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AAgB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACvE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,iBAAiB,iBAAiB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACzE,OAAO,KAAK,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC9C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/C,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,mBAAmB,CAAC,UAAU,CAAC;IACrD,CAAC;CACJ;AAlJG;IADC,sBAAsB,CAAC,YAAY,0CAAkC,YAAY,CAAC;uEAGlF;AAQD;IADC,sBAAsB,CAAC,aAAa,0CAAkC,YAAY,CAAC;wEAGnF","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n FrameGraphObjectRendererTask,\r\n NodeRenderGraphResourceContainerBlock,\r\n FrameGraphShadowGeneratorTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { NodeRenderGraphConnectionPoint } from \"../../nodeRenderGraphBlockConnectionPoint\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphObjectRendererTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphBaseObjectRendererBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene) {\r\n super(name, frameGraph, scene);\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this._addDependenciesInput();\r\n this.registerInput(\"shadowGenerators\", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n this.outputDepth._typeConnectionSource = this.depth;\r\n }\r\n\r\n /** Indicates if depth testing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth test\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthTest() {\r\n return this._frameGraphTask.depthTest;\r\n }\r\n\r\n public set depthTest(value: boolean) {\r\n this._frameGraphTask.depthTest = value;\r\n }\r\n\r\n /** Indicates if depth writing must be enabled or disabled */\r\n @editableInPropertyPage(\"Depth write\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get depthWrite() {\r\n return this._frameGraphTask.depthWrite;\r\n }\r\n\r\n public set depthWrite(value: boolean) {\r\n this._frameGraphTask.depthWrite = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphBaseObjectRendererBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get depth(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the shadowGenerators input component\r\n */\r\n public get shadowGenerators(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[5];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output depth component\r\n */\r\n public get outputDepth(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\r\n\r\n this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\r\n\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n this._frameGraphTask.objectList = this.objects.connectedPoint?.value as FrameGraphObjectList;\r\n\r\n this._frameGraphTask.dependencies = [];\r\n\r\n const dependenciesConnectedPoint = this.dependencies.connectedPoint;\r\n if (dependenciesConnectedPoint) {\r\n if (dependenciesConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = dependenciesConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n container.inputs.forEach((input) => {\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsTextureHandle(input.connectedPoint.value)) {\r\n this._frameGraphTask.dependencies!.push(input.connectedPoint.value as FrameGraphTextureHandle);\r\n }\r\n });\r\n } else if (NodeRenderGraphConnectionPoint.IsTextureHandle(dependenciesConnectedPoint.value)) {\r\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value as FrameGraphTextureHandle;\r\n }\r\n }\r\n\r\n this._frameGraphTask.shadowGenerators = [];\r\n\r\n const shadowGeneratorsConnectedPoint = this.shadowGenerators.connectedPoint;\r\n if (shadowGeneratorsConnectedPoint) {\r\n if (shadowGeneratorsConnectedPoint.type === NodeRenderGraphBlockConnectionPointTypes.ResourceContainer) {\r\n const container = shadowGeneratorsConnectedPoint.ownerBlock as NodeRenderGraphResourceContainerBlock;\r\n container.inputs.forEach((input) => {\r\n if (input.connectedPoint && input.connectedPoint.value !== undefined && NodeRenderGraphConnectionPoint.IsShadowGenerator(input.connectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators!.push(input.connectedPoint.value as FrameGraphShadowGeneratorTask);\r\n }\r\n });\r\n } else if (NodeRenderGraphConnectionPoint.IsShadowGenerator(shadowGeneratorsConnectedPoint.value)) {\r\n this._frameGraphTask.shadowGenerators[0] = shadowGeneratorsConnectedPoint.value as FrameGraphShadowGeneratorTask;\r\n }\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\r\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.depthTest = this.depthTest;\r\n serializationObject.depthWrite = this.depthWrite;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.depthTest = serializationObject.depthTest;\r\n this.depthWrite = serializationObject.depthWrite;\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { NodeRenderGraphConnectionPoint, Scene, NodeRenderGraphBuildState, FrameGraph, FrameGraphShadowGeneratorTask } from "../../../../index.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class NodeRenderGraphBaseShadowGeneratorBlock extends NodeRenderGraphBlock {
|
|
7
|
+
protected _frameGraphTask: FrameGraphShadowGeneratorTask;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the frame graph task associated with this block
|
|
10
|
+
*/
|
|
11
|
+
get task(): FrameGraphShadowGeneratorTask;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new NodeRenderGraphBaseShadowGeneratorBlock
|
|
14
|
+
* @param name defines the block name
|
|
15
|
+
* @param frameGraph defines the hosting frame graph
|
|
16
|
+
* @param scene defines the hosting scene
|
|
17
|
+
*/
|
|
18
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene);
|
|
19
|
+
/** Sets the size of the shadow texture */
|
|
20
|
+
get mapSize(): number;
|
|
21
|
+
set mapSize(value: number);
|
|
22
|
+
/** Sets the texture type to float (by default, half float is used if supported) */
|
|
23
|
+
get useFloat32TextureType(): boolean;
|
|
24
|
+
set useFloat32TextureType(value: boolean);
|
|
25
|
+
/** Sets the texture type to Red */
|
|
26
|
+
get useRedTextureFormat(): boolean;
|
|
27
|
+
set useRedTextureFormat(value: boolean);
|
|
28
|
+
/** Sets the bias */
|
|
29
|
+
get bias(): number;
|
|
30
|
+
set bias(value: number);
|
|
31
|
+
/** Sets the normal bias */
|
|
32
|
+
get normalBias(): number;
|
|
33
|
+
set normalBias(value: number);
|
|
34
|
+
/** Sets the darkness of the shadows */
|
|
35
|
+
get darkness(): number;
|
|
36
|
+
set darkness(value: number);
|
|
37
|
+
/** Sets the filter method */
|
|
38
|
+
get filter(): number;
|
|
39
|
+
set filter(value: number);
|
|
40
|
+
/** Sets the filter quality (for PCF and PCSS) */
|
|
41
|
+
get filteringQuality(): number;
|
|
42
|
+
set filteringQuality(value: number);
|
|
43
|
+
/** Gets or sets the ability to have transparent shadow */
|
|
44
|
+
get transparencyShadow(): boolean;
|
|
45
|
+
set transparencyShadow(value: boolean);
|
|
46
|
+
/** Enables or disables shadows with varying strength based on the transparency */
|
|
47
|
+
get enableSoftTransparentShadow(): boolean;
|
|
48
|
+
set enableSoftTransparentShadow(value: boolean);
|
|
49
|
+
/** If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one */
|
|
50
|
+
get useOpacityTextureForTransparentShadow(): boolean;
|
|
51
|
+
set useOpacityTextureForTransparentShadow(value: boolean);
|
|
52
|
+
/**
|
|
53
|
+
* Gets the current class name
|
|
54
|
+
* @returns the class name
|
|
55
|
+
*/
|
|
56
|
+
getClassName(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Gets the light input component
|
|
59
|
+
*/
|
|
60
|
+
get light(): NodeRenderGraphConnectionPoint;
|
|
61
|
+
/**
|
|
62
|
+
* Gets the objects input component
|
|
63
|
+
*/
|
|
64
|
+
get objects(): NodeRenderGraphConnectionPoint;
|
|
65
|
+
/**
|
|
66
|
+
* Gets the shadow generator component
|
|
67
|
+
*/
|
|
68
|
+
get generator(): NodeRenderGraphConnectionPoint;
|
|
69
|
+
/**
|
|
70
|
+
* Gets the output texture component
|
|
71
|
+
*/
|
|
72
|
+
get output(): NodeRenderGraphConnectionPoint;
|
|
73
|
+
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
74
|
+
protected _dumpPropertiesCode(): string;
|
|
75
|
+
serialize(): any;
|
|
76
|
+
_deserialize(serializationObject: any): void;
|
|
77
|
+
}
|