[World] Shader support and per pixel lighting

Daniel Phillips phillips at phunq.net
Tue Jun 26 22:31:03 PDT 2012


World Welder now has GLSL Shader support , which brings us officially into the 
21st century. Actually, it took about an hour to make the working prototype 
and another hour to fashion a nice API for it, so this is without a doubt the 
easiest "big" feature I have added so far.

The immediate application of shader support is per-pixel lighting, which is 
now included as a demo (worlds/shader.cc). Before and after teapots are 
attached. Major difference, no? The whole demo is about 50 lines, 9 of which 
are actually shader code. This is a reasonably high quality implementation of 
per-pixel phong shading.

Per pixel lighting allows coarser tessellation on many kinds of objects, like 
the 3D subdivided fonts and the bumpmap demos I showed a while back, which is 
why I took a little detour to add it in now. And of course it opens up the 
whole world of shader effects and is something a game engine has to have, when 
we get back to it. There are also quality reasons for having it in a 3D 
modeler, as the images illustrate pretty well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phunq.net/pipermail/world/attachments/20120626/8f9c170b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shader1.png
Type: image/png
Size: 95521 bytes
Desc: not available
URL: <http://phunq.net/pipermail/world/attachments/20120626/8f9c170b/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shader2.png
Type: image/png
Size: 98305 bytes
Desc: not available
URL: <http://phunq.net/pipermail/world/attachments/20120626/8f9c170b/attachment-0003.png>


More information about the World mailing list