1 |
- {"ast":null,"code":"import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\n/**\n * @internal\n */\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\n /**\n * Gets the frame graph task associated with this block\n */\n get task() {\n return this._frameGraphTask;\n }\n /**\n * Create a new NodeRenderGraphBaseObjectRendererBlock\n * @param name defines the block name\n * @param frameGraph defines the hosting frame graph\n * @param scene defines the hosting scene\n */\n constructor(name, frameGraph, scene) {\n super(name, frameGraph, scene);\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\n this.registerInput(\"dependencies\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\n this.dependencies.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\n this.output._typeConnectionSource = this.destination;\n this.outputDepth._typeConnectionSource = this.depth;\n }\n /** Indicates if depth testing must be enabled or disabled */\n get depthTest() {\n return this._frameGraphTask.depthTest;\n }\n set depthTest(value) {\n this._frameGraphTask.depthTest = value;\n }\n /** Indicates if depth writing must be enabled or disabled */\n get depthWrite() {\n return this._frameGraphTask.depthWrite;\n }\n set depthWrite(value) {\n this._frameGraphTask.depthWrite = value;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphBaseObjectRendererBlock\";\n }\n /**\n * Gets the destination texture input component\n */\n get destination() {\n return this._inputs[0];\n }\n /**\n * Gets the depth texture input component\n */\n get depth() {\n return this._inputs[1];\n }\n /**\n * Gets the camera input component\n */\n get camera() {\n return this._inputs[2];\n }\n /**\n * Gets the objects input component\n */\n get objects() {\n return this._inputs[3];\n }\n /**\n * Gets the dependencies input component\n */\n get dependencies() {\n return this._inputs[4];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n /**\n * Gets the output depth component\n */\n get outputDepth() {\n return this._outputs[1];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this._frameGraphTask.name = this.name;\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\n this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\n const destinationConnectedPoint = this.destination.connectedPoint;\n if (destinationConnectedPoint) {\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;\n }\n const depthConnectedPoint = this.depth.connectedPoint;\n if (depthConnectedPoint) {\n this._frameGraphTask.depthTexture = depthConnectedPoint.value;\n }\n const cameraConnectedPoint = this.camera.connectedPoint;\n if (cameraConnectedPoint) {\n this._frameGraphTask.camera = cameraConnectedPoint.value;\n }\n const objectsConnectedPoint = this.objects.connectedPoint;\n if (objectsConnectedPoint) {\n this._frameGraphTask.objectList = objectsConnectedPoint.value;\n }\n this._frameGraphTask.dependencies = [];\n const dependenciesConnectedPoint = this.dependencies.connectedPoint;\n if (dependenciesConnectedPoint) {\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value;\n }\n }\n _dumpPropertiesCode() {\n const codes = [];\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\n }\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.depthTest = this.depthTest;\n serializationObject.depthWrite = this.depthWrite;\n return serializationObject;\n }\n _deserialize(serializationObject) {\n super._deserialize(serializationObject);\n this.depthTest = serializationObject.depthTest;\n this.depthWrite = serializationObject.depthWrite;\n }\n}\n__decorate([editableInPropertyPage(\"Depth test\", 0 /* PropertyTypeForEdition.Boolean */, \"PROPERTIES\")], NodeRenderGraphBaseObjectRendererBlock.prototype, \"depthTest\", null);\n__decorate([editableInPropertyPage(\"Depth write\", 0 /* PropertyTypeForEdition.Boolean */, \"PROPERTIES\")], NodeRenderGraphBaseObjectRendererBlock.prototype, \"depthWrite\", null);","map":{"version":3,"names":["__decorate","NodeRenderGraphBlock","NodeRenderGraphBlockConnectionPointTypes","editableInPropertyPage","NodeRenderGraphBaseObjectRendererBlock","task","_frameGraphTask","constructor","name","frameGraph","scene","registerInput","Texture","TextureBackBufferDepthStencilAttachment","Camera","ObjectList","registerOutput","BasedOnInput","destination","addAcceptedConnectionPointTypes","TextureAllButBackBufferDepthStencil","depth","TextureDepthStencilAttachment","dependencies","TextureAllButBackBuffer","output","_typeConnectionSource","outputDepth","depthTest","value","depthWrite","getClassName","_inputs","camera","objects","_outputs","_buildBlock","state","outputTexture","outputDepthTexture","destinationConnectedPoint","connectedPoint","destinationTexture","depthConnectedPoint","depthTexture","cameraConnectedPoint","objectsConnectedPoint","objectList","dependenciesConnectedPoint","_dumpPropertiesCode","codes","push","_codeVariableName","join","serialize","serializationObject","_deserialize","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js"],"sourcesContent":["import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\n/**\n * @internal\n */\nexport class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock {\n /**\n * Gets the frame graph task associated with this block\n */\n get task() {\n return this._frameGraphTask;\n }\n /**\n * Create a new NodeRenderGraphBaseObjectRendererBlock\n * @param name defines the block name\n * @param frameGraph defines the hosting frame graph\n * @param scene defines the hosting scene\n */\n constructor(name, frameGraph, scene) {\n super(name, frameGraph, scene);\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\n this.registerInput(\"dependencies\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\n this.dependencies.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\n this.output._typeConnectionSource = this.destination;\n this.outputDepth._typeConnectionSource = this.depth;\n }\n /** Indicates if depth testing must be enabled or disabled */\n get depthTest() {\n return this._frameGraphTask.depthTest;\n }\n set depthTest(value) {\n this._frameGraphTask.depthTest = value;\n }\n /** Indicates if depth writing must be enabled or disabled */\n get depthWrite() {\n return this._frameGraphTask.depthWrite;\n }\n set depthWrite(value) {\n this._frameGraphTask.depthWrite = value;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphBaseObjectRendererBlock\";\n }\n /**\n * Gets the destination texture input component\n */\n get destination() {\n return this._inputs[0];\n }\n /**\n * Gets the depth texture input component\n */\n get depth() {\n return this._inputs[1];\n }\n /**\n * Gets the camera input component\n */\n get camera() {\n return this._inputs[2];\n }\n /**\n * Gets the objects input component\n */\n get objects() {\n return this._inputs[3];\n }\n /**\n * Gets the dependencies input component\n */\n get dependencies() {\n return this._inputs[4];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n /**\n * Gets the output depth component\n */\n get outputDepth() {\n return this._outputs[1];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n this._frameGraphTask.name = this.name;\n this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the \"output\" texture of the task\n this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the \"outputDepth\" texture of the task\n const destinationConnectedPoint = this.destination.connectedPoint;\n if (destinationConnectedPoint) {\n this._frameGraphTask.destinationTexture = destinationConnectedPoint.value;\n }\n const depthConnectedPoint = this.depth.connectedPoint;\n if (depthConnectedPoint) {\n this._frameGraphTask.depthTexture = depthConnectedPoint.value;\n }\n const cameraConnectedPoint = this.camera.connectedPoint;\n if (cameraConnectedPoint) {\n this._frameGraphTask.camera = cameraConnectedPoint.value;\n }\n const objectsConnectedPoint = this.objects.connectedPoint;\n if (objectsConnectedPoint) {\n this._frameGraphTask.objectList = objectsConnectedPoint.value;\n }\n this._frameGraphTask.dependencies = [];\n const dependenciesConnectedPoint = this.dependencies.connectedPoint;\n if (dependenciesConnectedPoint) {\n this._frameGraphTask.dependencies[0] = dependenciesConnectedPoint.value;\n }\n }\n _dumpPropertiesCode() {\n const codes = [];\n codes.push(`${this._codeVariableName}.depthTest = ${this.depthTest};`);\n codes.push(`${this._codeVariableName}.depthWrite = ${this.depthWrite};`);\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\n }\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.depthTest = this.depthTest;\n serializationObject.depthWrite = this.depthWrite;\n return serializationObject;\n }\n _deserialize(serializationObject) {\n super._deserialize(serializationObject);\n this.depthTest = serializationObject.depthTest;\n this.depthWrite = serializationObject.depthWrite;\n }\n}\n__decorate([\n editableInPropertyPage(\"Depth test\", 0 /* PropertyTypeForEdition.Boolean */, \"PROPERTIES\")\n], NodeRenderGraphBaseObjectRendererBlock.prototype, \"depthTest\", null);\n__decorate([\n editableInPropertyPage(\"Depth write\", 0 /* PropertyTypeForEdition.Boolean */, \"PROPERTIES\")\n], NodeRenderGraphBaseObjectRendererBlock.prototype, \"depthWrite\", null);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,wCAAwC,QAAQ,qCAAqC;AAC9F,SAASC,sBAAsB,QAAQ,yCAAyC;AAChF;AACA;AACA;AACA,OAAO,MAAMC,sCAAsC,SAASH,oBAAoB,CAAC;EAC7E;AACJ;AACA;EACI,IAAII,IAAIA,CAAA,EAAG;IACP,OAAO,IAAI,CAACC,eAAe;EAC/B;EACA;AACJ;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAE;IACjC,KAAK,CAACF,IAAI,EAAEC,UAAU,EAAEC,KAAK,CAAC;IAC9B,IAAI,CAACC,aAAa,CAAC,aAAa,EAAET,wCAAwC,CAACU,OAAO,CAAC;IACnF,IAAI,CAACD,aAAa,CAAC,OAAO,EAAET,wCAAwC,CAACW,uCAAuC,EAAE,IAAI,CAAC;IACnH,IAAI,CAACF,aAAa,CAAC,QAAQ,EAAET,wCAAwC,CAACY,MAAM,CAAC;IAC7E,IAAI,CAACH,aAAa,CAAC,SAAS,EAAET,wCAAwC,CAACa,UAAU,CAAC;IAClF,IAAI,CAACJ,aAAa,CAAC,cAAc,EAAET,wCAAwC,CAACU,OAAO,E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