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.9

Fork me on GitHub

Vehicle Physics in WebGL using GLGE and JigLibJS

July 25th, 2011

I finally have a nice simple implementation of vehicle physics working in GLGE. It’s not using the vehicle classes directly from jiglibflash, as they proved to be very difficult to get working correctly. Instead, it’s a new model which relies on the lower level jiblib classes. It’s slightly simpler than the original jiglibflash version to making things easier to tweak. Adding a new vehicle in GLGE is simply a matter of defining the car class, adding the wheels and then attaching the objects that are to represent them ie:

Or alternatively if you’d prefer to use the API:

In addition to car physics I’ve also added some support for fallback materials. This allows a material to be specified which will be used if the original material fails to work on a particular machine (eg, failing to compile because of too many varyings).

I’ve published a simple demo of vehicle physics in the github repo demonstrating it’s use, but I’ve also put together a more advanced demo to show what can be achieved with only a little effort:

Live Demo of Vehicle Physics

In case you are currently lacking a WebGL browser, here’s the video:

WebGL Demo: Sky and New Fog options in GLGE

April 13th, 2011

Having the need to create a more elegant blend to the sky recently I was finding the current fog system lacking in that no matter what set up I was attempting there was always a seam between the land and sky.

As a consequence GLGE now has a sky shader system. Which allows for procedural skies or ordinary sky boxes; in addition, there are two new fog options FOG_SKYLINEAR and FOG_SKYQUADRATIC. These two new fog options allow you to fade the far distance into the sky as apposed to a solid colour. This results in a more seamless transition from land to sky. There is still an issue when using it in combination with post processing effects but for general purpose use it’s very easy to set up and use. This is an early first attempt I have a few ideas for improvments that will hopefully come through at some point.

Live Demo