Sign in to follow this  
Dragon_Strike

terrain shadows

Recommended Posts

im about to implement some shadows in my terrain engine... its a pretty large landscape with tress, grass and rocks... and im a bit unsure which shadowing technique to use... my only light source is the sun... i thinking about ortho cascaded shadowmaps... but i dont know if that the best and simplest solution...

Share this post


Link to post
Share on other sites
Yeah PSSM/CSM works really nicely. Very good example of PSSM on this page: http://appsrv.cse.cuhk.edu.hk/~fzhang/pssm_project/

Share this post


Link to post
Share on other sites
For just terrain (shelf) shadows google "Ambient aperture lighting". Fast, easy and good-looking, What else can you ask for? There's also an example in nVidia's FX composer 2 (beta).

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
I have had good success with logarithmic shadows in my own project..very easy to implement and works in all cases..(with some artifacts but not much);


logarithmic shadows? could u give me some more info on that?

EDIT:: googled didnt find any papers on it.. that were free

Share this post


Link to post
Share on other sites
I second looking into "Ambient Aperture Lighting" - there's a copy of the paper on ATI's developer site I believe. It's simple, cheap and looks quite good.

Crysis is apparently using variance shadow maps for their terrain shadows which seems like a good idea as the depth complexity of terrain is fairly low. VSMs can also be combined with other techniques such as PSSM to good effect.

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyTX
I second looking into "Ambient Aperture Lighting" - there's a copy of the paper on ATI's developer site I believe. It's simple, cheap and looks quite good.

Crysis is apparently using variance shadow maps for their terrain shadows which seems like a good idea as the depth complexity of terrain is fairly low. VSMs can also be combined with other techniques such as PSSM to good effect.


thx.. ive looked into Ambient Aperture Lighting and that seems quite good... also VSM seems interesting... but that goes for terrain...

for grass i thought PSSM or CSM.. or this logarithmic one... however which one would be simplest to implement?

Share this post


Link to post
Share on other sites
Quote:
Original post by Dragon_Strike
for grass i thought PSSM or CSM.. or this logarithmic one... however which one would be simplest to implement?

Do you need to see the individual shadows for each blade of grass? That's gonna be pretty ugly no matter which method you use as grass is *way* too high frequency. I'd suggest looking into a probabilistic method for computing occlusion from grass (I believe several recent grass papers have done something similar).

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyTX
Quote:
Original post by Dragon_Strike
for grass i thought PSSM or CSM.. or this logarithmic one... however which one would be simplest to implement?

Do you need to see the individual shadows for each blade of grass? That's gonna be pretty ugly no matter which method you use as grass is *way* too high frequency. I'd suggest looking into a probabilistic method for computing occlusion from grass (I believe several recent grass papers have done something similar).


that would be an option... however since im using several different plants its not rly what im looking for... wouldnt it be possible to do alot of blurring on the shadows to hide the artifacts? sharp shadows arent required...

Share this post


Link to post
Share on other sites
Quote:
Original post by Dragon_Strike
that would be an option... however since im using several different plants its not rly what im looking for... wouldnt it be possible to do alot of blurring on the shadows to hide the artifacts? sharp shadows arent required...

You can't blur standard shadow maps and expect to get proper (or even reasonable) results.

You *can* blur variance shadow maps, but you'll tend to just lose the shadows altogether if they are very high frequency (i.e. grass). That said, combining VSM with some sort of ambient occlusion approximation might get you what you need.

VSMs also have the advantages of hardware filtering, multisampling (if supported) and alpha blending (nice for foliage). Combined with PSSM they might give very good results, although I haven't tried them with a scene like you describe.

Share this post


Link to post
Share on other sites
Since I`m currently also in the process of researching grass shadows, I`d like to know what would you propose. Any ideas/links are useful.
Quote:
Original post by AndyTX
Do you need to see the individual shadows for each blade of grass? That's gonna be pretty ugly no matter which method you use as grass is *way* too high frequency.
Why should that be ugly ? Recently I`ve watched Pixar`s Bug`s life, and it looked prety good to me, although the shadows were hard.

I`m thinking of grass blades self-shadowing itself so that you can clearly see the shadow of the individual grass blades moving all over the grass patch (fully-polygonal, about 150 tris per 15 grass blades). I don`t necessarilly need dynamic grass-blades shadows over the terrain - that`s actually pretty cheap to fake, just self-shadowing. I`ll go for about 300k tris of grass per frame, so the faster the shadow method, the better. Static self-shadows of grass blades are fast and easy (and they`d probably still look good enough to an untrained eye), but what about dynamic ones ?

Share this post


Link to post
Share on other sites
Quote:
Original post by VladR
Since I`m currently also in the process of researching grass shadows, I`d like to know what would you propose. Any ideas/links are useful.
Quote:
Original post by AndyTX
Do you need to see the individual shadows for each blade of grass? That's gonna be pretty ugly no matter which method you use as grass is *way* too high frequency.
Why should that be ugly ? Recently I`ve watched Pixar`s Bug`s life, and it looked prety good to me, although the shadows were hard.

I`m thinking of grass blades self-shadowing itself so that you can clearly see the shadow of the individual grass blades moving all over the grass patch (fully-polygonal, about 150 tris per 15 grass blades). I don`t necessarilly need dynamic grass-blades shadows over the terrain - that`s actually pretty cheap to fake, just self-shadowing. I`ll go for about 300k tris of grass per frame, so the faster the shadow method, the better. Static self-shadows of grass blades are fast and easy (and they`d probably still look good enough to an untrained eye), but what about dynamic ones ?


well were gettinga bit of topic.. but i think i started a topic on this were it was discussed in quite detail...

http://www.gamedev.net/community/forums/topic.asp?topic_id=423966&whichpage=1�

however im still goin for shadowmaps for now atleast... and about individual grass blades.. its not required but it would be nice

Share this post


Link to post
Share on other sites
Quote:
Original post by Dragon_Strike
well were gettinga bit of topic.. but i think i started a topic on this were it was discussed in quite detail...
Sorry, didn`t mean to hijack your thread, it seemed to me relevant,because of previous posts. I`ve seen that thread previously, but thanks.

Quote:
Original post by Dragon_Strike
however im still goin for shadowmaps for now atleast... and about individual grass blades.. its not required but it would be nice
Well, how would you escape self-shadowing of grass blades with shadow mapping ? Since it`s an image-space operation, you`d get them automatically. Or am I missing something ?

Share this post


Link to post
Share on other sites
Quote:
Original post by VladR
Quote:
Original post by Dragon_Strike
well were gettinga bit of topic.. but i think i started a topic on this were it was discussed in quite detail...
Sorry, didn`t mean to hijack your thread, it seemed to me relevant,because of previous posts. I`ve seen that thread previously, but thanks.

Quote:
Original post by Dragon_Strike
however im still goin for shadowmaps for now atleast... and about individual grass blades.. its not required but it would be nice
Well, how would you escape self-shadowing of grass blades with shadow mapping ? Since it`s an image-space operation, you`d get them automatically. Or am I missing something ?


self-shadowing of grass blades with shadow mapping... is that a bad thing?


Share this post


Link to post
Share on other sites
I haven`t used shadow mapping with grass yet, so I can`t say if it`s bad or if it isn`t extreme performance overkill, but the only way you could achieve no grass self-shadowing seems to be in omitting grass rendering during shadow-map pass. Which, kinda defeats whole purpose.
Since I don`t know anything about your camera, how much the player sees, from which height, and to what distance, it`s hard to say, if no grass shadows would make a big difference.

Share this post


Link to post
Share on other sites
You can also render a shadow map of object IDs rather than depths (or some hybrid). That will "avoid" self-shadows. I'm personally not a huge fan of that approach, but it could work in your situation.

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