Mozilla Ports Full FPS Engine to WebGL; Playable Demo

Firefox developer Mozilla updated its blog with news of BananaBread, a first-person shooter that runs within a browser without the need to install plugins. To make the demo happen, the team said it ported a complete C++ game engine -- the open-source Cube 2: Sauerbraten -- to JavaScript and WebGL using Emscripten. The project required very few code modifications to the original game, the team said, which demonstrates that porting games to the Web does not have to be difficult.

"The project has several goals," reads the BananaBread blog. "First, to serve as a testcase for running a demanding 3D game in browsers: Having a working testcase lets us try out new browser features and to profile performance in order to make browsers faster. Another goal is to prove that games of this nature can run in JavaScript and WebGL, which many people are skeptical about. Finally, all the code in this project is open (and practically all the art assets), so others can learn from this effort and use this code to create their own browser games."

Here are all the technologies that Mozilla's Firefox 15 is now using to bring top-notch games to browsers:

* Game focused performance improvements to JavaScript, many inspired by games and demos that we saw on the Web or that developers sent to us for testing
* Wide range of WebGL performance improvements
* High precision timing
* Compressed texture support on desktop
* Smoother JavaScript execution on large code bases
* Hardware acceleration of 2D canvas on desktop
* FullScreen API
* PointerLock API (special thanks to David Humphrey and students at Seneca College)
* OrientationLock

"One of the main goals of the Mozilla Community working on games is to not only drive game development on Firefox but across all browsers," Mozilla said. "Any browser that has implemented the necessary modern Web standards used by the BananaBread demo can run it. These efforts help us stay in touch with how HTML5 is coming together and see opportunities where we can make developers’ lives easier. Hearing directly from the HTML5 game developer community is a key part of how we learn what needs to be done."

Mozilla's new BananaBread demo offers three playable maps against bots: Arena, Two Towers and Lava Chamber (Quake fans, are we?). If the demo isn't loading even though Firefox 15 has WebGL enabled, then the browser might have your GPU blacklisted anyway. Mozilla will blacklist a specific GPU based on its driver version:

Nvidia: requires driver numbered or greater
AMD: requires driver numbered 8.741.0.0 or greater
Intel: requires driver number 6.14.11 on XP, 7.15.10 on Vista, and 8.15.10 on Windows 7

OF course, this becomes a problem when hardware vendors and OEMS stop producing drivers for legacy products (older cards, laptops, etc.). There's a workaround/blacklist bypass in Firefox, but proceed at your own risk -- we don't take responsibility for any flaming GPUs. Simply click on the address bar in Firefox and type about:config. After that , make the following three changes:

* To enable WebGL, set webgl.force-enabled to true
* To enable Layers Acceleration, set layers.acceleration.force-enabled to true
To enable Direct2D in Windows Vista/7, set gfx.direct2d.force-enabled to true

If the demo performs like you're moving against a nasty rip current (below 20fps), then there's probably a good reason why Mozilla blacklisted your GPU.


Contact Us for News Tips, Corrections and Feedback

Create a new thread in the US News comments forum about this subject
This thread is closed for comments
Comment from the forums
    Your comment
  • CaedenV
    Very cool.
  • tomsreader
    where's the link to download the game?
  • amk09
    Was waiting for something like this. It runs good, I was playing it on an i3-2120 with HD2000 graphics. The developers did it well and I like where this could go.