Jump to content
  • Advertisement

Archived

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

jollyjeffers

point in shadow volume

This topic is 5843 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

hi, I''ve just been working through some theory regarding a possible future project (just for recreation atm). one aspect is shadows, which I''d like to make good use of (who doesn''t!)... I''m pretty sure I can construct some shadow volumes and use carmacks reverse to render them (if not, there are enough tuts online). But my question: how could I tell if a vehicle/character etc... was in a shadow? my idea is basically an RTS game... graphically shadows are fine, but I''d like to factor into the AI system if a unit is in shadow (I''d set it such that said unit is less likely to be seen/detected)... Is there a general algorithm for checking points/bounding boxes against a shadow volume? I''ve got 5 books on this sort of practical algorithms and/or graphics based mathematics and i cant find what I''m looking for any help? thanks in advance, Jack; DirectX 4 VB: All you need for multimedia programming in Visual Basic Formula 1 Championship Manager, My Game Project.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
why not render the bounding box and the shadow volume in a offscreen frame buffer and the appropriate stencil test ??

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
just rendering a box and asking if one pixel has changed or not is not necessarily lowest than complex mathematical process
for example there''re some algos wich consist of rendering bouding volumes to determine if a part of a world is visible or not

else you ''ll have to compute the intersection of the shadow volume and the bounding box... not very fast !

or if you know wich object creates the shadow, you could cast a ray from the center of the bounding box to the light and compute if it intersects the bounding volume of the object generating the shadow...
not very precise but...

Share this post


Link to post
Share on other sites
What I would do in 2D is....
look from the one unit to the other.
find the extema of that profile.
cast a line from each extrema to the viewpoint, then test to see if those 2 lines intersect the obcuring object.


Bugle4d

Share this post


Link to post
Share on other sites
this is far more complicated than I''d hoped

some of the shadows are static lightmaps... such that I suppose I could pre-compute some parts, or store a simplified grid.

thanks for the ideas people... I''ll give them some more thought and see what I come up with

Jack;

DirectX 4 VB: All you need for multimedia programming in Visual Basic
Formula 1 Championship Manager, My Game Project.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!