Why updating to Chrome 59 came at a great price for WebVR developers.

Developing VR for the web can be quite a challenge sometimes, with browser based Virtual Reality still in its nascent stages.

We woke up one fine morning to realize that our VR showcase, was no longer working on the newest release of chrome, which the entire planet had upgraded to. The screen would simply go black and become unresponsive. Spent close to 2 days going through the codebase, trying to figure out what went wrong. Somewhere along the way, found out that chrome deprecated certain WebVR specs that we were relying on.

At first, it looked like an issue with CPU or GPU memory leak. A quick fix for this was to dispose off any geometries, textures or maps being rendered onto the screen on every frame, to see if there was a buffer overrun while rendering.

Alas, this didn’t work as expected. The upside of this, our code base and system became more efficient in terms of memory management, resulting into a manifold increase in the performance.

After having spent 2 days on trying to solve this mystery, we finally decided to not compile three.js dependencies using Google’s closure compiler and use a CDN hosted compiled script via cdn.js instead. As it turns out, the way Google’s closure compiler compiles the three.js dependencies into a UMD, were not getting recognized correctly by the browser.

Using an external script also meant that we were downloading more data than required, but overall efficiency and performance improved greatly.

Our code now runs faster and better than ever before. And so does our VR showcase!

Make your own VR/AR Experience with no coding expertise on our amazing online tool here.

Tags