Saturday, April 3, 2010

WebGL Experiments

Over the past few days, I've been doing some experiments with WebGL. For those that haven't head, WebGL is part of the new HTML 5 standard. It allows for native, 3D graphics inside a webbrowser (without the use of plugins).

Currently, the big browsers (Chrome, FireFox, IE, etc) have not released official support for WebGL. The only way to access the new technology is if you download the development versions of those said browsers.

Using Chromium, I managed to setup an running example of WebGL powered by Google Web Toolkit. The program was basically 1 spinning triangle:

This simple program ran at a constant 220-250 frames-per-second. Not bad you say...but wait, there's more.

The machine I was running it on has duel NVIDIA GeForce GTX 280's inside as well as 4 Intel Core i7 Processors. I can only image that those with more "average" system specs might only achieve an FPS of 30-60.

And remember, where talking about ONE spinning triangle. Sure, it looks cool, but imagine adding physics, textures, pathfinding, menus, MULTIPLAYER, etc.

I realize this is an early version of WebGL, but still... Take a look at my current game, Canine Combat:

It's rendering terrain, a skybox, high-poly modles, calculating physics and collision, and (running on the exact same system) is performing at 900 frames a second.

Its not WebGL itself that is slow, but the fact that you have to write it in javascript, which is inherently slow. For now, Flash will retain it's place as the leading technology in online games.