PDA

View Full Version : Render DepthMap with FBOs



miujin
03-04-2011, 04:24 AM
Hi,
I want to render the DepthMap with FBOs, but when I render the scene, the result is a texture with the background color and the texture of the ColorAttachement0 is darker than the real image.
I've tried several tutorials but I don't know what I'm doing wrong.

I use the OpenTK framework.

It would be realy nice if anyone could help me.

The Code: http://codepad.org/4cOIutjD

_arts_
03-04-2011, 03:47 PM
Use a depth attachment with your fbo, and render to this.

miujin
03-06-2011, 05:04 AM
I can render the DepthMap.
But the DepthMap is very bad, it seems to be a constant gray value. Can I set some properties for the DepthMap so that the gray values will be more different?

If I render all of my model in the viewport, there is a white DepthMap although the Depth difference of the model is more than 100, so there must be a noticeable DepthMap and no white respectively light grey DepthMap.

Here is a screenshot of the DepthMap
http://i54.tinypic.com/6ifp5x.png

Dark Photon
03-06-2011, 09:42 AM
http://www.geeks3d.com/20091216/geexlab-how-to-visualize-the-depth-buffer-in-glsl/