{"ast":null,"code":"import { Texture } from \"../Materials/Textures/texture.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport \"../Shaders/vrMultiviewToSingleview.fragment.js\";\nimport \"../Engines/Extensions/engine.multiview.js\";\n/**\n * VRMultiviewToSingleview used to convert multiview texture arrays to standard textures for scenarios such as webVR\n * This will not be used for webXR as it supports displaying texture arrays directly\n */\nexport class VRMultiviewToSingleviewPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"VRMultiviewToSingleviewPostProcess\" string\n */\n getClassName() {\n return \"VRMultiviewToSingleviewPostProcess\";\n }\n /**\n * Initializes a VRMultiviewToSingleview\n * @param name name of the post process\n * @param camera camera to be applied to\n * @param scaleFactor scaling factor to the size of the output texture\n */\n constructor(name, camera, scaleFactor) {\n super(name, \"vrMultiviewToSingleview\", [\"imageIndex\"], [\"multiviewSampler\"], scaleFactor, camera, Texture.BILINEAR_SAMPLINGMODE);\n const cam = camera !== null && camera !== void 0 ? camera : this.getCamera();\n this.onSizeChangedObservable.add(() => {});\n this.onApplyObservable.add(effect => {\n if (cam._scene.activeCamera && cam._scene.activeCamera.isLeftCamera) {\n effect.setInt(\"imageIndex\", 0);\n } else {\n effect.setInt(\"imageIndex\", 1);\n }\n effect.setTexture(\"multiviewSampler\", cam._multiviewTexture);\n });\n }\n}","map":{"version":3,"names":["Texture","PostProcess","VRMultiviewToSingleviewPostProcess","getClassName","constructor","name","camera","scaleFactor","BILINEAR_SAMPLINGMODE","cam","getCamera","onSizeChangedObservable","add","onApplyObservable","effect","_scene","activeCamera","isLeftCamera","setInt","setTexture","_multiviewTexture"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/vrMultiviewToSingleviewPostProcess.js"],"sourcesContent":["import { Texture } from \"../Materials/Textures/texture.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport \"../Shaders/vrMultiviewToSingleview.fragment.js\";\nimport \"../Engines/Extensions/engine.multiview.js\";\n/**\n * VRMultiviewToSingleview used to convert multiview texture arrays to standard textures for scenarios such as webVR\n * This will not be used for webXR as it supports displaying texture arrays directly\n */\nexport class VRMultiviewToSingleviewPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"VRMultiviewToSingleviewPostProcess\" string\n */\n getClassName() {\n return \"VRMultiviewToSingleviewPostProcess\";\n }\n /**\n * Initializes a VRMultiviewToSingleview\n * @param name name of the post process\n * @param camera camera to be applied to\n * @param scaleFactor scaling factor to the size of the output texture\n */\n constructor(name, camera, scaleFactor) {\n super(name, \"vrMultiviewToSingleview\", [\"imageIndex\"], [\"multiviewSampler\"], scaleFactor, camera, Texture.BILINEAR_SAMPLINGMODE);\n const cam = camera ?? this.getCamera();\n this.onSizeChangedObservable.add(() => { });\n this.onApplyObservable.add((effect) => {\n if (cam._scene.activeCamera && cam._scene.activeCamera.isLeftCamera) {\n effect.setInt(\"imageIndex\", 0);\n }\n else {\n effect.setInt(\"imageIndex\", 1);\n }\n effect.setTexture(\"multiviewSampler\", cam._multiviewTexture);\n });\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,kCAAkC;AAC1D,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,OAAO,gDAAgD;AACvD,OAAO,2CAA2C;AAClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,kCAAkC,SAASD,WAAW,CAAC;EAChE;AACJ;AACA;AACA;EACIE,YAAYA,CAAA,EAAG;IACX,OAAO,oCAAoC;EAC/C;EACA;AACJ;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,MAAM,EAAEC,WAAW,EAAE;IACnC,KAAK,CAACF,IAAI,EAAE,yBAAyB,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,kBAAkB,CAAC,EAAEE,WAAW,EAAED,MAAM,EAAEN,OAAO,CAACQ,qBAAqB,CAAC;IAChI,MAAMC,GAAG,GAAGH,MAAM,aAANA,MAAM,cAANA,MAAM,GAAI,IAAI,CAACI,SAAS,CAAC,CAAC;IACtC,IAAI,CAACC,uBAAuB,CAACC,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC;IAC3C,IAAI,CAACC,iBAAiB,CAACD,GAAG,CAAEE,MAAM,IAAK;MACnC,IAAIL,GAAG,CAACM,MAAM,CAACC,YAAY,IAAIP,GAAG,CAACM,MAAM,CAACC,YAAY,CAACC,YAAY,EAAE;QACjEH,MAAM,CAACI,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;MAClC,CAAC,MACI;QACDJ,MAAM,CAACI,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;MAClC;MACAJ,MAAM,CAACK,UAAU,CAAC,kBAAkB,EAAEV,GAAG,CAACW,iBAAiB,CAAC;IAChE,CAAC,CAAC;EACN;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}