1 |
- {"ast":null,"code":"import { FrameGraphPostProcessTask } from \"./postProcessTask.js\";\nimport { ThinCircleOfConfusionPostProcess } from \"../../../PostProcesses/thinCircleOfConfusionPostProcess.js\";\n/**\n * Task which applies a circle of confusion post process.\n */\nexport class FrameGraphCircleOfConfusionTask extends FrameGraphPostProcessTask {\n /**\n * Constructs a new circle of confusion task.\n * @param name The name of the task.\n * @param frameGraph The frame graph this task belongs to.\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\n */\n constructor(name, frameGraph, thinPostProcess) {\n super(name, frameGraph, thinPostProcess || new ThinCircleOfConfusionPostProcess(name, frameGraph.engine));\n /**\n * The sampling mode to use for the depth texture.\n */\n this.depthSamplingMode = 2;\n }\n record(skipCreationOfDisabledPasses = false) {\n if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {\n throw new Error(`FrameGraphCircleOfConfusionTask \"${this.name}\": sourceTexture, depthTexture and camera are required`);\n }\n const pass = super.record(skipCreationOfDisabledPasses, context => {\n context.setTextureSamplingMode(this.depthTexture, this.depthSamplingMode);\n }, context => {\n this.postProcess.camera = this.camera;\n context.bindTextureHandle(this._postProcessDrawWrapper.effect, \"depthSampler\", this.depthTexture);\n });\n pass.useTexture(this.depthTexture);\n return pass;\n }\n}","map":{"version":3,"names":["FrameGraphPostProcessTask","ThinCircleOfConfusionPostProcess","FrameGraphCircleOfConfusionTask","constructor","name","frameGraph","thinPostProcess","engine","depthSamplingMode","record","skipCreationOfDisabledPasses","sourceTexture","undefined","depthTexture","camera","Error","pass","context","setTextureSamplingMode","postProcess","bindTextureHandle","_postProcessDrawWrapper","effect","useTexture"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js"],"sourcesContent":["import { FrameGraphPostProcessTask } from \"./postProcessTask.js\";\n\nimport { ThinCircleOfConfusionPostProcess } from \"../../../PostProcesses/thinCircleOfConfusionPostProcess.js\";\n/**\n * Task which applies a circle of confusion post process.\n */\nexport class FrameGraphCircleOfConfusionTask extends FrameGraphPostProcessTask {\n /**\n * Constructs a new circle of confusion task.\n * @param name The name of the task.\n * @param frameGraph The frame graph this task belongs to.\n * @param thinPostProcess The thin post process to use for the task. If not provided, a new one will be created.\n */\n constructor(name, frameGraph, thinPostProcess) {\n super(name, frameGraph, thinPostProcess || new ThinCircleOfConfusionPostProcess(name, frameGraph.engine));\n /**\n * The sampling mode to use for the depth texture.\n */\n this.depthSamplingMode = 2;\n }\n record(skipCreationOfDisabledPasses = false) {\n if (this.sourceTexture === undefined || this.depthTexture === undefined || this.camera === undefined) {\n throw new Error(`FrameGraphCircleOfConfusionTask \"${this.name}\": sourceTexture, depthTexture and camera are required`);\n }\n const pass = super.record(skipCreationOfDisabledPasses, (context) => {\n context.setTextureSamplingMode(this.depthTexture, this.depthSamplingMode);\n }, (context) => {\n this.postProcess.camera = this.camera;\n context.bindTextureHandle(this._postProcessDrawWrapper.effect, \"depthSampler\", this.depthTexture);\n });\n pass.useTexture(this.depthTexture);\n return pass;\n }\n}\n"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ,sBAAsB;AAEhE,SAASC,gCAAgC,QAAQ,4DAA4D;AAC7G;AACA;AACA;AACA,OAAO,MAAMC,+BAA+B,SAASF,yBAAyB,CAAC;EAC3E;AACJ;AACA;AACA;AACA;AACA;EACIG,WAAWA,CAACC,IAAI,EAAEC,UAAU,EAAEC,eAAe,EAAE;IAC3C,KAAK,CAACF,IAAI,EAAEC,UAAU,EAAEC,eAAe,IAAI,IAAIL,gCAAgC,CAACG,IAAI,EAAEC,UAAU,CAACE,MAAM,CAAC,CAAC;IACzG;AACR;AACA;IACQ,IAAI,CAACC,iBAAiB,GAAG,CAAC;EAC9B;EACAC,MAAMA,CAACC,4BAA4B,GAAG,KAAK,EAAE;IACzC,IAAI,IAAI,CAACC,aAAa,KAAKC,SAAS,IAAI,IAAI,CAACC,YAAY,KAAKD,SAAS,IAAI,IAAI,CAACE,MAAM,KAAKF,SAAS,EAAE;MAClG,MAAM,IAAIG,KAAK,CAAC,oCAAoC,IAAI,CAACX,IAAI,wDAAwD,CAAC;IAC1H;IACA,MAAMY,IAAI,GAAG,KAAK,CAACP,MAAM,CAACC,4BAA4B,EAAGO,OAAO,IAAK;MACjEA,OAAO,CAACC,sBAAsB,CAAC,IAAI,CAACL,YAAY,EAAE,IAAI,CAACL,iBAAiB,CAAC;IAC7E,CAAC,EAAGS,OAAO,IAAK;MACZ,IAAI,CAACE,WAAW,CAACL,MAAM,GAAG,IAAI,CAACA,MAAM;MACrCG,OAAO,CAACG,iBAAiB,CAAC,IAAI,CAACC,uBAAuB,CAACC,MAAM,EAAE,cAAc,EAAE,IAAI,CAACT,YAAY,CAAC;IACrG,CAAC,CAAC;IACFG,IAAI,CAACO,UAAU,CAAC,IAAI,CAACV,YAAY,CAAC;IAClC,OAAOG,IAAI;EACf;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|