82c0db410e60d271a838f320d3c4a75b0df3940f638d6e4806f0a5730e42074f.json 7.7 KB

1
  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 for the Gaussian Splatting Fragment part\n */\nexport class GaussianBlock extends NodeMaterialBlock {\n /**\n * Create a new GaussianBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment);\n this._isUnique = false;\n this.registerInput(\"splatColor\", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment);\n this.registerOutput(\"rgba\", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GaussianBlock\";\n }\n /**\n * Gets the color input component\n */\n get splatColor() {\n return this._inputs[0];\n }\n /**\n * Gets the rgba output component\n */\n get rgba() {\n return this._outputs[0];\n }\n /**\n * Initialize the block and prepare the context for build\n * @param state defines the state that will be used for the build\n */\n initialize(state) {\n state._excludeVariableName(\"vPosition\");\n }\n _buildBlock(state) {\n super._buildBlock(state);\n if (state.target === NodeMaterialBlockTargets.Vertex) {\n return;\n }\n // Emit code\n const comments = `//${this.name}`;\n state._emitFunctionFromInclude(\"clipPlaneFragmentDeclaration\", comments);\n state._emitFunctionFromInclude(\"logDepthDeclaration\", comments);\n state._emitFunctionFromInclude(\"fogFragmentDeclaration\", comments);\n state._emitFunctionFromInclude(\"gaussianSplattingFragmentDeclaration\", comments);\n state._emitVaryingFromString(\"vPosition\", NodeMaterialBlockConnectionPointTypes.Vector2);\n const color = this.splatColor;\n const output = this._outputs[0];\n if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n state.compilationString += `${state._declareOutput(output)} = gaussianColor(${color.associatedVariableName}, input.vPosition);\\n`;\n } else {\n state.compilationString += `${state._declareOutput(output)} = gaussianColor(${color.associatedVariableName});\\n`;\n }\n return this;\n }\n}\nRegisterClass(\"BABYLON.GaussianBlock\", GaussianBlock);","map":{"version":3,"names":["NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","GaussianBlock","constructor","name","Fragment","_isUnique","registerInput","Color4","registerOutput","getClassName","splatColor","_inputs","rgba","_outputs","initialize","state","_excludeVariableName","_buildBlock","target","Vertex","comments","_emitFunctionFromInclude","_emitVaryingFromString","Vector2","color","output","shaderLanguage","compilationString","_declareOutput","associatedVariableName"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.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 for the Gaussian Splatting Fragment part\n */\nexport class GaussianBlock extends NodeMaterialBlock {\n /**\n * Create a new GaussianBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Fragment);\n this._isUnique = false;\n this.registerInput(\"splatColor\", NodeMaterialBlockConnectionPointTypes.Color4, false, NodeMaterialBlockTargets.Fragment);\n this.registerOutput(\"rgba\", NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockTargets.Fragment);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GaussianBlock\";\n }\n /**\n * Gets the color input component\n */\n get splatColor() {\n return this._inputs[0];\n }\n /**\n * Gets the rgba output component\n */\n get rgba() {\n return this._outputs[0];\n }\n /**\n * Initialize the block and prepare the context for build\n * @param state defines the state that will be used for the build\n */\n initialize(state) {\n state._excludeVariableName(\"vPosition\");\n }\n _buildBlock(state) {\n super._buildBlock(state);\n if (state.target === NodeMaterialBlockTargets.Vertex) {\n return;\n }\n // Emit code\n const comments = `//${this.name}`;\n state._emitFunctionFromInclude(\"clipPlaneFragmentDeclaration\", comments);\n state._emitFunctionFromInclude(\"logDepthDeclaration\", comments);\n state._emitFunctionFromInclude(\"fogFragmentDeclaration\", comments);\n state._emitFunctionFromInclude(\"gaussianSplattingFragmentDeclaration\", comments);\n state._emitVaryingFromString(\"vPosition\", NodeMaterialBlockConnectionPointTypes.Vector2);\n const color = this.splatColor;\n const output = this._outputs[0];\n if (state.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n state.compilationString += `${state._declareOutput(output)} = gaussianColor(${color.associatedVariableName}, input.vPosition);\\n`;\n }\n else {\n state.compilationString += `${state._declareOutput(output)} = gaussianColor(${color.associatedVariableName});\\n`;\n }\n return this;\n }\n}\nRegisterClass(\"BABYLON.GaussianBlock\", GaussianBlock);\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,aAAa,SAASJ,iBAAiB,CAAC;EACjD;AACJ;AACA;AACA;EACIK,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,EAAEJ,wBAAwB,CAACK,QAAQ,CAAC;IAC9C,IAAI,CAACC,SAAS,GAAG,KAAK;IACtB,IAAI,CAACC,aAAa,CAAC,YAAY,EAAER,qCAAqC,CAACS,MAAM,EAAE,KAAK,EAAER,wBAAwB,CAACK,QAAQ,CAAC;IACxH,IAAI,CAACI,cAAc,CAAC,MAAM,EAAEV,qCAAqC,CAACS,MAAM,EAAER,wBAAwB,CAACK,QAAQ,CAAC;EA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