Add renderer backend and reversedDepthBuffer properties, pass multiview option to WebGPURenderer#5847
Open
vincentfretin wants to merge 3 commits into
Open
Conversation
…ew to WebGPURenderer - multiviewStereo is now also passed as the multiview option used by WebGPURenderer (fixes aframevr#5749) - new reversedDepthBuffer property passed to both WebGLRenderer and WebGPURenderer - new backend property (webgpu or webgl) mapped to the forceWebGL option of WebGPURenderer; ignored by WebGLRenderer Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…derer config tests WebGPURenderer initializes its backend asynchronously via init(). Previously renderStarted was set and renderstart emitted while the backend was still initializing (three.js setAnimationLoop recovers by awaiting init internally, but anything reacting to renderstart could call renderer methods that throw before initialization). The render loop kickoff now awaits renderer.init() when it exists; WebGLRenderer has no init method and keeps the synchronous path. Extract getRendererConfig() from setupRenderer() so the renderer attribute parsing is unit-testable without creating a WebGL context, and add tests for multiviewStereo/multiview, reversedDepthBuffer, backend and the async init behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
setPoseTarget is an A-Frame specific patch in super-three to the WebXRManager used by WebGLRenderer. An equivalent will need to be implemented in super-three for the XRManager used by WebGPURenderer when WebXR support for WebGPURenderer is added. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5749
New renderer properties
multiviewStereois now also passed as themultiviewoption used byWebGPURenderer(WebGLRendererkeeps readingmultiviewStereo, each renderer ignores the other's key).reversedDepthBufferproperty, passed as-is to bothWebGLRendererandWebGPURenderer.backendproperty (webgpuorwebgl):backend: webglmaps to theforceWebGLoption ofWebGPURenderer. When unset, nothing is passed so the WebGPU build keeps its current behavior (try WebGPU, fall back to WebGL2). Ignored byWebGLRenderer.Wait for async renderer init before starting the render loop
WebGPURendererinitializes its backend asynchronously viainit(). PreviouslyrenderStartedwas set andrenderstartemitted while the backend was still initializing (three.jssetAnimationLooprecovers by awaiting init internally, but anything reacting torenderstartcalling e.g.renderer.render()orcompileAsync()would throw.render() called before the backend is initialized). The render loop kickoff now awaitsrenderer.init()when it exists;WebGLRendererhas noinitmethod and keeps the fully synchronous path.Tests
The renderer attribute parsing is extracted from
setupRenderer()intogetRendererConfig()so it is unit-testable without creating a WebGL context (setupRendereris stubbed on CI). Added tests formultiviewStereo/multiview,reversedDepthBuffer,backendand the async init behavior. There were no existing tests coveringmultiviewStereo.Also adds a code note that
setPoseTarget(A-Frame specific super-three patch toWebXRManager) will need an equivalent in theXRManagerused byWebGPURendererwhen WebXR support is added.Verified at runtime with both builds (
npm run devandnpm run start:webgpu) driving headless Chrome: options reach the renderer (backend.isWebGLBackend,reversedDepthBuffer,xr._useMultiviewIfPossible) andrenderer.initializedis nowtruewhenrenderstartfires. Actual multiview rendering in VR still needs a headset test withexamples/performance/multiview-extension.🤖 Generated with Claude Code