1 |
- {"ast":null,"code":"import { NodeMaterialBlock } from \"../../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\n/**\n * Block used to discard a pixel if a value is smaller than a cutoff\n */\nexport class DiscardBlock extends NodeMaterialBlock {\n /**\n * Create a new DiscardBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment, true);\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.Float, true);\n this.registerInput(\"cutoff\", NodeMaterialBlockConnectionPointTypes.Float, true);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"DiscardBlock\";\n }\n /**\n * Gets the color input component\n */\n get value() {\n return this._inputs[0];\n }\n /**\n * Gets the cutoff input component\n */\n get cutoff() {\n return this._inputs[1];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n state.sharedData.hints.needAlphaTesting = true;\n if (!this.cutoff.isConnected || !this.value.isConnected) {\n return;\n }\n state.compilationString += `if (${this.value.associatedVariableName} < ${this.cutoff.associatedVariableName}) { discard; }\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.DiscardBlock\", DiscardBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","DiscardBlock","constructor","name","Fragment","registerInput","Float","getClassName","value","_inputs","cutoff","_buildBlock","state","sharedData","hints","needAlphaTesting","isConnected","compilationString","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/discardBlock.js"],"sourcesContent":["import { NodeMaterialBlock } from \"../../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../../Misc/typeStore.js\";\n/**\n * Block used to discard a pixel if a value is smaller than a cutoff\n */\nexport class DiscardBlock extends NodeMaterialBlock {\n /**\n * Create a new DiscardBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment, true);\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.Float, true);\n this.registerInput(\"cutoff\", NodeMaterialBlockConnectionPointTypes.Float, true);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"DiscardBlock\";\n }\n /**\n * Gets the color input component\n */\n get value() {\n return this._inputs[0];\n }\n /**\n * Gets the cutoff input component\n */\n get cutoff() {\n return this._inputs[1];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n state.sharedData.hints.needAlphaTesting = true;\n if (!this.cutoff.isConnected || !this.value.isConnected) {\n return;\n }\n state.compilationString += `if (${this.value.associatedVariableName} < ${this.cutoff.associatedVariableName}) { discard; }\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.DiscardBlock\", DiscardBlock);\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,qCAAqC,QAAQ,sDAAsD;AAC5G,SAASC,wBAAwB,QAAQ,yCAAyC;AAClF,SAASC,aAAa,QAAQ,+BAA+B;AAC7D;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASJ,iBAAiB,CAAC;EAChD;AACJ;AACA;AACA;EACIK,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,EAAEJ,wBAAwB,CAACK,QAAQ,EAAE,IAAI,CAAC;IACpD,IAAI,CAACC,aAAa,CAAC,OAAO,EAAEP,qCAAqC,CAACQ,KAAK,EAAE,IAAI,CAAC;IAC9E,IAAI,CAACD,aAAa,CAAC,QAAQ,EAAEP,qCAAqC,CAACQ,KAAK,EAAE,IAAI,CAAC;EACnF;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