1 |
- {"ast":null,"code":"import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes.js\";\nimport { Color4 } from \"../../../../Maths/math.color.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\nimport { FrameGraphClearTextureTask } from \"../../../Tasks/Texture/clearTextureTask.js\";\n/**\n * Block used to clear a texture\n */\nexport class NodeRenderGraphClearBlock 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 NodeRenderGraphClearBlock\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(\"texture\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.texture.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\n this.output._typeConnectionSource = this.texture;\n this.outputDepth._typeConnectionSource = this.depth;\n this._frameGraphTask = new FrameGraphClearTextureTask(name, frameGraph);\n }\n /** Gets or sets the clear color */\n get color() {\n return this._frameGraphTask.color;\n }\n set color(value) {\n this._frameGraphTask.color = value;\n }\n /** Gets or sets a boolean indicating whether the color part of the texture should be cleared. */\n get clearColor() {\n return !!this._frameGraphTask.clearColor;\n }\n set clearColor(value) {\n this._frameGraphTask.clearColor = value;\n }\n /** Gets or sets a boolean indicating whether the depth part of the texture should be cleared. */\n get clearDepth() {\n return !!this._frameGraphTask.clearDepth;\n }\n set clearDepth(value) {\n this._frameGraphTask.clearDepth = value;\n }\n /** Gets or sets a boolean indicating whether the stencil part of the texture should be cleared. */\n get clearStencil() {\n return !!this._frameGraphTask.clearStencil;\n }\n set clearStencil(value) {\n this._frameGraphTask.clearStencil = value;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphClearBlock\";\n }\n /**\n * Gets the texture input component\n */\n get texture() {\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 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._propagateInputValueToOutput(this.texture, this.output);\n this._propagateInputValueToOutput(this.depth, this.outputDepth);\n const textureConnectedPoint = this.texture.connectedPoint;\n if (textureConnectedPoint) {\n this._frameGraphTask.destinationTexture = textureConnectedPoint.value;\n }\n const depthConnectedPoint = this.depth.connectedPoint;\n if (depthConnectedPoint) {\n this._frameGraphTask.depthTexture = depthConnectedPoint.value;\n }\n }\n _dumpPropertiesCode() {\n const codes = [];\n codes.push(`${this._codeVariableName}.color = new BABYLON.Color4(${this.color.r}, ${this.color.g}, ${this.color.b}, ${this.color.a});`);\n codes.push(`${this._codeVariableName}.clearColor = ${this.clearColor};`);\n codes.push(`${this._codeVariableName}.clearDepth = ${this.clearDepth};`);\n codes.push(`${this._codeVariableName}.clearStencil = ${this.clearStencil};`);\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\n }\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.color = this.color.asArray();\n serializationObject.clearColor = this.clearColor;\n serializationObject.clearDepth = this.clearDepth;\n serializationObject.clearStencil = this.clearStencil;\n return serializationObject;\n }\n _deserialize(serializationObject) {\n super._deserialize(serializationObject);\n this.color = Color4.FromArray(serializationObject.color);\n this.clearColor = serializationObject.clearColor;\n this.clearDepth = serializationObject.clearDepth;\n this.clearStencil = serializationObject.clearStencil;\n }\n}\n__decorate([editableInPropertyPage(\"Color\", 5 /* PropertyTypeForEdition.Color4 */)], NodeRenderGraphClearBlock.prototype, \"color\", null);\n__decorate([editableInPropertyPage(\"Clear color\", 0 /* PropertyTypeForEdition.Boolean */, undefined, {\n embedded: true\n})], NodeRenderGraphClearBlock.prototype, \"clearColor\", null);\n__decorate([editableInPropertyPage(\"Clear depth\", 0 /* PropertyTypeForEdition.Boolean */, undefined, {\n embedded: true\n})], NodeRenderGraphClearBlock.prototype, \"clearDepth\", null);\n__decorate([editableInPropertyPage(\"Clear stencil\", 0 /* PropertyTypeForEdition.Boolean */, undefined, {\n embedded: true\n})], NodeRenderGraphClearBlock.prototype, \"clearStencil\", null);\nRegisterClass(\"BABYLON.NodeRenderGraphClearBlock\", NodeRenderGraphClearBlock);","map":{"version":3,"names":["__decorate","NodeRenderGraphBlock","RegisterClass","NodeRenderGraphBlockConnectionPointTypes","Color4","editableInPropertyPage","FrameGraphClearTextureTask","NodeRenderGraphClearBlock","task","_frameGraphTask","constructor","name","frameGraph","scene","registerInput","Texture","TextureBackBufferDepthStencilAttachment","registerOutput","BasedOnInput","texture","addAcceptedConnectionPointTypes","TextureAll","depth","TextureDepthStencilAttachment","output","_typeConnectionSource","outputDepth","color","value","clearColor","clearDepth","clearStencil","getClassName","_inputs","_outputs","_buildBlock","state","_propagateInputValueToOutput","textureConnectedPoint","connectedPoint","destinationTexture","depthConnectedPoint","depthTexture","_dumpPropertiesCode","codes","push","_codeVariableName","r","g","b","a","join","serialize","serializationObject","asArray","_deserialize","FromArray","prototype","undefined","embedded"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Textures/clearBlock.js"],"sourcesContent":["import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes.js\";\nimport { Color4 } from \"../../../../Maths/math.color.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\nimport { FrameGraphClearTextureTask } from \"../../../Tasks/Texture/clearTextureTask.js\";\n/**\n * Block used to clear a texture\n */\nexport class NodeRenderGraphClearBlock 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 NodeRenderGraphClearBlock\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(\"texture\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\n this.registerInput(\"depth\", NodeRenderGraphBlockConnectionPointTypes.TextureBackBufferDepthStencilAttachment, true);\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.registerOutput(\"outputDepth\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\n this.texture.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAll);\n this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\n this.output._typeConnectionSource = this.texture;\n this.outputDepth._typeConnectionSource = this.depth;\n this._frameGraphTask = new FrameGraphClearTextureTask(name, frameGraph);\n }\n /** Gets or sets the clear color */\n get color() {\n return this._frameGraphTask.color;\n }\n set color(value) {\n this._frameGraphTask.color = value;\n }\n /** Gets or sets a boolean indicating whether the color part of the texture should be cleared. */\n get clearColor() {\n return !!this._frameGraphTask.clearColor;\n }\n set clearColor(value) {\n this._frameGraphTask.clearColor = value;\n }\n /** Gets or sets a boolean indicating whether the depth part of the texture should be cleared. */\n get clearDepth() {\n return !!this._frameGraphTask.clearDepth;\n }\n set clearDepth(value) {\n this._frameGraphTask.clearDepth = value;\n }\n /** Gets or sets a boolean indicating whether the stencil part of the texture should be cleared. */\n get clearStencil() {\n return !!this._frameGraphTask.clearStencil;\n }\n set clearStencil(value) {\n this._frameGraphTask.clearStencil = value;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphClearBlock\";\n }\n /**\n * Gets the texture input component\n */\n get texture() {\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 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._propagateInputValueToOutput(this.texture, this.output);\n this._propagateInputValueToOutput(this.depth, this.outputDepth);\n const textureConnectedPoint = this.texture.connectedPoint;\n if (textureConnectedPoint) {\n this._frameGraphTask.destinationTexture = textureConnectedPoint.value;\n }\n const depthConnectedPoint = this.depth.connectedPoint;\n if (depthConnectedPoint) {\n this._frameGraphTask.depthTexture = depthConnectedPoint.value;\n }\n }\n _dumpPropertiesCode() {\n const codes = [];\n codes.push(`${this._codeVariableName}.color = new BABYLON.Color4(${this.color.r}, ${this.color.g}, ${this.color.b}, ${this.color.a});`);\n codes.push(`${this._codeVariableName}.clearColor = ${this.clearColor};`);\n codes.push(`${this._codeVariableName}.clearDepth = ${this.clearDepth};`);\n codes.push(`${this._codeVariableName}.clearStencil = ${this.clearStencil};`);\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\n }\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.color = this.color.asArray();\n serializationObject.clearColor = this.clearColor;\n serializationObject.clearDepth = this.clearDepth;\n serializationObject.clearStencil = this.clearStencil;\n return serializationObject;\n }\n _deserialize(serializationObject) {\n super._deserialize(serializationObject);\n this.color = Color4.FromArray(serializationObject.color);\n this.clearColor = serializationObject.clearColor;\n this.clearDepth = serializationObject.clearDepth;\n this.clearStencil = serializationObject.clearStencil;\n }\n}\n__decorate([\n editableInPropertyPage(\"Color\", 5 /* PropertyTypeForEdition.Color4 */)\n], NodeRenderGraphClearBlock.prototype, \"color\", null);\n__decorate([\n editableInPropertyPage(\"Clear color\", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })\n], NodeRenderGraphClearBlock.prototype, \"clearColor\", null);\n__decorate([\n editableInPropertyPage(\"Clear depth\", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })\n], NodeRenderGraphClearBlock.prototype, \"clearDepth\", null);\n__decorate([\n editableInPropertyPage(\"Clear stencil\", 0 /* PropertyTypeForEdition.Boolean */, undefined, { embedded: true })\n], NodeRenderGraphClearBlock.prototype, \"clearStencil\", null);\nRegisterClass(\"BABYLON.NodeRenderGraphClearBlock\", NodeRenderGraphClearBlock);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,wCAAwC,QAAQ,qCAAqC;AAC9F,SAASC,MAAM,QAAQ,iCAAiC;AACxD,SAASC,sBAAsB,QAAQ,yCAAyC;AAChF,SAASC,0BAA0B,QAAQ,4CAA4C;AACvF;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,SAASN,oBAAoB,CAAC;EAChE;AACJ;AACA;EACI,IAAIO,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,SAAS,EAAEX,wCAAwC,CAACY,OAAO,EAAE,IAAI,CAAC;IACr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