PDA

View Full Version : Depth Buffer Render



planza
06-04-2013, 10:22 AM
Hello,

Im new in OpenGL and I have been reading this fantastic forum for a while. This is my first post.

Im trying implement Shadow Mapping without sucess. I rendered a simple scene (one cube and one plane) from the light perspective in DepthBuffer.
After that I rendered the Depth Buffer converting depth distances in grayscales in order to display a visual representation of depths. My problem is in the rendering process order.


In the first render...when I am copyng the distances in the depth buffer. If I render

1.- plane
2.- cube

All is ok. The visual representation of depth distances show a cube on a plane.

If I render:

1.- cube
2.- plane

The depth distances of plane overwrite the depth distances of the cube. The cube is not visible in the visual representation of depths.

Is there a method to avoid this?

Thanks.

random_dude
06-04-2013, 12:45 PM
You probably forgot to enable depth testing.

planza
06-05-2013, 02:03 AM
You probably forgot to enable depth testing.

Yes!!! I forgot the depth testing. Its ok now.

Thanks random_dude!!!!