• Advertisement

Shadow artifacts with peter-panning

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?

depthmap_issue.png

depthmap_peterpanning.png

depthmap_working.png

Share this post


Link to post
Share on other sites
Advertisement

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement