I’m using opengl 3.2 (pure context) with GLSL1.5
Nvidia 9500 gt
I finally got my cubemap shadowing working with a point light. The weirdest thing about it is that it was a problem of the depth test. when I used a R32F format texture to attach to the fbo and rendered to each of the faces it was like depth testing didn’t matter but the order of how I rendered the object instead.
So If I had
renderCube() //this cube is smaller
renderCube() //this cube is taller
only the taller one could cast a shadow onto the smaller. But the small one can’t (This is when I put the level of the light to about the level of the smaller cube so I should be able to see it cast a shadow onto the taller one).
Vice-versa if I had switched the order.
The way I fixed this problem was by making my cubemap accept the depth component instead (which I know is possible since I thin nvidia 9000 series and up). Not only that in the shader I had to write into gl_FragDepth to actually get depth values.
Shouldn’t the fbo even if I just use a color attachment come up with depth as long as the depth test is enabled?