immersive-web / cardboard-vr-display

A JavaScript implementation of a WebVR 1.1 VRDisplay
https://immersive-web.github.io/cardboard-vr-display
Apache License 2.0
91 stars 43 forks source link

Fixed an issue for apps that use instancing #39

Closed toji closed 4 years ago

toji commented 4 years ago

Apps which leave an instancing divisor on a vertex attribute prior to frame submission could cause the cardboard distortion rendering to break. This change ensures that the two vertex attributes used by the distortion rendering are set to 0 prior to rendering, and restores the divisor state afterwards if needed.

jsantell commented 4 years ago

Oof nice find @toji! Do you think it necessary to publish+uplift to polyfills with this?

toji commented 4 years ago

Yeah, that was my hope. I'm seeing the bug on one of my pages when using the cardboard polyfill route.