f35ca4b21b63e4d590bc18e5f6edc6e5aaf332600f56c4207f2a02b93cf80fc2.json 8.6 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n *\n * This post-process allows the modification of rendered colors by using\n * a 'look-up table' (LUT). This effect is also called Color Grading.\n *\n * The object needs to be provided an url to a texture containing the color\n * look-up table: the texture must be 256 pixels wide and 16 pixels high.\n * Use an image editing software to tweak the LUT to match your needs.\n *\n * For an example of a color LUT, see here:\n * @see http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png\n * For explanations on color grading, see here:\n * @see http://udn.epicgames.com/Three/ColorGrading.html\n *\n */\nexport class ColorCorrectionPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"ColorCorrectionPostProcess\" string\n */\n getClassName() {\n return \"ColorCorrectionPostProcess\";\n }\n constructor(name, colorTableUrl, options, camera, samplingMode, engine, reusable) {\n super(name, \"colorCorrection\", null, [\"colorTable\"], options, camera, samplingMode, engine, reusable);\n const scene = (camera === null || camera === void 0 ? void 0 : camera.getScene()) || null;\n this._colorTableTexture = new Texture(colorTableUrl, scene, true, false, Texture.TRILINEAR_SAMPLINGMODE);\n this._colorTableTexture.anisotropicFilteringLevel = 1;\n this._colorTableTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\n this._colorTableTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\n this.colorTableUrl = colorTableUrl;\n this.onApply = effect => {\n effect.setTexture(\"colorTable\", this._colorTableTexture);\n };\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/colorCorrection.fragment.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/colorCorrection.fragment.js\")]));\n }\n super._gatherImports(useWebGPU, list);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new ColorCorrectionPostProcess(parsedPostProcess.name, parsedPostProcess.colorTableUrl, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([serialize()], ColorCorrectionPostProcess.prototype, \"colorTableUrl\", void 0);\nRegisterClass(\"BABYLON.ColorCorrectionPostProcess\", ColorCorrectionPostProcess);","map":{"version":3,"names":["__decorate","PostProcess","Texture","RegisterClass","serialize","SerializationHelper","ColorCorrectionPostProcess","getClassName","constructor","name","colorTableUrl","options","camera","samplingMode","engine","reusable","scene","getScene","_colorTableTexture","TRILINEAR_SAMPLINGMODE","anisotropicFilteringLevel","wrapU","CLAMP_ADDRESSMODE","wrapV","onApply","effect","setTexture","_gatherImports","useWebGPU","list","_webGPUReady","push","Promise","all","_Parse","parsedPostProcess","targetCamera","rootUrl","Parse","renderTargetSamplingMode","getEngine","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/colorCorrectionPostProcess.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n *\n * This post-process allows the modification of rendered colors by using\n * a 'look-up table' (LUT). This effect is also called Color Grading.\n *\n * The object needs to be provided an url to a texture containing the color\n * look-up table: the texture must be 256 pixels wide and 16 pixels high.\n * Use an image editing software to tweak the LUT to match your needs.\n *\n * For an example of a color LUT, see here:\n * @see http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png\n * For explanations on color grading, see here:\n * @see http://udn.epicgames.com/Three/ColorGrading.html\n *\n */\nexport class ColorCorrectionPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"ColorCorrectionPostProcess\" string\n */\n getClassName() {\n return \"ColorCorrectionPostProcess\";\n }\n constructor(name, colorTableUrl, options, camera, samplingMode, engine, reusable) {\n super(name, \"colorCorrection\", null, [\"colorTable\"], options, camera, samplingMode, engine, reusable);\n const scene = camera?.getScene() || null;\n this._colorTableTexture = new Texture(colorTableUrl, scene, true, false, Texture.TRILINEAR_SAMPLINGMODE);\n this._colorTableTexture.anisotropicFilteringLevel = 1;\n this._colorTableTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\n this._colorTableTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\n this.colorTableUrl = colorTableUrl;\n this.onApply = (effect) => {\n effect.setTexture(\"colorTable\", this._colorTableTexture);\n };\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/colorCorrection.fragment.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/colorCorrection.fragment.js\")]));\n }\n super._gatherImports(useWebGPU, list);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new ColorCorrectionPostProcess(parsedPostProcess.name, parsedPostProcess.colorTableUrl, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([\n serialize()\n], ColorCorrectionPostProcess.prototype, \"colorTableUrl\", void 0);\nRegisterClass(\"BABYLON.ColorCorrectionPostProcess\", ColorCorrectionPostProcess);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,OAAO,QAAQ,kCAAk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