Precalculated shadow volumes.

Started by
7 comments, last by bzroom 20 years, 2 months ago
For simple objects (with only the sun as a light source): What are the cons of using precalculated/loaded shadow volumes? I would just calculate it as if the sun was shining straight down, get a list of the verticies that make up the bottom of the volume, and then just shift those on the xz plane as the sun/object moves/rotates.
Advertisement
this is ok, but it works only on planes.
Act of War - EugenSystems/Atari
I think this is called planar shadow mapping? (i''m not sure about this)

But if you really precalculate the shadow volume, you cannot move the object relative to the light source, because then your silhouette would get wrong
well, since he is probably modelling the sun by a directional light source he *can* precalc the shadow volume and translate the object and even rotate it around light direction.

Yes I forgot to mention that these would only be precalculated for either static objects, or objects that can only be rotated about the Y axis. Why would it only work on planes?, the "top" of the volume would be at the model, the "bottom" of the volume would be far below, shouldn''t that be ok for stencil shadows, on all types of receiving objects.
quote:Original post by honayboyz
For simple objects (with only the sun as a light source): What are the cons of using precalculated/loaded shadow volumes? I would just calculate it as if the sun was shining straight down, get a list of the verticies that make up the bottom of the volume, and then just shift those on the xz plane as the sun/object moves/rotates.


If I understand you correctly you are precalculating the volume using the sun as the lightsource at midday? In this case you would be able to translate the object, and rotate it on the Y-axis as you mentioned.

However you mention in the original post that the sun would be moving, if this is the case then your volumes will be incorrect.

If you need a more indepth explanation:

Imagine a cube floating above the middle of an empty field with the sun shining directly down on it. Your precalculated volume would cast on the flooor in a square shape, as the only face of the cube that is used in the volume is the top.

Now, as the day goes on and the sun moves away from the midday position the shadow is all wrong, it should also show one or two of the side faces of the cube but your precalculated volume only uses the top face of the cube.

Quite a poor explanation now that I read it again, but try it and you'll see

[edited by - MrP on February 21, 2004 5:44:13 AM]

[edited by - MrP on February 21, 2004 5:55:29 AM]

I admit defeat.
quote:Original post by Anonymous Poster
well, since he is probably modelling the sun by a directional light source he *can* precalc the shadow volume and translate the object and even rotate it around light direction.


Yes, I forgot about that
quote:Original post by honayboyz

I admit defeat.


Don''t let it get you down, it was something I thought of myself at one point

This topic is closed to new replies.

Advertisement