Any better way to do shadows in OpenGL (as opposed to stencil shadows)

I just did Nehe’s tutorial lesson 27. It describes using a stencil buffer to do the shadows… I didn’t quite understand that lesson (code wasn’t commented best either) and I’ve found the stencil shadows to be quite hard to understand. Isn’t there a better way to do the shadows? Any tutorials out there?
Perhaps an extension that would simple allow for ‘glShadows(TRUE)’ :slight_smile: and everything would be done automatically? I wonder if or why not such extension is or isn’t available…
Thanks again,

They should do that. I saw one extention but its not on my card. Did hard shadows anyways not soft.

There are no extensions that just enabled shadows, but there are some extensions like GL_ARB_shadow and GL_ARB_shadow_ambient which are usefull for shadowcasting via shadowmaps.
Projected Shadowmaps are easier to implement than volumetric stencil shadows, so you may loo k at this kind of shadowing.There’s a sample-application for this technique including Sourcecode on my page, but it’s coded in Delphi so it won’t be of much use for you, but projective shadowmapping isn’t that hard.
But it has some backdraws, like problems when the object exceeds the frustum of your lightsource and heavy artifacts depending of your shadowmaps size.
If you only need static shadows, then take a look at lightmaps with precomputed shadows.