671e55f5209c269b8756772a374961878b8fc6125c14c462747d1f72ab587c5c.json 23 KB

1
  1. {"ast":null,"code":"import { Observable } from \"./observable.js\";\nimport { PostProcess } from \"../PostProcesses/postProcess.js\";\nimport { PostProcessManager } from \"../PostProcesses/postProcessManager.js\";\nimport \"../Shaders/minmaxRedux.fragment.js\";\n/**\n * This class computes a min/max reduction from a texture: it means it computes the minimum\n * and maximum values from all values of the texture.\n * It is performed on the GPU for better performances, thanks to a succession of post processes.\n * The source values are read from the red channel of the texture.\n */\nexport class MinMaxReducer {\n /**\n * Creates a min/max reducer\n * @param camera The camera to use for the post processes\n */\n constructor(camera) {\n /**\n * Observable triggered when the computation has been performed\n */\n this.onAfterReductionPerformed = new Observable();\n this._forceFullscreenViewport = true;\n this._activated = false;\n this._camera = camera;\n this._postProcessManager = new PostProcessManager(camera.getScene());\n this._onContextRestoredObserver = camera.getEngine().onContextRestoredObservable.add(() => {\n this._postProcessManager._rebuild();\n });\n }\n /**\n * Gets the texture used to read the values from.\n */\n get sourceTexture() {\n return this._sourceTexture;\n }\n /**\n * Sets the source texture to read the values from.\n * One must indicate if the texture is a depth texture or not through the depthRedux parameter\n * because in such textures '1' value must not be taken into account to compute the maximum\n * as this value is used to clear the texture.\n * Note that the computation is not activated by calling this function, you must call activate() for that!\n * @param sourceTexture The texture to read the values from. The values should be in the red channel.\n * @param depthRedux Indicates if the texture is a depth texture or not\n * @param type The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)\n * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)\n */\n setSourceTexture(sourceTexture, depthRedux, type = 2, forceFullscreenViewport = true) {\n if (sourceTexture === this._sourceTexture) {\n return;\n }\n this.dispose(false);\n this._sourceTexture = sourceTexture;\n this._reductionSteps = [];\n this._forceFullscreenViewport = forceFullscreenViewport;\n const scene = this._camera.getScene();\n // create the first step\n const reductionInitial = new PostProcess(\"Initial reduction phase\", \"minmaxRedux\",\n // shader\n [\"texSize\"], [\"sourceTexture\"],\n // textures\n 1.0,\n // options\n null,\n // camera\n 1,\n // sampling\n scene.getEngine(),\n // engine\n false,\n // reusable\n \"#define INITIAL\" + (depthRedux ? \"\\n#define DEPTH_REDUX\" : \"\"),\n // defines\n type, undefined, undefined, undefined, 7);\n reductionInitial.autoClear = false;\n reductionInitial.forceFullscreenViewport = forceFullscreenViewport;\n let w = this._sourceTexture.getRenderWidth(),\n h = this._sourceTexture.getRenderHeight();\n reductionInitial.onApply = ((w, h) => {\n return effect => {\n effect.setTexture(\"sourceTexture\", this._sourceTexture);\n effect.setFloat2(\"texSize\", w, h);\n };\n })(w, h);\n this._reductionSteps.push(reductionInitial);\n let index = 1;\n // create the additional steps\n while (w > 1 || h > 1) {\n w = Math.max(Math.round(w / 2), 1);\n h = Math.max(Math.round(h / 2), 1);\n const reduction = new PostProcess(\"Reduction phase \" + index, \"minmaxRedux\",\n // shader\n [\"texSize\"], null, {\n width: w,\n height: h\n },\n // options\n null,\n // camera\n 1,\n // sampling\n scene.getEngine(),\n // engine\n false,\n // reusable\n \"#define \" + (w == 1 && h == 1 ? \"LAST\" : w == 1 || h == 1 ? \"ONEBEFORELAST\" : \"MAIN\"),\n // defines\n type, undefined, undefined, undefined, 7);\n reduction.autoClear = false;\n reduction.forceFullscreenViewport = forceFullscreenViewport;\n reduction.onApply = ((w, h) => {\n return effect => {\n if (w == 1 || h == 1) {\n effect.setInt2(\"texSize\", w, h);\n } else {\n effect.setFloat2(\"texSize\", w, h);\n }\n };\n })(w, h);\n this._reductionSteps.push(reduction);\n index++;\n if (w == 1 && h == 1) {\n const func = (w, h, reduction) => {\n const buffer = new Float32Array(4 * w * h),\n minmax = {\n min: 0,\n max: 0\n };\n return () => {\n scene.getEngine()._readTexturePixels(reduction.inputTexture.texture, w, h, -1, 0, buffer, false);\n minmax.min = buffer[0];\n minmax.max = buffer[1];\n this.onAfterReductionPerformed.notifyObservers(minmax);\n };\n };\n reduction.onAfterRenderObservable.add(func(w, h, reduction));\n }\n }\n }\n /**\n * Defines the refresh rate of the computation.\n * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...\n */\n get refreshRate() {\n return this._sourceTexture ? this._sourceTexture.refreshRate : -1;\n }\n set refreshRate(value) {\n if (this._sourceTexture) {\n this._sourceTexture.refreshRate = value;\n }\n }\n /**\n * Gets the activation status of the reducer\n */\n get activated() {\n return this._activated;\n }\n /**\n * Activates the reduction computation.\n * When activated, the observers registered in onAfterReductionPerformed are\n * called after the computation is performed\n */\n activate() {\n if (this._onAfterUnbindObserver || !this._sourceTexture) {\n return;\n }\n this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(() => {\n var _engine$_debugPushGro, _engine$_debugPopGrou;\n const engine = this._camera.getScene().getEngine();\n (_engine$_debugPushGro = engine._debugPushGroup) === null || _engine$_debugPushGro === void 0 || _engine$_debugPushGro.call(engine, `min max reduction`, 1);\n this._reductionSteps[0].activate(this._camera);\n this._postProcessManager.directRender(this._reductionSteps, this._reductionSteps[0].inputTexture, this._forceFullscreenViewport);\n engine.unBindFramebuffer(this._reductionSteps[0].inputTexture, false);\n (_engine$_debugPopGrou = engine._debugPopGroup) === null || _engine$_debugPopGrou === void 0 || _engine$_debugPopGrou.call(engine, 1);\n });\n this._activated = true;\n }\n /**\n * Deactivates the reduction computation.\n */\n deactivate() {\n if (!this._onAfterUnbindObserver || !this._sourceTexture) {\n return;\n }\n this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver);\n this._onAfterUnbindObserver = null;\n this._activated = false;\n }\n /**\n * Disposes the min/max reducer\n * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.\n */\n dispose(disposeAll = true) {\n if (disposeAll) {\n this.onAfterReductionPerformed.clear();\n if (this._onContextRestoredObserver) {\n this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver);\n this._onContextRestoredObserver = null;\n }\n }\n this.deactivate();\n if (this._reductionSteps) {\n for (let i = 0; i < this._reductionSteps.length; ++i) {\n this._reductionSteps[i].dispose();\n }\n this._reductionSteps = null;\n }\n if (this._postProcessManager && disposeAll) {\n this._postProcessManager.dispose();\n }\n this._sourceTexture = null;\n }\n}","map":{"version":3,"names":["Observable","PostProcess","PostProcessManager","MinMaxReducer","constructor","camera","onAfterReductionPerformed","_forceFullscreenViewport","_activated","_camera","_postProcessManager","getScene","_onContextRestoredObserver","getEngine","onContextRestoredObservable","add","_rebuild","sourceTexture","_sourceTexture","setSourceTexture","depthRedux","type","forceFullscreenViewport","dispose","_reductionSteps","scene","reductionInitial","undefined","autoClear","w","getRenderWidth","h","getRenderHeight","onApply","effect","setTexture","setFloat2","push","index","Math","max","round","reduction","width","height","setInt2","func","buffer","Float32Array","minmax","min","_readTexturePixels","inputTexture","texture","notifyObservers","onAfterRenderObservable","refreshRate","value","activated","activate","_onAfterUnbindObserver","onAfterUnbindObservable","_engine$_debugPushGro","_engine$_debugPopGrou","engine","_debugPushGroup","call","directRender","unBindFramebuffer","_debugPopGroup","deactivate","remove","disposeAll","clear","i","length"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Misc/minMaxReducer.js"],"sourcesContent":["\nimport { Observable } from \"./observable.js\";\nimport { PostProcess } from \"../PostProcesses/postProcess.js\";\nimport { PostProcessManager } from \"../PostProcesses/postProcessManager.js\";\nimport \"../Shaders/minmaxRedux.fragment.js\";\n/**\n * This class computes a min/max reduction from a texture: it means it computes the minimum\n * and maximum values from all values of the texture.\n * It is performed on the GPU for better performances, thanks to a succession of post processes.\n * The source values are read from the red channel of the texture.\n */\nexport class MinMaxReducer {\n /**\n * Creates a min/max reducer\n * @param camera The camera to use for the post processes\n */\n constructor(camera) {\n /**\n * Observable triggered when the computation has been performed\n */\n this.onAfterReductionPerformed = new Observable();\n this._forceFullscreenViewport = true;\n this._activated = false;\n this._camera = camera;\n this._postProcessManager = new PostProcessManager(camera.getScene());\n this._onContextRestoredObserver = camera.getEngine().onContextRestoredObservable.add(() => {\n this._postProcessManager._rebuild();\n });\n }\n /**\n * Gets the texture used to read the values from.\n */\n get sourceTexture() {\n return this._sourceTexture;\n }\n /**\n * Sets the source texture to read the values from.\n * One must indicate if the texture is a depth texture or not through the depthRedux parameter\n * because in such textures '1' value must not be taken into account to compute the maximum\n * as this value is used to clear the texture.\n * Note that the computation is not activated by calling this function, you must call activate() for that!\n * @param sourceTexture The texture to read the values from. The values should be in the red channel.\n * @param depthRedux Indicates if the texture is a depth texture or not\n * @param type The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)\n * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)\n */\n setSourceTexture(sourceTexture, depthRedux, type = 2, forceFullscreenViewport = true) {\n if (sourceTexture === this._sourceTexture) {\n return;\n }\n this.dispose(false);\n this._sourceTexture = sourceTexture;\n this._reductionSteps = [];\n this._forceFullscreenViewport = forceFullscreenViewport;\n const scene = this._camera.getScene();\n // create the first step\n const reductionInitial = new PostProcess(\"Initial reduction phase\", \"minmaxRedux\", // shader\n [\"texSize\"], [\"sourceTexture\"], // textures\n 1.0, // options\n null, // camera\n 1, // sampling\n scene.getEngine(), // engine\n false, // reusable\n \"#define INITIAL\" + (depthRedux ? \"\\n#define DEPTH_REDUX\" : \"\"), // defines\n type, undefined, undefined, undefined, 7);\n reductionInitial.autoClear = false;\n reductionInitial.forceFullscreenViewport = forceFullscreenViewport;\n let w = this._sourceTexture.getRenderWidth(), h = this._sourceTexture.getRenderHeight();\n reductionInitial.onApply = ((w, h) => {\n return (effect) => {\n effect.setTexture(\"sourceTexture\", this._sourceTexture);\n effect.setFloat2(\"texSize\", w, h);\n };\n })(w, h);\n this._reductionSteps.push(reductionInitial);\n let index = 1;\n // create the additional steps\n while (w > 1 || h > 1) {\n w = Math.max(Math.round(w / 2), 1);\n h = Math.max(Math.round(h / 2), 1);\n const reduction = new PostProcess(\"Reduction phase \" + index, \"minmaxRedux\", // shader\n [\"texSize\"], null, { width: w, height: h }, // options\n null, // camera\n 1, // sampling\n scene.getEngine(), // engine\n false, // reusable\n \"#define \" + (w == 1 && h == 1 ? \"LAST\" : w == 1 || h == 1 ? \"ONEBEFORELAST\" : \"MAIN\"), // defines\n type, undefined, undefined, undefined, 7);\n reduction.autoClear = false;\n reduction.forceFullscreenViewport = forceFullscreenViewport;\n reduction.onApply = ((w, h) => {\n return (effect) => {\n if (w == 1 || h == 1) {\n effect.setInt2(\"texSize\", w, h);\n }\n else {\n effect.setFloat2(\"texSize\", w, h);\n }\n };\n })(w, h);\n this._reductionSteps.push(reduction);\n index++;\n if (w == 1 && h == 1) {\n const func = (w, h, reduction) => {\n const buffer = new Float32Array(4 * w * h), minmax = { min: 0, max: 0 };\n return () => {\n scene.getEngine()._readTexturePixels(reduction.inputTexture.texture, w, h, -1, 0, buffer, false);\n minmax.min = buffer[0];\n minmax.max = buffer[1];\n this.onAfterReductionPerformed.notifyObservers(minmax);\n };\n };\n reduction.onAfterRenderObservable.add(func(w, h, reduction));\n }\n }\n }\n /**\n * Defines the refresh rate of the computation.\n * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...\n */\n get refreshRate() {\n return this._sourceTexture ? this._sourceTexture.refreshRate : -1;\n }\n set refreshRate(value) {\n if (this._sourceTexture) {\n this._sourceTexture.refreshRate = value;\n }\n }\n /**\n * Gets the activation status of the reducer\n */\n get activated() {\n return this._activated;\n }\n /**\n * Activates the reduction computation.\n * When activated, the observers registered in onAfterReductionPerformed are\n * called after the computation is performed\n */\n activate() {\n if (this._onAfterUnbindObserver || !this._sourceTexture) {\n return;\n }\n this._onAfterUnbindObserver = this._sourceTexture.onAfterUnbindObservable.add(() => {\n const engine = this._camera.getScene().getEngine();\n engine._debugPushGroup?.(`min max reduction`, 1);\n this._reductionSteps[0].activate(this._camera);\n this._postProcessManager.directRender(this._reductionSteps, this._reductionSteps[0].inputTexture, this._forceFullscreenViewport);\n engine.unBindFramebuffer(this._reductionSteps[0].inputTexture, false);\n engine._debugPopGroup?.(1);\n });\n this._activated = true;\n }\n /**\n * Deactivates the reduction computation.\n */\n deactivate() {\n if (!this._onAfterUnbindObserver || !this._sourceTexture) {\n return;\n }\n this._sourceTexture.onAfterUnbindObservable.remove(this._onAfterUnbindObserver);\n this._onAfterUnbindObserver = null;\n this._activated = false;\n }\n /**\n * Disposes the min/max reducer\n * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.\n */\n dispose(disposeAll = true) {\n if (disposeAll) {\n this.onAfterReductionPerformed.clear();\n if (this._onContextRestoredObserver) {\n this._camera.getEngine().onContextRestoredObservable.remove(this._onContextRestoredObserver);\n this._onContextRestoredObserver = null;\n }\n }\n this.deactivate();\n if (this._reductionSteps) {\n for (let i = 0; i < this._reductionSteps.length; ++i) {\n this._reductionSteps[i].dispose();\n }\n this._reductionSteps = null;\n }\n if (this._postProcessManager && disposeAll) {\n this._postProcessManager.dispose();\n }\n this._sourceTexture = null;\n }\n}\n"],"mappings":"AACA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,iCAAiC;AAC7D,SAASC,kBAAkB,QAAQ,wCAAwC;AAC3E,OAAO,oCAAoC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,CAAC;EACvB;AACJ;AACA;AACA;EACIC,WAAWA,CAACC,MAAM,EAAE;IAChB;AACR;AACA;IACQ,IAAI,CAACC,yBAAyB,GAAG,IAAIN,UAAU,CAAC,CAAC;IACjD,IAAI,CAACO,wBAAwB,GAAG,IAAI;IACpC,IAAI,CAACC,UAAU,GAAG,KAAK;IACvB,IAAI,CAACC,OAAO,GAAGJ,MAAM;IACrB,IAAI,CAACK,mBAAmB,GAAG,IAAIR,kBAAkB,CAACG,MAAM,CAACM,QAAQ,CAAC,CAAC,CAAC;IACpE,IAAI,CAACC,0BAA0B,GAAGP,MAAM,CAACQ,SAAS,CAAC,CAAC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