Jump to content
  • Advertisement
Sign in to follow this  
Striken

OpenGL Next step (after basic Shadow Mapping)

This topic is 4083 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

I know, I know another question about shadow mapping - but my question is more of a seeking of experience, and that's what forums are for, right :?) I've got some basic shadow mapping set up for my current project, but I was wondering what the next step is to improve upon it, both looks and performance wise, and if anyone has any specific tips for my personal case here. And quickly:- 1) OpenGL FBOs with CG shader for the shadowing. Firstly, here's a screenshot: my test ship Ok so what you see is basically: 1) First pass using a FBO depth buffer, rendered from the light view and also rendering a low polygon version of the actual rendered model, no textures, just the basic geometry. The shadows are for self-shadowing purposes only. 2) A small image (bottom left) of the light's view with the generated depth texture. The depth texture is currently 1024x1024. In my mind, this is insanely big for such a simple mesh (although I'd ideally want a high level of shadowing on the player's sihp) - would you agree? 3) And then the rendered ship, with the applied shadow. The shadowing looks HORRIBLE (but correct(ish)). So my question really is, are there any *easy* ways to improve these horrible shadowing artifacts? What would be a good, solid shadowing improvement solution be. I'm only midly aware of Variance Shadow Maps and PCF shadow maps. What did you use, and how did you find it? Frankly, maths isn't my strong point and I'd like to avoid a horrible long learning curve as graphics & effects aren't my forte. I wasn't also aware I would kind of get this.... almost z-buffer fighting with the shadow and the mesh that makes it look horrible, I just assumed this is because of the inherent aliasing effects of shadow mapping... or am I making an obvious mistake somewhere? Many thanks in advance to anyone who responds with their experience :)

Share this post


Link to post
Share on other sites
Advertisement
Getting accurate shadows is all about precision. Your first mistake is using a low poly version of the mesh to create depth information. How are the shadows supposed to appear accurate if the shadow depth data is different then the view depth data?

Second, the best way to increase usage of your huge map is to ensure that your depth map projection is tightly bound to the shadow casting objects (both in depth range and xy range). Try setting your depth map projection planes as close to the object as you can and you should see improved results.

Third, projection warping techniques will give greater depth map precision where it is needed (close to the view position). Give trapezoid shadow maps a look.

Also give PCF a try it is quick to implement and usualy provides good results. Though I've found that simply enableing linear filtering on the texture gives good enough results for very little performance hit.

Hope that helped and good luck with your tweaking.

Share this post


Link to post
Share on other sites
Hi, as you might see from the bottom left corner of the screenshot, the object being rendered is indeed being tightly bound in all three axes, using an Orthographic projection simulating an infinitely distant light source.

I guess I'm using a low poly version of the ship just for "bad efficiency" reasons, and in retrospect is probably a bad idea.


Appreciate the tips. Thanks :)

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!