
point in shadow volume
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.

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>
September 19, 2002 09:53 AM
why not render the bounding box and the shadow volume in a offscreen frame buffer and the appropriate stencil test ??
seems frightfully inefficient to me 
you''d need to access the surface memory to do that if I understand it correctly...
Jack;
DirectX 4 VB: All you need for multimedia programming in Visual Basic
Formula 1 Championship Manager, My Game Project.

you''d need to access the surface memory to do that if I understand it correctly...
Jack;
DirectX 4 VB: All you need for multimedia programming in Visual Basic
Formula 1 Championship Manager, My Game Project.
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>
September 19, 2002 10:42 AM
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...
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...
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
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
~V'lionBugle4d
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.

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.
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement