Archived

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

mrrolf810p

sensitive shadow mapping

Recommended Posts

mrrolf810p    122
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   
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