Tuesday, September 22, 2009

WebGL demos

Yesterday, Vlad wrote about his awesome Spore model viewer.
This morning, I found out about 2 more new demos: Puls and a demo of the Escher-Droste effect.
About the Puls demo:
This is a port of Řrřola's amazing 256-byte intro Puls to WebGL. The effect is implemented as a single GLSL fragment shader, and thus runs pretty much entirely on the GPU. It was written while trying to learn more about WebGL, and also to gain better understanding of Řrřola amazing little piece of code.
I'm pretty excited about this. My first computer was an Amiga 1000 where demos were king, and I always smile when I see what people manage to cram in to the imposed limits. People are still making demos, but to try them out you have to be able to run them on your platform (if they're available to download). It's just less satisfying to watch a recorded capture on YouTube. This, on the other hand, already works in two browsers.
I'm really looking forward to seeing the first demo competition in WebGL, complete with some <audio>-tag background music.
Go grab a Firefox nightly and try it out now!


Ilmari Heikkinen said...

Here's another demo port, FRequency's 1k demo Metatunnel: http://cs.helsinki.fi/u/ilmarihe/metatunnel.html

Chris said...

Your demo has code to make it run on WebKit, but that code doesn't work as is. WebKit doesn't throw when you pass getContext a string it doesn't understand. It simply returns 0.

If you change your code from:

try {
gl = c.getContext("moz-webgl");
} catch(e) {
gl = c.getContext("webkit-3d");


gl = c.getContext("moz-webgl");
if (!gl)
gl = c.getContext("webkit-3d");

it works on both Mozilla and WebKit