Archived

This topic is now archived and is closed to further replies.

Precalculated shadow volumes.

This topic is 5046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites