Sunday, September 24, 2006

Shadows in QGL

Shadows help ground models in a scene and assist with depth perception. QGL really needs shadows.

Current best practice revolves around using the stencil buffer and projecting a flattened model onto surrounding geometry, creating the illusion of a shadow. The technique often referred to as a shadow volume algorithm.

A different algorithm, with different tradeoffs, is the shadow mapping algorithm. There is even hardware support available for implementing this technique.

I'd like to implement shadow mapping in QGL, as it is likely to be much faster than a shadow volume technique. To do this, I need to get a hold of the ARB_shadow extension, which PyOpenGL doesn't (yet?) provide. I'll probably have to use ctypes, and talk to the libGL dll directly.

1 comment:

Anonymous said...

about shadows, spherical harmonics is another path that could be followed. It's quite complex ( VERY math intensive) but allow global illumination.

so when you have few objects (FPS) -> shadow volume, many (RTS) -> spherical harmonics.

I am not an expert and cannot go much farther thant that but google should help you.

Popular Posts