Sign in to follow this  
SnotBob

Soft Shadow Volume Shaded Planet?

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this