Jump to content
  • Advertisement
Sign in to follow this  
PandaProtector23

PCF Soft Shadow

This topic is 2522 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys.
I'm posting concerning shadow implementation. I have try to implement [font=Arial][size=2]soft shadows with PCF. I have test with 2 "map" size and i haven't got the result that i was expecting.[/font]
[font=Arial][size=2]
[/font]
[font=Arial][size=2]Here its a map of 5X6 cube[/font]


Here its a map of 10X12 cube


I haven't change anything except the 3d objects that are create. What should i change to be able to render more objects or bigger objetcs?

Thank you. smile.gif

Share this post


Link to post
Share on other sites
Advertisement
What should i change to be able to render more objects or bigger objetcs?[/quote]
Cascaded Shadow Maps

and i haven't got the result that i was expecting[/quote]
Because PCF sucks. It eats a lot of samples and produces results based on the aliasing of the projected shadow map. Try Variance shadow maps or screen space soft shadows.

To get rid of that acne on your objects, make sure all surfaces with a normal pointing away from the light are set to shadowed in your shader, that eliminates all acne.

Share this post


Link to post
Share on other sites
I have try Variance shadow map on the small map (the 5x6 one)

here is the result:
http://www.youtube.c...h?v=yI_ERZQJwBI
it's kinda weird, i'm probably doing something wrong.

and thank you for the cascaded shadow map, i have start reading on it. Just to make sure i understand, i should try to render the small map perfecly with VSM then try to add more block and bigger construction and implemented cascading shadow map?

Share this post


Link to post
Share on other sites
Because PCF sucks. It eats a lot of samples
N.B. most GPU's since GeForce 3/4 have supported doing the PCF test in the texture-fetch unit, giving you 4-sample PCF results for the cost of 1 sample, so a basic 4-tap implementation doesn't use any more samples than regular 'hard' shadow mapping.

Share this post


Link to post
Share on other sites
Well correct, But a 4-tap isnt going to produce soft shadows. So you get a tiny little bit nicer looking image, but not good just by itself. So to Panda, you can always get 4 sample PCF for free. If you set your glTexParameter to GL_LINEAR.

With Cascaded shadows you just take multiple snapshots of your shadow. So you take your light matrix and keep closing its field of view smaller. So you get one map to project to a small 3x3 unit area, then another one with a bigger FOV will map to a 20x20 area, and so on till it is maybe 1,000 x 1,000 GL units. And for each pixel, you determine which map you should use because you want the map that has the best resolution.

Share this post


Link to post
Share on other sites
Okay i have successfully implemented VSM shadow :


Now i want to use cascading or parallel split to do bigger map, should i implement that first or multitexturing? (ex: put a brick decal on the wall)

thank you

Share this post


Link to post
Share on other sites
The VSM looks strange. Also use glTexParameter CLAMP_TO_BORDER, and set glTexParameter Border Color to 1. This way you don't get black outside of the shadow map areas.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!