View Full Version : sharp projective shadows
09-28-2003, 07:34 PM
I know everybody probably uses either shadowmaps or shadow volumes, but how would you go about projecting shadows only on certain objects, not self-shadowing. For instance, make every tree and rock cast a shadow on a piece of terrain. I thought about projective shadows, but that faces the same quality issue that shadow mapping does. Or is there a different way to do it. I've played games where each character casts a shadow on the ground, but only the ground, and it doesn't matter if the ground isn't flat. Is this just a version of shadow volumes?
09-28-2003, 11:06 PM
They render objects from the light's point of view and project them on the scenery. So it's close to shadow mapping, but instead of using a depthmap they usually just use a black object on a white background and modulate the scenery with it.
This technique actually has very few quality issues unless you count the lack of self-shadowing as such. Double shadowing issues can be solved in most cases. There are no self-shadowing problems (doh!) and these days you can use quite high-resolution maps so there won't be serious aliasing either. You get soft-edged shadows for free and if you draw antialiased objects, you'll get antialiased shadows. If you want the enviroment to cast shadows on the objects, you can draw the enviroment into the shadow texture with white color and modulate the objects' lighting with 1-shadow_texture.
If you have lots of objects, though, you might run into performance problems, as you basically have to draw the enviroment once for each shadow. Grouping objects and multitexturing can help, but at this point it can get a bit tricky.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.