WebGL Libraries and Frameworks, Unity 3d Transpiles, and More
To date, much of the work with the emerging WebVR spec has been done using a single code library – the popular THREE.js, creation of Mr. Doob. The current webvr-polyfill implicitly assumes that THREE is being use, and in fact spits out a console message when THREE is not installed.
However, WebVR doesn’t require THREE.js. The basic WebVR examples created by Toji all use basic WebGL, without a library. And, there are other libraries that might be used to create VR worlds. And there are other implementations, all of which support the emerging WebVR spec to varying degrees.
- has a Unity style development environment, WebVR plugin, free version runs online, built-in modules for many common operations (e.g. event listeners), dev environment attaches scripts to objects and scenes, reduced coding.
- also has an online development environment. Developer WebVR support (Aug 2016) seems limited
- focused on Minecraft-style environments using (you guessed it) voxels. Voxel editor, WebVR Plugin
- One of the first WebGL libraries, focused on 3D game development. No support for WebGL in current (Aug 2016) versions.
More detailed comparisons:
In addition, popular frameworks using C++ or C# can be “transpiled” to Asm.js, and will also run with WebGL:
- Unreal Engine 4
Why Not Go with The Big Players?
The BIG problem for Unreal and Unity (which might be the natural choice of game developers is size. Unity used to have a web “plugin” but like Adobe Flash, these don’t work anymore. Chrome killed plugin support in version 42, and Microsoft Edge jettisons ActiveX plugins in favor of web standards.
Also, the version of WebGL in browsers today, OpenGL ES, is more primitive than the 3D api used by Unity and Unreal, so some advanced techniques wouldn’t work.
On the other hand, Unity and Unreal (which I haven’t tried directly) have to go through the transpile step, resulting in massive code bloat. A program that could be implement in THREE.js in a few hundred lines will be a multi-megabyte download if transpiled from Unity. The resulting code is also highly browser-dependent, running slowly on some browsers and faster on others, ghough some reports say that the Unity transpiles have more constant framerates.
- In addition, support for smartphone-based environments is limited:
If you’re already familiar with game development in a GUI, PlayCanvas might be the best choice. Unlike the transpiled versions of Unity and Unreal, you’ll get small, fast-running code optimized for the web. But PrimroseVR definitely deserves a look -unlike PlayCanvas it is being build specifically for Virtual Reality.
Finally, if you’re a diehard Unity fan or otherwise locked into Unity or Unreal frameworks, use the transpiler. The resulting code will be large, and you’ll have to pay attention to the limited support for OpenGL in current browsers. However, these editing environments have a large base of developers, and may be they way to bridge to WebVR.