So, im trying to implement shadow mapping into my game and I can’t seem to render to the depth texture properly (which is attached to a FBO). I don’t know what part of the code that causes this problem so I wont post code for now. Anyway, here’s a screenshot from my game. It has nothing to do with the problem, I posted it so you could see how it looks like.
Anyway, so instead of rendering the actual textures, I rendered the depth map instead. This is the result:
Yeah, that’s not how it should look like. There appears to be a lot of tiny point everywhere and if you look closley, you can see that theres a line where every edge of the triangle is. However, look at the quad to the right. The depthmap seems to be correct for that quad.
I increased the depth texture dimensions and it now looks like this:
More and smaller points, not very surprising. I’m completly lost now. It’s probably something really simple, but I can’t just figure out what it is. Oh, and by the way, the depth texture is not rendered from the lights POV, but the cameras. I did this to make it more simple.
Any ideas on why this could be happening?
Edit: It appears to work the way it should if the size of the depth texture is less than or equal to 32x32. This doesn’t make me less confused though.