What is GLGE?

GLGE is a javascript library intended to ease the use of WebGL; which is basically a native browser javascript API giving direct access to openGL ES2, allowing for the use of hardware accelerated 2D/3D applications without having to download any plugins.

The aim of GLGE is to mask the involved nature of WebGL from the web developer, who can then spend his/her time creating richer content for the web.

Get GLGE v0.2

NEW Release:GLGE V0.2

March 7th, 2010
As you may now be aware I’m not very good at drawing a line and issuing a release; there always seems too much left to do. So, I’ve been killing as many bugs as possible the last couple of weeks and fixing shader issues, adding parallax mapping and I can now say that GLGE v0.2 is go.  Since the last release there have been a lot of new additions, including:
  • shadow
  • collada support
  • gpu picking
  • fog
  • text rendering
  • parrallax mapping
  • and many optimizations
I’ve put together a little demo showing off some of the new features; it’s quite large so may take awhile to load on slower connections. I wanted to do something a little more involved but I think that will have to wait for the next release:
Try the demo
The Video
Features in the works, that will be coming in the coming weeks/months:
  • Some better documention and tutorials
  • software picking
  • particle system
  • cube mapping
  • reflections
  • refractions
  • physics
  • and much much more
On a slight side note, something that is definitely worth a look, katalabs have release a very impressive demo of webgl:
http://www.katalabs.com/blog/
A few credits for the models used in the GLGE demo above, if I’ve missed someone off shout:
entertainment cabinet – trigram_QWQ
http://www.jintudesigns.com/free-3d-models.html
table and chairs –  © Google CEO at Google Warehouse
sofa – © resources.blogscopia
http://www.3dvia.com/mgbaron/models/B6335AACBE90A2B4
coffee table – © Alexandre BRETHEAU
http://www.3dvia.com/Le_Faya/models/1AAC3E1022340618

COLLADA now supported

February 16th, 2010

I’m back now and fully back in to the swing of things. While I’ve been gone others have been busy, checkout this excellent brain visualization created by Phil Mercurio using GLGE, very impressive and very high poly:

http://thyrd.org/brain

I’m running a little behind schedule on GLGE at the moment but I’ve managed to get native COLLADA support working. The addition of COLLADA meant adding of a couple of other very useful new features to the core api. GLGE now has multimaterial support and also a new group class to allow for transform hierarchies(very useful for animation, and hopefully culling on larger scenes).

The COLLADA support is still a work in progress, there is no animation yet, and it’s not 100% reliable, but it’s on it’s way. I’ve put together a small demo with a few models from www.collada.org:

View Demo – Remember you need a webGL enabled Browser

Video

Version 0.2 of GLGE is coming soon I just want to iron out some bugs and tidy things and maybe include do a demo to showcase the features added since 0.1.

Text Rendering Demo

January 31st, 2010

This weeks big new feature is the addition of text rendering. I’ve also added a billboard option that will point the z-axis of any object towards the camera or any other object.

See the live demo

Video:

There has also been lots of changes behind the scenes. The animation system has been fixed and improved. It’s now posible to animate using linear intoperlation(finally) as well as animate discrete steps and set non-numeric values. This may well be the last big update for the next couple of weeks as I’m off on a family holiday next weekend.

Fog now supported

January 24th, 2010

I’ve finally added the long promised fog. As it was a quick and easy addition, I’ve also done a lot of optimisations including replacing Sylvester with GLGE optimised math functions. Guesstimate is that performance gains this week are ~20%. I was hoping to add some frustum culling of objects as well but there just aren’t enough hours in the day, but I’m sure I’ll get it done soon. Hopefully, I’ll be getting the animation system up to scratch this coming week.

Try the live fog demo

Heres the video:

Picking Added

January 17th, 2010

Well another week and another new feature. Since I’ve really only had one sort of feature request from anyone I decieded to give it top priority and implement it ASAP. This turned out to be more challenging then I had first thought, mainly due to hours trying to find a stupid mistake I made early on :-( I’ve still got to do some optimization, but it’s reasonable performance at the moment.
Read the rest of this entry »

Implemented Shadows

January 10th, 2010

Shadows are finally working in GLGE. It’s taken a little longer then expected as rendering a depth map to a texture doesn’t seem to be working in any browsers and checking out the firefox code it would seem it’s just not supported there yet.  Until it is, It’s been hacked a bit encoding and decoding the depth from the rgb values. It works but it’s a more intensive an operation then it should be so spares use is recomended! This one works on firefox but I’m getting slow frame rates and I’m still not sure why, the JS isn’t that that complex and the frame rate is fine on chromium so it’s not the GFX card end either.

In addition this week I’ve added parsing of color values attributes in the XML so you can now specfy light/material colours using the normal HTML syntax ie “#ff0000″ “red” “rgb(255,0,0)”.

Click here to view the latest demo

Demo Video:

GLGE Demo Scene

January 2nd, 2010

This week I’ve taken a bit of a break on the coding. I instead decided to spend a few days coming up with a more impressive demo. Please bare in mind I’m no pro CG artist, just a now and then amateur, so  imagine what could be achieved by the pros in a very short space of time. It’s not showing off 100% of the current feature set, some of which I think still needs rewriting and finishing off. But, hopefully it’ll be enough to change the mind of at least some of the WebGL naysayers, encourage more rapid development and make 2010 the year of 3D on the web. Read the rest of this entry »

New Website

January 2nd, 2010

I finally got round to creating this website for the GLGE WebGL Library/Engine. It’s a bit of a slapdash job (I’m sure it probably looks awful on IE) as I didn’t want to spend too long on the website when I should really be coding. I’ve only included a couple of forums as I know all too often they just sit there doing nothing, if they prove popular I’ll make more of an effort ;-) .

I’ll attempt to keep the doc inline with the current release, but I’m sure it’ll be one of those things that get forgotten so please feel free to poke if they end up out of date.

Getting WebGL

December 30th, 2009

WebGL is currently is currently only supported in the latest builds of most of the browsers. It should be working in offical releases soon but in the meantime there is a little effort required to enable it.

Chromium

Chromium continuous builds for Linux, Mac OS X, and Windows. The most recent builds are available at:
Linux 32-bit: http://build.chromium.org/buildbot/continuous/linux/LATEST/
Linux 64-bit: http://build.chromium.org/buildbot/snapshots/chromium-rel-linux-64/
Mac OS X: http://build.chromium.org/buildbot/continuous/mac/LATEST/
Windows: http://build.chromium.org/buildbot/continuous/win/LATEST/
Download the latest viersion and unpack the file. Chromium also requires some additional command line switches to run:
Linux: ./chrome –no-sandbox –enable-webgl
Mac OS X: Chromium.app/Contents/MacOS/Chromium –no-sandbox –enable-webgl
Windows: chrome.exe –no-sandbox –enable-webgl

Firefox

On Firefox, WebGL is supported on the latest nightly builds:
Visit http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/ for builds on Linux (32- and 64-bit), Mac OS X and Windows.

To enable WebGL you will need to type about:config into the address bar, search for “webgl” and set the value of “webgl.enabled_for_all_sites” to true. The implementation does require OpenGL 2.1 drivers, there is a software rendering option which uses OSMesa but chances are it will be way too slow for most of the demos anywary.

Safari

WebGL is supported on newer version of OSX in the WebKit nightly builds available at
http://nightly.webkit.org/ .

Download and install then you will need to open the Terminal and enter:

defaults write com.apple.Safari WebKitWebGLEnabled -bool YES

This only needs to be run the first time and it will remember for the future.