Re: [Algorithms] Stopping shadow volumes from going through geometry
Brought to you by:
vexxed72
From: John P. <daw...@at...> - 2002-11-22 08:15:29
|
MessageHmm, if you must do darkening stencil shadows, and you don't want = them to go through walls, maybe you could do a four-pass scheme, where = you render two types of shadow volumes.=20 First, clear stencil to 128 or something. Then render the shadowvolumes = to the stencil buffer. At this point, the stencil buffer will contain = values where you should darken the screen. Draw a full screen invisible = quad that sets this shadow region to a certain value other than 128, say = 129. At this point, you have values of 128, and 129 in the stencil = buffer. 129 is currently where the screen should be shadowed. Now, for = all the polygons that you want the shadow volume to be blocked by, = extrude those (call them anti-shadowvolumes) and render the = anti-shadowvolumes into the stencil buffer. They will invalidate the = parts of the screen that are blocked by the anti-shadowvolumes. = Finally, draw another fullscreen quad, and darken areas that remain 129 = in the stencil buffer. Would this work? Sounds like alot of passes, but it would allow you to = keep an old school renderpipe, and use the darken stencil shadow volume = method, and still allow geometry to block the shadows. Your probably = going to still see funny anomalies though, if your not careful about = choosing the anti-shadowvolumes. You'd want to make sure that the = blocking object in question truly blocked the entire shadow, or the = shadow will have "holes" in it. -John ----- Original Message -----=20 From: Joris Mans=20 To: gda...@li...=20 Sent: Thursday, November 21, 2002 7:11 PM Subject: RE: [Algorithms] Stopping shadow volumes from going through = geometry this is what i mean, in "real-life" this is not possible. Usually the = static geom uses some prebaked form of shadowing (lightmap, vertex = darkening, whatever) and it will clash with the dynamic shadowcaster. We = only want the character to cast shadows on the vicinity using stencil = and leave the rest as-is. Ofcourse when your initials are JC and you are = making a game called D III things change a bit ;) Joris -----Original Message----- From: gda...@li... = [mailto:gda...@li...] On Behalf Of John = Pollard Sent: Friday, November 22, 2002 1:31 AM To: gda...@li... Subject: Re: [Algorithms] Stopping shadow volumes from going through = geometry Hit reply too fast :-O >>You don't even need to make the entire scene cast shadows Actually, the character's shadow will still go through the wall. = But you can simply make the wall cast shadows as well. Since it's = blocking imcoming light, it works. And no double darkening. ----- Original Message -----=20 From: John Pollard=20 To: gda...@li...=20 Sent: Thursday, November 21, 2002 6:23 PM Subject: Re: [Algorithms] Stopping shadow volumes from going = through geometry You won't get the double darkening if you do all your = shadowvolumes at once at the end, and do the fullscreen quad to darken, = but it still doesn't solve the problem completely, as the ledge will now = go through walls, and it's a never ending process, unless like you said, = the whole scene cast shadows. But this method is such a pain, and you = never really fix all the problems. Our shadowvolumes actually block imcoming light, so the problem = goes away (which is how most people are doing it these days I'm = assuming). The drawback, is you have to interleve your light rendering = code between the shadowvolume rendering. The advantage, is all those = problems go away. You don't even need to make the entire scene cast = shadows. Everything just works. ----- Original Message -----=20 From: Joris Mans=20 To: gda...@li...=20 Sent: Thursday, November 21, 2002 6:04 PM Subject: RE: [Algorithms] Stopping shadow volumes from going = through geometry this is the answer i see all the time when ppl ask this question = (please dont take this personally), but as we all know this doesnt solve = it, even with the ledge casting a shadow you will get "double shadowing" = under the ledge. So if anyone has a way of solving this which does not require = stencil-shadowing the entire scene ;) please reply as i dont know it = either :| Joris -----Original Message----- From: gda...@li... = [mailto:gda...@li...] On Behalf Of = Gilles Marion Sent: Thursday, November 21, 2002 10:17 PM To: gda...@li... Subject: Re: [Algorithms] Stopping shadow volumes from going = through geometry Hi, I think the ledge should also cast its shadow onto the ground, = no ? If so, it doesn't matter if the shadow volume is extruded past = the ledge. If fillrate is your bottleneck, think about clipping (cpu = intensive), or try setting the far side=20 of the shadow volume nearer from the character. If it's a sun-like light, radiosity of the environment should = make look that=20 correct to your eyes. Gilles. ----- Original Message -----=20 From: Fong, Jay=20 To: 'gda...@li...'=20 Sent: Thursday, November 21, 2002 9:29 PM Subject: [Algorithms] Stopping shadow volumes from going = through geometry Hello, I was wondering if there is some way to prevent shadows, = generated by the stencil shadow volume technique, from being extruded = through other objects in the scene? e.g. a character standing on an = overhanging ledge above ground casts a shadow on the ledge but also onto = the ground below the ledge. I thought about clipping the extruded shadow polys against = the world geometry but I'm hoping for a more elegant (i.e. simpler) = solution since our world geometry is quite dense. Any solutions or links/pointers to papers related to this = issue would be much appreciated! Thanks, Jay |