Soft Shadow Volume Shaded Planet?

Started by
5 comments, last by MJP 15 years, 11 months ago
Consider a game set on a planet, where you can freely roam around, implemented with some suitable subdivision with LOD scheme. Intention is to use shadow volumes for all lighting to have good looking shadows for moving light sources and to avoid having multiple lighting schemes. Ideally even the planet would be shaded with shadow volumes, which brings up the need to have soft shadows, as otherwise shadows on and near the terminator would be unacceptably crisp and would wobble terribly over huge tracts of land as the LOD of the mountains casting shadows would change. So the question is, what would be a good way to implement these soft shadows. They are only needed for the sun, but since the player could travel to the terminator, any object must be able to cast a soft shadow from the sun. Any method other than shadow volumes would also do, as long as it correctly shades objects in shadow of the terrain, without nasty artifacts. For smallish shadowing objects the shadow could probably be attenuated based on distance from the object to get the effect, but this wouldn't really work for the terrain. [Edit] Actually, I just realized that the attenuated shadow trick might actually work for the mountains anyway, because the gradual change form light to dark at the terminator is caused by the atmosphere, i.e. ambient lighting. For example, the moon's terminator is much sharper. Still, the problem might crop up, so any ideas are appreciated. [Edited by - SnotBob on May 8, 2008 5:26:26 AM]
Advertisement
I'm not an expert on shadow volumes, but my understanding is that any methods of creating (correct) soft-shadows with them are incredibly expensive. Rendering the shadow contribution to a screen-sized buffer and then blurring in screen space is a cheap option, but the results aren't particularly good I'd say.
Yes, I've been reading on some general soft shadow volume techniques and they certainly aren't cheap. I was wondering if there might be some kind of a trick that would specifically fit my problem.

I fear that shadow maps might have much too low resolution, considering the magnitudes involved. Although maybe using some kind of LOD scheme with them might do the trick.
Quote:Original post by SnotBob
Yes, I've been reading on some general soft shadow volume techniques and they certainly aren't cheap. I was wondering if there might be some kind of a trick that would specifically fit my problem.

There are lots of tricks to reduce the fillrate consumption of shadow volumes, but the most efficient one is to not use them at all.

Quote:Original post by SnotBob
I fear that shadow maps might have much too low resolution, considering the
magnitudes involved. Although maybe using some kind of LOD scheme with them might do the trick.

A lot of research has been done to overcome this problem: PSM, LiSSM, TSM, CSM, etc. CSMs (cascaded shadow maps) are probably best in your case.
Quote:Original post by Yann L
There are lots of tricks to reduce the fillrate consumption of shadow volumes, but the most efficient one is to not use them at all.

I sense that you prefer maps over volumes. I have been under the impression that shadow maps frequently display undesirable artifacts, but if that is no longer the case, I shall consider using those solely (once I get the spare time to actually start working on this, that is).
Quote:Original post by SnotBob
I sense that you prefer maps over volumes. I have been under the impression that shadow maps frequently display undesirable artifacts, but if that is no longer the case, I shall consider using those solely (once I get the spare time to actually start working on this, that is).

Being an image based technique, you can never completely get rid of artifacts with shadow mapping. But newer approaches can hide them pretty well. And even with the occasional artifact, shadow maps are still preferable to shadow volumes. The latter are just too performance hungry, and are more or less considered a thing of the past nowadays.
Quote:Original post by SnotBob
I fear that shadow maps might have much too low resolution, considering the magnitudes involved. Although maybe using some kind of LOD scheme with them might do the trick.


I definitely think you could make shadow maps work for your situation, using one/some of the techniques Yann mentioned. They're also more flexible and easier to work with (IMO) compared to shadow volumes. You'll probably also want to check out Variance Shadow Maps or one of its variations, which allows you to filter the shadow maps in order to reduce/eliminate aliasing artifacts or to produce a "soft-shadow" look. I'd think they'd work work quite well for terrain data as it's generally low frequency.

This topic is closed to new replies.

Advertisement