{"record":{"id":"e5078fb3603fdb58","repo":"BabylonJS/Babylon.js","slug":"multiview-is-not-supported","errorCode":null,"errorMessage":"Multiview is not supported","messagePattern":"Multiview is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Engines/nullEngine.pure.ts","lineNumber":899,"sourceCode":"        texture.samples = 1;\r\n        texture.generateMipMaps = fullOptions.generateMipMaps ? true : false;\r\n        texture.samplingMode = fullOptions.samplingMode;\r\n        texture.type = fullOptions.type;\r\n\r\n        this._internalTexturesCache.push(texture);\r\n\r\n        return rtWrapper;\r\n    }\r\n\r\n    /**\r\n     * Creates a new multiview render target wrapper for headless render-state tests.\r\n     * @param width defines the width of the texture\r\n     * @param height defines the height of the texture\r\n     * @returns a new multiview render target wrapper\r\n     */\r\n    public override createMultiviewRenderTargetTexture(width: number, height: number): RenderTargetWrapper {\r\n        if (!this.getCaps().multiview) {\r\n            throw new Error(\"Multiview is not supported\");\r\n        }\r\n\r\n        const rtWrapper = this._createHardwareRenderTargetWrapper(false, false, { width, height });\r\n        const texture = new InternalTexture(this, InternalTextureSource.RenderTarget, true);\r\n\r\n        texture.baseWidth = width;\r\n        texture.baseHeight = height;\r\n        texture.width = width;\r\n        texture.height = height;\r\n        texture.isMultiview = true;\r\n        texture.isReady = true;\r\n        texture.format = Constants.TEXTUREFORMAT_RGBA;\r\n        texture.samples = 1;\r\n\r\n        rtWrapper.setTextures(texture);\r\n\r\n        return rtWrapper;\r\n    }\r","sourceCodeStart":881,"sourceCodeEnd":917,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Engines/nullEngine.pure.ts#L881-L917","documentation":"NullEngine is a headless, non-rendering engine whose capability list does not include multiview (WebVR/XR stereo rendering) unless explicitly enabled. createMultiviewRenderTargetTexture() checks getCaps().multiview and throws when the capability is absent.","triggerScenarios":"Calling nullEngine.createMultiviewRenderTargetTexture(w, h) on a default NullEngine instance (multiview cap is false).","commonSituations":"Unit tests or server-side rendering using NullEngine that exercise multiview/XR render-target code paths; copy-pasted WebXR scene setup running headless.","solutions":["Do not create multiview render targets in headless/NullEngine scenarios; use a plain render target texture.","Check engine.getCaps().multiview before calling and branch to a normal render target.","If multiview is truly required, use a real WebXR-capable engine instead of NullEngine."],"exampleFix":"// before\nconst rt = engine.createMultiviewRenderTargetTexture(512, 512);\n// after\nif (engine.getCaps().multiview) {\n  rt = engine.createMultiviewRenderTargetTexture(512, 512);\n} else {\n  rt = engine.createRenderTargetTexture(512, 512, false);\n}","handlingStrategy":"validation","validationCode":"if (!engine.getCaps().multiview) {\n  // fall back to createRenderTargetTexture\n}","typeGuard":"function supportsMultiview(e) {\n  return !!e.getCaps().multiview;\n}","tryCatchPattern":"try {\n  rt = engine.createMultiviewRenderTargetTexture(w, h);\n} catch (e) {\n  if (/Multiview is not supported/.test(e.message)) {\n    rt = engine.createRenderTargetTexture(w, h, false);\n  }\n}","preventionTips":["Always consult getCaps().multiview before XR/multiview setup.","Keep headless test scenes free of WebXR-specific targets.","Centralize render-target creation in a capability-aware factory."],"tags":["nullengine","multiview","webxr","capability-check"],"backgroundTag":"capability-not-supported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}