#### Archived

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

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

## 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 on other sites
why not render the bounding box and the shadow volume in a offscreen frame buffer and the appropriate stencil test ??

##### Share on other sites
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 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 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.

1. 1
2. 2
Rutin
18
3. 3
khawk
15
4. 4
A4L
14
5. 5

• 10
• 13
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633745
• Total Posts
3013667
×