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 test if the fragment shader is front facing\n */\nexport class FrontFacingBlock extends NodeMaterialBlock {\n /**\n * Creates a new FrontFacingBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"FrontFacingBlock\";\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n if (state.target === NodeMaterialBlockTargets.Vertex) {\n // eslint-disable-next-line no-throw-literal\n throw \"FrontFacingBlock must only be used in a fragment shader\";\n }\n const output = this._outputs[0];\n state.compilationString += state._declareOutput(output) + ` = ${state._generateTernary(\"1.0\", \"0.0\", state.shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? \"gl_FrontFacing\" : \"fragmentInputs.frontFacing\")};\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.FrontFacingBlock\", FrontFacingBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","FrontFacingBlock","constructor","name","Fragment","registerOutput","Float","getClassName","output","_outputs","_buildBlock","state","target","Vertex","compilationString","_declareOutput","_generateTernary","shaderLanguage"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/Fragment/frontFacingBlock.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 test if the fragment shader is front facing\n */\nexport class FrontFacingBlock extends NodeMaterialBlock {\n /**\n * Creates a new FrontFacingBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float, NodeMaterialBlockTargets.Fragment);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"FrontFacingBlock\";\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n if (state.target === NodeMaterialBlockTargets.Vertex) {\n // eslint-disable-next-line no-throw-literal\n throw \"FrontFacingBlock must only be used in a fragment shader\";\n }\n const output = this._outputs[0];\n state.compilationString +=\n state._declareOutput(output) +\n ` = ${state._generateTernary(\"1.0\", \"0.0\", state.shaderLanguage === 0 /* ShaderLanguage.GLSL */ ? \"gl_FrontFacing\" : \"fragmentInputs.frontFacing\")};\\n`;\n return this;\n }\n}\nRegisterClass(\"BABYLON.FrontFacingBlock\", FrontFacingBlock);\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,gBAAgB,SAASJ,iBAAiB,CAAC;EACpD;AACJ;AACA;AACA;EACIK,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,EAAEJ,wBAAwB,CAACK,QAAQ,CAAC;IAC9C,IAAI,CAACC,cAAc,CAAC,QAAQ,EAAEP,qCAAqC,CAACQ,KAAK,EAAEP,wBAAwB,CAACK,QAAQ,CAAC;EACjH;EACA;AACJ;AACA;AACA;EACIG,YAAYA,CAAA,EAAG;IACX,OAAO,kBAAkB;EAC7B;EACA;AACJ;AACA;EACI,IAAIC,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;EAC3B;EACAC,WAAWA,CAACC,KAAK,EAAE;IACf,KAAK,CAACD,WAAW,CAACC,KAAK,CAAC;IACxB,IAAIA,KAAK,CAACC,MAAM,KAAKb,wBAAwB,CAACc,MAAM,EAAE;MAClD;MACA,MAAM,yDAAyD;IACnE;IACA,MAAML,MAAM,GAAG,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;IAC/BE,KAAK,CAACG,iBAAiB,IACnBH,KAAK,CAACI,cAAc,CAACP,MAAM,CAAC,GACxB,MAAMG,KAAK,CAACK,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAEL,KAAK,CAACM,cAAc,KAAK,CAAC,CAAC,4BAA4B,gBAAgB,GAAG,4BAA4B,CAAC,KAAK;IAC/J,OAAO,IAAI;EACf;AACJ;AACAjB,aAAa,CAAC,0BAA0B,EAAEC,gBAAgB,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|