Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


sensitive shadow mapping

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

Hello all. I''m working on a shadow mapping demo, and I''ve run into a little trouble. My shadow heavily depends on the back clipping plane that I define in gluPerspective. Too far and there is no shadow when the light is close, too close and there is no shadow when the light is too far. gluPerspective(45.0f, (float)shadowWidth / (float)shadowHeight, 1.0f , 50.0f); I have the back plane set to 50.0f right now. If I change it to 55.0f, I see a big differece. I didn''t think shadow mapping was that sensitive to the back place. I have played with glPolygonOffset and it doesn''t have much effect. It is get at glPolygonOffset(4.0f, 1.1f). Anyone have any idea why shadow mapping is this sensitive to the gluPerspective call? Thanks Robbie

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
The Z-buffer presicion depends on the near and far planes, mostly on the near plane.

I see you set the near and far to 1, 50, which will give you very good Z-buffer presicion, make sure you use a 24-bit Z-buffer though.

You''re on the right track with Polygon offset, read the OpenGL manual (www.opengl.org) and tweak the polygon offset values.

You can also change the Depth Compare to GL_LEQUAL instead of GL_LESS.

Share this post

Link to post
Share on other sites

  • 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!