1 |
- {"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize } from \"../Misc/decorators.js\";\nimport { ThinCircleOfConfusionPostProcess } from \"./thinCircleOfConfusionPostProcess.js\";\n/**\n * The CircleOfConfusionPostProcess computes the circle of confusion value for each pixel given required lens parameters. See https://en.wikipedia.org/wiki/Circle_of_confusion\n */\nexport class CircleOfConfusionPostProcess extends PostProcess {\n /**\n * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.\n */\n get lensSize() {\n return this._effectWrapper.lensSize;\n }\n set lensSize(value) {\n this._effectWrapper.lensSize = value;\n }\n /**\n * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)\n */\n get fStop() {\n return this._effectWrapper.fStop;\n }\n set fStop(value) {\n this._effectWrapper.fStop = value;\n }\n /**\n * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)\n */\n get focusDistance() {\n return this._effectWrapper.focusDistance;\n }\n set focusDistance(value) {\n this._effectWrapper.focusDistance = value;\n }\n /**\n * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)\n */\n get focalLength() {\n return this._effectWrapper.focalLength;\n }\n set focalLength(value) {\n this._effectWrapper.focalLength = value;\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"CircleOfConfusionPostProcess\" string\n */\n getClassName() {\n return \"CircleOfConfusionPostProcess\";\n }\n /**\n * Creates a new instance CircleOfConfusionPostProcess\n * @param name The name of the effect.\n * @param depthTexture The depth texture of the scene to compute the circle of confusion. This must be set in order for this to function but may be set after initialization if needed.\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 Type of textures used when performing the post process. (default: 0)\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, depthTexture, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n const localOptions = {\n uniforms: ThinCircleOfConfusionPostProcess.Uniforms,\n samplers: ThinCircleOfConfusionPostProcess.Samplers,\n defines: typeof options === \"object\" && options.depthNotNormalized ? ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized : undefined,\n size: typeof options === \"number\" ? options : undefined,\n camera,\n samplingMode,\n engine,\n reusable,\n textureType,\n blockCompilation,\n ...options\n };\n super(name, ThinCircleOfConfusionPostProcess.FragmentUrl, {\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinCircleOfConfusionPostProcess(name, engine, localOptions) : undefined,\n ...localOptions\n });\n this._depthTexture = null;\n this._depthTexture = depthTexture;\n this.onApplyObservable.add(effect => {\n if (!this._depthTexture) {\n Logger.Warn(\"No depth texture set on CircleOfConfusionPostProcess\");\n return;\n }\n effect.setTexture(\"depthSampler\", this._depthTexture);\n this._effectWrapper.camera = this._depthTexture.activeCamera;\n });\n }\n /**\n * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.\n */\n set depthTexture(value) {\n this._depthTexture = value;\n }\n}\n__decorate([serialize()], CircleOfConfusionPostProcess.prototype, \"lensSize\", null);\n__decorate([serialize()], CircleOfConfusionPostProcess.prototype, \"fStop\", null);\n__decorate([serialize()], CircleOfConfusionPostProcess.prototype, \"focusDistance\", null);\n__decorate([serialize()], CircleOfConfusionPostProcess.prototype, \"focalLength\", null);\nRegisterClass(\"BABYLON.CircleOfConfusionPostProcess\", CircleOfConfusionPostProcess);","map":{"version":3,"names":["__decorate","PostProcess","Logger","RegisterClass","serialize","ThinCircleOfConfusionPostProcess","CircleOfConfusionPostProcess","lensSize","_effectWrapper","value","fStop","focusDistance","focalLength","getClassName","constructor","name","depthTexture","options","camera","samplingMode","engine","reusable","textureType","blockCompilation","localOptions","uniforms","Uniforms","samplers","Samplers","defines","depthNotNormalized","DefinesDepthNotNormalized","undefined","size","FragmentUrl","effectWrapper","_depthTexture","onApplyObservable","add","effect","Warn","setTexture","activeCamera","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/circleOfConfusionPostProcess.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport { Logger } from \"../Misc/logger.js\";\n\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize } from \"../Misc/decorators.js\";\nimport { ThinCircleOfConfusionPostProcess } from \"./thinCircleOfConfusionPostProcess.js\";\n/**\n * The CircleOfConfusionPostProcess computes the circle of confusion value for each pixel given required lens parameters. See https://en.wikipedia.org/wiki/Circle_of_confusion\n */\nexport class CircleOfConfusionPostProcess extends PostProcess {\n /**\n * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.\n */\n get lensSize() {\n return this._effectWrapper.lensSize;\n }\n set lensSize(value) {\n this._effectWrapper.lensSize = value;\n }\n /**\n * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)\n */\n get fStop() {\n return this._effectWrapper.fStop;\n }\n set fStop(value) {\n this._effectWrapper.fStop = value;\n }\n /**\n * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)\n */\n get focusDistance() {\n return this._effectWrapper.focusDistance;\n }\n set focusDistance(value) {\n this._effectWrapper.focusDistance = value;\n }\n /**\n * Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)\n */\n get focalLength() {\n return this._effectWrapper.focalLength;\n }\n set focalLength(value) {\n this._effectWrapper.focalLength = value;\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"CircleOfConfusionPostProcess\" string\n */\n getClassName() {\n return \"CircleOfConfusionPostProcess\";\n }\n /**\n * Creates a new instance CircleOfConfusionPostProcess\n * @param name The name of the effect.\n * @param depthTexture The depth texture of the scene to compute the circle of confusion. This must be set in order for this to function but may be set after initialization if needed.\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 Type of textures used when performing the post process. (default: 0)\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, depthTexture, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n const localOptions = {\n uniforms: ThinCircleOfConfusionPostProcess.Uniforms,\n samplers: ThinCircleOfConfusionPostProcess.Samplers,\n defines: typeof options === \"object\" && options.depthNotNormalized ? ThinCircleOfConfusionPostProcess.DefinesDepthNotNormalized : undefined,\n size: typeof options === \"number\" ? options : undefined,\n camera,\n samplingMode,\n engine,\n reusable,\n textureType,\n blockCompilation,\n ...options,\n };\n super(name, ThinCircleOfConfusionPostProcess.FragmentUrl, {\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinCircleOfConfusionPostProcess(name, engine, localOptions) : undefined,\n ...localOptions,\n });\n this._depthTexture = null;\n this._depthTexture = depthTexture;\n this.onApplyObservable.add((effect) => {\n if (!this._depthTexture) {\n Logger.Warn(\"No depth texture set on CircleOfConfusionPostProcess\");\n return;\n }\n effect.setTexture(\"depthSampler\", this._depthTexture);\n this._effectWrapper.camera = this._depthTexture.activeCamera;\n });\n }\n /**\n * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.\n */\n set depthTexture(value) {\n this._depthTexture = value;\n }\n}\n__decorate([\n serialize()\n], CircleOfConfusionPostProcess.prototype, \"lensSize\", null);\n__decorate([\n serialize()\n], CircleOfConfusionPostProcess.prototype, \"fStop\", null);\n__decorate([\n serialize()\n], CircleOfConfusionPostProcess.prototype, \"focusDistance\", null);\n__decorate([\n serialize()\n], CircleOfConfusionPostProcess.prototype, \"focalLength\", null);\nRegisterClass(\"BABYLON.CircleOfConfusionPostProcess\", CircleOfConfusionPostProcess);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,SAAS,QAAQ,uBAAuB;AACjD,SAASC,gCAAgC,QAAQ,uCAAuC;AACxF;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,SAASL,WAAW,CAAC;EAC1D;AACJ;AACA;EACI,IAAIM,QAAQA,CAAA,EAAG;IACX,OAAO,IAAI,CAACC,cAAc,CAACD,QAAQ;EACvC;EACA,IAAIA,QAAQA,CAACE,KAAK,EAAE;IAChB,IAAI,CAACD,cAAc,CAACD,QAAQ,GAAGE,KAAK;EACxC;EACA;AACJ;AACA;EACI,IAAIC,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACF,cAAc,CAACE,KAAK;EACpC;EACA,IAAIA,KAAKA,CAACD,KAAK,EAAE;IACb,IAAI,CAACD,cAAc,CAACE,KAAK,GAAGD,KAAK;EACrC;EACA;AACJ;AACA;EACI,IAAIE,aAAaA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACH,cAAc,CAACG,aAAa;EAC5C;EACA,IAAIA,aAAaA,CAACF,KAAK,EAAE;IACrB,IAAI,CAACD,cAAc,CAACG,aAAa,GAAGF,KAAK;EAC7C;EACA;AACJ;AACA;EACI,IAAIG,WAAWA,CAAA,EAAG;IACd,OAAO,IAAI,CAACJ,cAAc,CAACI,WAAW;EAC1C;EACA,IAAIA,WAAWA,CAACH,KAAK,EAAE;IACnB,IAAI,CAACD,cAAc,CAACI,WAAW,GAAGH,KAAK;EAC3C;EACA;AACJ;AACA;AAC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