View Full Version : Render DepthMap with FBOs

03-04-2011, 03:24 AM
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

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

03-06-2011, 04: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

Dark Photon
03-06-2011, 08:42 AM