Jump to content
  • Advertisement

Shadow artifacts with peter-panning

This topic is 515 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 am trying to implement simple shadow mapping (following the shadow mapping tutorial of opengl: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/), but I'm getting some strange artifacts with the shadows. I attached three files to my post, clearly showing my problem. One picture seems to be correct (the cube is lifted somewhat of the floor), another in which I see peter-panning (although a little bit too much peter-panning to me) and another showing the issue that I have.

My scene consists of two objects: a cube and a stretched cube (acting as a floor). The issue happens when I lift the floor up or change the thickness of the floor. My bias is very low, it is 0.005. The shadow maps are 2048x2048 and the size of the scene is around 10x10x1, so I wouldnt expect such amount of precision effects. Also the ground floor is not a plane, it is a stretched cube.  in specific compositions of the scene. At this moment the scene consist of two objects, a cube and a stretched cube acting as the floor.

Do you guys have any clues about what can cause this "subtraction" like effect?




Share this post

Link to post
Share on other sites

Never mind guys, it was a silly mistake from my side. It turned out I was using only the depth matrix, but I had to still multiply it with the model matrix of the objects in the scene.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!