immersive-web / webxr-samples

Samples to demonstrate use of the WebXR Device API
https://immersive-web.github.io/webxr-samples/
MIT License
995 stars 479 forks source link

cancel rAF for inline when immersive-ar starts #54

Open blairmacintyre opened 4 years ago

blairmacintyre commented 4 years ago

The immersive-ar-session sample starts with an inline session and then adds another session for immersive-ar. It starts a rAF loop for each, resulting in double rendering.

The native implementation may implicitely cancel the rAF on the inline session, but that doesn't technically seem right. The webxr-polyfill does not do this.

This update cancels the inline rAF before starting the immersive rAF.