Shadow volumes

Hi everyone.

I need to make a shadows on the scene using shadow volumes algorythm.
As I searched for tutorials, all of them explains how to make shadows, casted by polygones.
And is it possible to make a shadow from a shpere (created as a primitive), for example?
It would be if I could access the vertices of my sphere…
but I don’t know how.

Halp me please…


So if your saying you cant access your vertices, does that mean your using gluSphere and the like? If so forget about using those functions. Generate the shapes yourself with either a model editing program and load the model in or by using some math to generate a sphere or something when the program loads.


Yes, I use suck functions.


Use a vertex shader which extrudes all vertices with normals facing away from the light, WAY away from the light.

If you can’t use vertex shaders (nVIDIA or ATI extensions) then you can’t use “unknown” primitives for shadow volumes.

YES you can ! You could render the object as seen from the light into a depth buffer and generate a shadow volume out of the depth map. This can be done in real time at 50 fps per second on a 600 MHz PIII with GForce 3 HW.

Have a look at the screenshots on This might inspire you. Using this technique you can use any primitives such as bezier patches, skinning with vertex weighting etc.

Tooltech, this isn’t called shadow volumes… or am I wrong ??

Tool, your web page wont let me in. It wants a username and pass. Also what you talk about is not shadow volumes but a shadow map. The geforce 3’s (and 4ti) does this in hardware in its shadow buffer hardware part.


The page wont let you in because of the point at the end of the URL.

> Tooltech, this isn’t called shadow volumes… or am I wrong ??

I think what ToolTech means is:

  • render your object into a bitmap.
  • get the shape of the rendered object using some kind of 2D Shape vectorization (ie.: in Graphics Gems V, there are 2 solution for this problem)
  • construct a shadow volume out of this shape

i am not sure, how fast it can be done in realtime. but it is possible.

Michael McCool developed an approach called ‘shadow volume reconstruction from depth maps’. I haven’t tried it myself but if I remember correctly, it has some of the same limitations as shadow maps ( such as no point lights unless you use 6 maps ). Also, the are times when valid edges are not detected ( I think he actually said that the method is not guaranteed robust ).

I guess ToolTech is talking about this method ?