Webxr rendere.setFramebuffer() is not a function

In the Webxr codelab demo, they bind the graphics framebuffer to the baseLayer’s framebuffer, and then set the buffer to renderer.

renderer.setFramebuffer(framebuffer);

With the later version of three js setFramebuffer() method is not defined. What is the alternative solution to use the setFrameBuffer method?

There is no alternative.

The internal WebXRManager used setFramebuffer() for its framebuffer management. The method was never meant to be part of the public API. After a refactoring for r127 setFramebuffer() has been removed.

So you can’t upgrade the demo’s code to the latest three.js version. If you want to build AR applications based on WebXR, check out how the official AR examples are implemented:

https://threejs.org/examples/?q=webxr

1 Like