Not satisfied with stencil shadows

Originally posted by knackered:
Anyway, back to your question about shadow volumes passing through walls - it’s trivial when calculating your shadow volume to do a ray intersect with your world geometry to give you a plane at which to clip the volume.
Unless I’ve misinterpreted this, no, it isn’t. You can only clip your shadow volume where it becomes completely occluded and a ray won’t tell you this. Afaik, you need some kind of proper view-indipendant occlusion culling and in my experience that’s not trivial.

That said, it is only useful as a fill-rate optimisation and not as a method to fix incorrect lighting/shadowing. Your are still going to have to consitently cast shadows for everything that isn’t occluded to get correct results, Halo.

I was hoping, when I first read the subject line, for a discussion about the real shortcomings of stencil shadows. I’m not particulalry satisfied with either stencil shadows or shadow mapping as general-purpose approaches. Shadow mapping on current hardware is improving…

Originally posted by halo:
The scissor test is only relevant to point and spot lights, not directional.
Well, I’m assuming you use directional light to simulate the sun outdoors. Otherwise, indoors you are much better off with lots of point lights. Looks better and probably even cheaper. You don’t have to render the whole scene multiple times, just the objects that are inside the radius of a point light.

Outdoors, you can cast the bounding box of the shadow caster to the ground, and make a scissor that includes both the original and the projected bounding boxes.

If you still want to use directional light indoors, you can still flag some faces as “ground”, or simply use a plane underneath your entire level or room, and use that for clipping. It will still save you a ton of fillrate.

PS: I don’t make my money by proving other people wrong, I just do it for fun! :slight_smile:

Than you for the creative ideas.

I was thinking it might work if you clipped your shadows to the current portalzone you are in. I am using a portal system a lot like the UT2004 engine has. If you clipped the shadows to inside the portalzone, it might work right most of the time, which is really what I am aiming at here.

well I’ve made a few assumptions here, firstly that you were talking about point lights, secondly that you have a light culling system in place already, and you merely needed a system to always stop volumes penetrating into other sectors, the planes I talked about were manually placed in your level editor, not built from arbitary world geometry.
I’m throwing ideas at someone who’s trying to hack lighting together…in the world of hacks, realism is left at the door.