cdcc1733c3f583ed0ee8cb44ac591caf40dcf0db57ec13c3688b861ce80400a3.json 8.5 KB

1
  1. {"ast":null,"code":"import { PostProcess } from \"./postProcess.js\";\n\n/** Defines operator used for tonemapping */\nexport var TonemappingOperator;\n(function (TonemappingOperator) {\n /** Hable */\n TonemappingOperator[TonemappingOperator[\"Hable\"] = 0] = \"Hable\";\n /** Reinhard */\n TonemappingOperator[TonemappingOperator[\"Reinhard\"] = 1] = \"Reinhard\";\n /** HejiDawson */\n TonemappingOperator[TonemappingOperator[\"HejiDawson\"] = 2] = \"HejiDawson\";\n /** Photographic */\n TonemappingOperator[TonemappingOperator[\"Photographic\"] = 3] = \"Photographic\";\n})(TonemappingOperator || (TonemappingOperator = {}));\n/**\n * Defines a post process to apply tone mapping\n */\nexport class TonemapPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"TonemapPostProcess\" string\n */\n getClassName() {\n return \"TonemapPostProcess\";\n }\n /**\n * Creates a new TonemapPostProcess\n * @param name defines the name of the postprocess\n * @param _operator defines the operator to use\n * @param exposureAdjustment defines the required exposure adjustment\n * @param camera defines the camera to use (can be null)\n * @param samplingMode defines the required sampling mode (BABYLON.Texture.BILINEAR_SAMPLINGMODE by default)\n * @param engine defines the hosting engine (can be ignore if camera is set)\n * @param textureFormat defines the texture format to use (BABYLON.Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n */\n constructor(name, _operator, /** Defines the required exposure adjustment */\n exposureAdjustment, camera, samplingMode = 2, engine, textureFormat = 0, reusable) {\n super(name, \"tonemap\", [\"_ExposureAdjustment\"], null, 1.0, camera, samplingMode, engine, reusable, null, textureFormat);\n this._operator = _operator;\n this.exposureAdjustment = exposureAdjustment;\n let defines = \"#define \";\n if (this._operator === 0 /* TonemappingOperator.Hable */) {\n defines += \"HABLE_TONEMAPPING\";\n } else if (this._operator === 1 /* TonemappingOperator.Reinhard */) {\n defines += \"REINHARD_TONEMAPPING\";\n } else if (this._operator === 2 /* TonemappingOperator.HejiDawson */) {\n defines += \"OPTIMIZED_HEJIDAWSON_TONEMAPPING\";\n } else if (this._operator === 3 /* TonemappingOperator.Photographic */) {\n defines += \"PHOTOGRAPHIC_TONEMAPPING\";\n }\n //sadly a second call to create the effect.\n this.updateEffect(defines);\n this.onApply = effect => {\n effect.setFloat(\"_ExposureAdjustment\", this.exposureAdjustment);\n };\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/tonemap.fragment.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/tonemap.fragment.js\")]));\n }\n super._gatherImports(useWebGPU, list);\n }\n}","map":{"version":3,"names":["PostProcess","TonemappingOperator","TonemapPostProcess","getClassName","constructor","name","_operator","exposureAdjustment","camera","samplingMode","engine","textureFormat","reusable","defines","updateEffect","onApply","effect","setFloat","_gatherImports","useWebGPU","list","_webGPUReady","push","Promise","all"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/tonemapPostProcess.js"],"sourcesContent":["import { PostProcess } from \"./postProcess.js\";\n\n/** Defines operator used for tonemapping */\nexport var TonemappingOperator;\n(function (TonemappingOperator) {\n /** Hable */\n TonemappingOperator[TonemappingOperator[\"Hable\"] = 0] = \"Hable\";\n /** Reinhard */\n TonemappingOperator[TonemappingOperator[\"Reinhard\"] = 1] = \"Reinhard\";\n /** HejiDawson */\n TonemappingOperator[TonemappingOperator[\"HejiDawson\"] = 2] = \"HejiDawson\";\n /** Photographic */\n TonemappingOperator[TonemappingOperator[\"Photographic\"] = 3] = \"Photographic\";\n})(TonemappingOperator || (TonemappingOperator = {}));\n/**\n * Defines a post process to apply tone mapping\n */\nexport class TonemapPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"TonemapPostProcess\" string\n */\n getClassName() {\n return \"TonemapPostProcess\";\n }\n /**\n * Creates a new TonemapPostProcess\n * @param name defines the name of the postprocess\n * @param _operator defines the operator to use\n * @param exposureAdjustment defines the required exposure adjustment\n * @param camera defines the camera to use (can be null)\n * @param samplingMode defines the required sampling mode (BABYLON.Texture.BILINEAR_SAMPLINGMODE by default)\n * @param engine defines the hosting engine (can be ignore if camera is set)\n * @param textureFormat defines the texture format to use (BABYLON.Engine.TEXTURETYPE_UNSIGNED_BYTE by default)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n */\n constructor(name, _operator, \n /** Defines the required exposure adjustment */\n exposureAdjustment, camera, samplingMode = 2, engine, textureFormat = 0, reusable) {\n super(name, \"tonemap\", [\"_ExposureAdjustment\"], null, 1.0, camera, samplingMode, engine, reusable, null, textureFormat);\n this._operator = _operator;\n this.exposureAdjustment = exposureAdjustment;\n let defines = \"#define \";\n if (this._operator === 0 /* TonemappingOperator.Hable */) {\n defines += \"HABLE_TONEMAPPING\";\n }\n else if (this._operator === 1 /* TonemappingOperator.Reinhard */) {\n defines += \"REINHARD_TONEMAPPING\";\n }\n else if (this._operator === 2 /* TonemappingOperator.HejiDawson */) {\n defines += \"OPTIMIZED_HEJIDAWSON_TONEMAPPING\";\n }\n else if (this._operator === 3 /* TonemappingOperator.Photographic */) {\n defines += \"PHOTOGRAPHIC_TONEMAPPING\";\n }\n //sadly a second call to create the effect.\n this.updateEffect(defines);\n this.onApply = (effect) => {\n effect.setFloat(\"_ExposureAdjustment\", this.exposureAdjustment);\n };\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/tonemap.fragment.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/tonemap.fragment.js\")]));\n }\n super._gatherImports(useWebGPU, list);\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,kBAAkB;;AAE9C;AACA,OAAO,IAAIC,mBAAmB;AAC9B,CAAC,UAAUA,mBAAmB,EAAE;EAC5B;EACAA,mBAAmB,CAACA,mBAAmB,CAAC,OA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