webVR rAF custom handling

I’m using requestAnimationFrame in my own game loop (and calling engine.beginFrame(); scene.render(); engine.endFrame(); from there) with seemingly no problems. I noticed webVR has its own special implementation of rAF, and when I init a bjs vr camera I end up with duplicate controllers (oculus quest, two representations of each controller show up on screen, one active), so I’m wondering if I need to handle this special webVR rAF or if I should just be relying more heavily on the bjs implementation, putting game logic in registerBeforeRender() or something to handle the VR case?
There was also some unrendered black space on the peripheries which i figure might have to do with this wierd double render issue. Thanks!

The designed way to go is to rely on bjs so you don’t end up with this kind of issues as babylon will handle automatic switch to webvr/xr for you

Alright yeah I’ll lean that way then, thanks.

1 Like