{"record":{"id":"414e66a4a3360470","repo":"BabylonJS/Babylon.js","slug":"invalid-space-warp-framebuffer","errorCode":null,"errorMessage":"Invalid Space Warp framebuffer","messagePattern":"Invalid Space Warp framebuffer","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Engines/Extensions/engine.multiview.pure.ts","lineNumber":124,"sourceCode":"        } else {\r\n            // eslint-disable-next-line no-throw-literal\r\n            throw \"Invalid multiview frame buffer\";\r\n        }\r\n    };\r\n\r\n    Engine.prototype.bindSpaceWarpFramebuffer = function (_spaceWarpTexture: RenderTargetWrapper) {\r\n        const spaceWarpTexture = _spaceWarpTexture as WebGLRenderTargetWrapper;\r\n\r\n        const gl: any = this._gl;\r\n        const ext = this.getCaps().oculusMultiview || this.getCaps().multiview;\r\n\r\n        this.bindFramebuffer(spaceWarpTexture, undefined, undefined, undefined, true);\r\n        gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, spaceWarpTexture._framebuffer);\r\n        if (spaceWarpTexture._colorTextureArray && spaceWarpTexture._depthStencilTextureArray) {\r\n            ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, spaceWarpTexture._colorTextureArray, 0, 0, 2);\r\n            ext.framebufferTextureMultiviewOVR(gl.DRAW_FRAMEBUFFER, gl.DEPTH_ATTACHMENT, spaceWarpTexture._depthStencilTextureArray, 0, 0, 2);\r\n        } else {\r\n            throw new Error(\"Invalid Space Warp framebuffer\");\r\n        }\r\n    };\r\n\r\n    Camera.prototype._useMultiviewToSingleView = false;\r\n\r\n    Camera.prototype._multiviewTexture = null;\r\n\r\n    Camera.prototype._resizeOrCreateMultiviewTexture = function (width: number, height: number) {\r\n        if (!this._multiviewTexture) {\r\n            this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });\r\n        } else if (this._multiviewTexture.getRenderWidth() != width || this._multiviewTexture.getRenderHeight() != height) {\r\n            this._multiviewTexture.dispose();\r\n            this._multiviewTexture = new MultiviewRenderTarget(this.getScene(), { width: width, height: height });\r\n        }\r\n    };\r\n\r\n    Scene.prototype._transformMatrixR = Matrix.Zero();\r\n\r","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Engines/Extensions/engine.multiview.pure.ts#L106-L142","documentation":"When using WebVR/XR Space Warp, Babylon binds the space warp texture's framebuffer and attaches multiview texture arrays via the OVR_multiview2 extension. If either _colorTextureArray or _depthStencilTextureArray is missing on the texture, the binding cannot proceed and this error is thrown. It indicates the space warp render target was created without the required multiview texture arrays (extension or creation path failed).","triggerScenarios":"Enabling Space Warp (webXRSessionManager.enableSpaceWarp()) when the underlying texture was created without OVR_multiview2 texture arrays — e.g. the framebufferTextureMultiviewOVR extension is unavailable or the texture was not produced by the multiview creation path.","commonSituations":"Devices/drivers lacking OVR_multiview2 support; enabling space warp on non-supported XR runtimes; upgrading engine versions where texture internals (_colorTextureArray) differ; misconfigured WebXR feature flags.","solutions":["Verify OVR_multiview2 support before enabling space warp (check webGLContext extensions)","Check WebXR space warp support on the device/runtime (isSessionSupported / feature availability)","Update Babylon.js to a version where space warp texture creation matches the binding code","Disable space warp and fall back to standard XR rendering","Test on a device/runtime known to support space warp (e.g. Quest with proper runtime)"],"exampleFix":"// before\nawait webXRSessionManager.enableSpaceWarp();\n// after\nif (webXRSessionManager.session?.interactionMode && engine._gl.getExtension('OVR_multiview2')) {\n  await webXRSessionManager.enableSpaceWarp();\n} else {\n  // fall back to standard XR rendering\n}","handlingStrategy":"validation","validationCode":"const multiviewExt = engine._gl?.getExtension('OVR_multiview2');\nconst canSpaceWarp = !!multiviewExt && typeof multiviewExt.framebufferTextureMultiviewOVR === 'function';\nif (!canSpaceWarp) { /* skip enableSpaceWarp() */ }","typeGuard":"function supportsSpaceWarp(engine): boolean {\n  const ext = (engine as any)._gl?.getExtension('OVR_multiview2');\n  return !!ext && typeof ext.framebufferTextureMultiviewOVR === 'function';\n}","tryCatchPattern":"try {\n  await webXRSessionManager.enableSpaceWarp();\n} catch (e) {\n  if (String(e?.message).includes('Space Warp')) {\n    // continue without space warp\n  } else { throw e; }\n}","preventionTips":["Check OVR_multiview2 extension presence before enabling space warp","Verify device/runtime supports space warp (Quest with compatible runtime)","Pin a Babylon version where texture creation and binding internals match","Gate the feature behind a runtime capability check","Provide a non-space-warp fallback render path"],"tags":["webgl","webxr","multiview","space-warp"],"backgroundTag":"webxr-multiview-unsupported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}