Fork me on GitHub

WebGL: Reflections and Refractions in GLGE

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:

Tags: , , , ,