• Advertisement

Archived

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

Stencil Shadow + Quake3 BSP + CSG = Bad ??

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

Ok, I''ll try to explain this as well as I can, but it''s gonna be a bit long so bare with me A while ago I started working on Stencil Shadow Volumes. I''m using Quake 3 BSP file format. I have a converter which takes the Q3BSP, gets all the useful information out of it and adds some additional stuff I calculate (eg Connectivity information) and puts it into my own file which I load into the game. Anyway first thing I tried was to do the normal (and easier) Z-Pass method for the shadows. Everything looked very good (of course untill the camera is positioned inside a shadow which which inverts all the lighting) I was very encouraged. Next I tried to implement carmack''s reverse. Basically I inverted the stencil test and added caps to the shadow volumes (or so I thought) but there were some major artifects. After lots of testing on trivial maps I realized that the problem is that the caps are sometimes not correct. ie sometimes the set of triangles for which I''m doing the shadow volume, is not closed. The main reason (I think) is the CSG which the Q3BSP compiler applies. For example if you put a cylinder on a wall, the back face of the cylinder which is touching the wall is removed by the compiler. While that face is not visible to the player, it is needed to close the shadow volume for the cylinder. The other reason (again I''m not sure if this is strictly true, but I can picture it happening) is that when I want to select what faces to do the shadow for I do a PVS check, followed by a bounding box check of the BSP leaves against the light. But it maybe that I need to include some polygons which are well outside the range of the light, in order to close the shadow volumes. (I can''t really do the shadows for the entire level every frame) Can anyone give me an idea or any hints about this issue? Am I going about this the wrong way? Is it even possible to get correct shadows using the BSP leaves or do I have to have access to "unsplitted" brush data? Does anyone know of any demos where Stencil Shadows are applied to a BSP level? Again sorry about the long post Thanks

Share this post


Link to post
Share on other sites
Advertisement
This open source project was able to use stencil shadows with the Quake 1 engine:

http://tenebrae.sourceforge.net/index.php?page=screenshots.txt

There is a Technical FAQ page on that web site you might be interested in looking at: http://tenebrae.sourceforge.net/index.php?page=technical/techn.htm




[edited by - MagTDK on December 6, 2002 10:31:06 AM]

Share this post


Link to post
Share on other sites

  • Advertisement