How to get WebVR Polyfill working with ThreeJS r98

Hello,

Presenting VR content to an Android phone using Chrome is working for me, this is because the (experimental) WebVR API is supported in that browser (either by enabling the flag, or using an origin trial token).

Now I’m trying to use the WebVR Polyfill to be able to make it work for iPhones as well. The examples of that polyfill work on the iPhone 6S in Safari.

On that site it says:

Be sure to instantiate the polyfill before calling any of your VR code! The polyfill needs to patch the API if it does not exist so your content code can assume that the WebVR API will just work.

I initialize the Polyfill before creating a new instance of WebGLRenderer and activating VR. When I activate VR I get working left/right eye cameras and the gyro information is used for rotating the view. But I get rendering artifacts, most of the eye camera’s are rendering a black color, only some scene objects are partly visible and flicker a lot (being obscured by black), it might be related to far/near clipping plane settings, or maybe I need to tweak properties of the polyfill config.

I came across WebVR Boilerplate but that seems to be outdated using r84 and VREffect and VRControls that no longer exist in r98.

I must me missing something and help would be appreciated.

Greets,
n2k

Have you considered to open an issue at:

I’ve not seen many issue in the past related to WebVR Polyfill so I’m not sure if this forum will provide a solution for you.

Thanks for your answer, it would make sense to do that.
Although I figured it out myself. It was caused by not clearing the renderer (I have autoClear disabled) when VR was enabled… oops :stuck_out_tongue: