1 |
- {"ast":null,"code":"import { PostProcess } from \"./postProcess.js\";\nimport { AbstractEngine } from \"../Engines/abstractEngine.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n * PassPostProcess which produces an output the same as it's input\n */\nexport class PassPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"PassPostProcess\" string\n */\n getClassName() {\n return \"PassPostProcess\";\n }\n /**\n * Creates the PassPostProcess\n * @param name The name of the effect.\n * @param options The required width/height ratio to downsize to before computing the render pass.\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType The type of texture to be used when performing the post processing.\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\n */\n constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n super(name, \"pass\", null, null, options, camera, samplingMode, engine, reusable, undefined, textureType, undefined, null, blockCompilation);\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/pass.fragment.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/pass.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 PassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\nRegisterClass(\"BABYLON.PassPostProcess\", PassPostProcess);\n/**\n * PassCubePostProcess which produces an output the same as it's input (which must be a cube texture)\n */\nexport class PassCubePostProcess extends PostProcess {\n /**\n * Gets or sets the cube face to display.\n * * 0 is +X\n * * 1 is -X\n * * 2 is +Y\n * * 3 is -Y\n * * 4 is +Z\n * * 5 is -Z\n */\n get face() {\n return this._face;\n }\n set face(value) {\n if (value < 0 || value > 5) {\n return;\n }\n this._face = value;\n switch (this._face) {\n case 0:\n this.updateEffect(\"#define POSITIVEX\");\n break;\n case 1:\n this.updateEffect(\"#define NEGATIVEX\");\n break;\n case 2:\n this.updateEffect(\"#define POSITIVEY\");\n break;\n case 3:\n this.updateEffect(\"#define NEGATIVEY\");\n break;\n case 4:\n this.updateEffect(\"#define POSITIVEZ\");\n break;\n case 5:\n this.updateEffect(\"#define NEGATIVEZ\");\n break;\n }\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"PassCubePostProcess\" string\n */\n getClassName() {\n return \"PassCubePostProcess\";\n }\n /**\n * Creates the PassCubePostProcess\n * @param name The name of the effect.\n * @param options The required width/height ratio to downsize to before computing the render pass.\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType The type of texture to be used when performing the post processing.\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\n */\n constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n super(name, \"passCube\", null, null, options, camera, samplingMode, engine, reusable, \"#define POSITIVEX\", textureType, undefined, null, blockCompilation);\n this._face = 0;\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/passCube.fragment.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/passCube.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 PassCubePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\nAbstractEngine._RescalePostProcessFactory = engine => {\n return new PassPostProcess(\"rescale\", 1, null, 2, engine, false, 0);\n};","map":{"version":3,"names":["PostProcess","AbstractEngine","RegisterClass","SerializationHelper","PassPostProcess","getClassName","constructor","name","options","camera","samplingMode","engine","reusable","textureType","blockCompilation","undefined","_gatherImports","useWebGPU","list","_webGPUReady","push","Promise","all","_Parse","parsedPostProcess","targetCamera","scene","rootUrl","Parse","renderTargetSamplingMode","_engine","PassCubePostProcess","face","_face","value","updateEffect","_RescalePostProcessFactory"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/passPostProcess.js"],"sourcesContent":["\nimport { PostProcess } from \"./postProcess.js\";\nimport { AbstractEngine } from \"../Engines/abstractEngine.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n * PassPostProcess which produces an output the same as it's input\n */\nexport class PassPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"PassPostProcess\" string\n */\n getClassName() {\n return \"PassPostProcess\";\n }\n /**\n * Creates the PassPostProcess\n * @param name The name of the effect.\n * @param options The required width/height ratio to downsize to before computing the render pass.\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType The type of texture to be used when performing the post processing.\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\n */\n constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n super(name, \"pass\", null, null, options, camera, samplingMode, engine, reusable, undefined, textureType, undefined, null, blockCompilation);\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/pass.fragment.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/pass.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 PassPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\nRegisterClass(\"BABYLON.PassPostProcess\", PassPostProcess);\n/**\n * PassCubePostProcess which produces an output the same as it's input (which must be a cube texture)\n */\nexport class PassCubePostProcess extends PostProcess {\n /**\n * Gets or sets the cube face to display.\n * * 0 is +X\n * * 1 is -X\n * * 2 is +Y\n * * 3 is -Y\n * * 4 is +Z\n * * 5 is -Z\n */\n get face() {\n return this._face;\n }\n set face(value) {\n if (value < 0 || value > 5) {\n return;\n }\n this._face = value;\n switch (this._face) {\n case 0:\n this.updateEffect(\"#define POSITIVEX\");\n break;\n case 1:\n this.updateEffect(\"#define NEGATIVEX\");\n break;\n case 2:\n this.updateEffect(\"#define POSITIVEY\");\n break;\n case 3:\n this.updateEffect(\"#define NEGATIVEY\");\n break;\n case 4:\n this.updateEffect(\"#define POSITIVEZ\");\n break;\n case 5:\n this.updateEffect(\"#define NEGATIVEZ\");\n break;\n }\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"PassCubePostProcess\" string\n */\n getClassName() {\n return \"PassCubePostProcess\";\n }\n /**\n * Creates the PassCubePostProcess\n * @param name The name of the effect.\n * @param options The required width/height ratio to downsize to before computing the render pass.\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType The type of texture to be used when performing the post processing.\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\n */\n constructor(name, options, camera = null, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n super(name, \"passCube\", null, null, options, camera, samplingMode, engine, reusable, \"#define POSITIVEX\", textureType, undefined, null, blockCompilation);\n this._face = 0;\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/passCube.fragment.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/passCube.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 PassCubePostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, parsedPostProcess._engine, parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\nAbstractEngine._RescalePostProcessFactory = (engine) => {\n return new PassPostProcess(\"rescale\", 1, null, 2, engine, false, 0);\n};\n"],"mappings":"AACA,SAASA,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,mBAAmB,QAAQ,qCAAqC;AACzE;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASJ,WAAW,CAAC;EAC7C;AACJ;AACA;AACA;EACIK,YAAYA,CAAA,EAAG;IACX,OAAO,iBAAiB;EAC5B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,OAAO,EAAEC,MAAM,GAAG,IAAI,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,WAAW,GAAG,CAAC,EAAEC,gBAAgB,GAAG,KAAK,EAAE;IACjH,KAAK,CAACP,IAAI,EAAE,MAAM,EAAE,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