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

WebGL: Reflections and Refractions in GLGE

May 9th, 2010

GLGE now has a render to texture feature within the material system. In addition to rendering to texture GLGE also has common transforms built-in which allows you to create complex effects such as water with only a few lines of mark up. I’ve put together a demo showing how to achieve a water effect with reflections and refractions. The interesting part is that to define the material only took a few lines of XML:

Although this demo show water many other effects can be achieved, reflections on floors mirrors etc. Hopefully it will also allow for portals between scenes shortly, but is currently limited to cameras in the same scene.  This feature is not currently working in firefox and you will need a nightly of a webkit browser to view the demo since the RTT is using the DEPTH_STENCIL_ATTACHMENT which has yet to make it into firefox, fingers crossed it won’t be long!

Try Live Demo

The Video: