FBO, cubemap and depthmap

Hi everyone!

I would like to implement shadow mapping for point light by rendering the depth in a cubemap. I don’t use geometry shader to render it in one time. I have two 7900GTX in SLi.

The problem is that when I attach a depth render buffer, one for each FBO, each one attached to one face, the framerate is very low. However, when I do not attach the depth render buffer, the framerate is high.

Do you know where is the problem?
Do attaching a depth map to a FBO is supported only by G80 processor? Even with a GF7900 I need to render my point light as 6 spot?

Thank you.

Do attaching a depth map to a FBO is supported only by G80 processor?

I hope so! :slight_smile:

You could try to create only one fbo with one depth render buffer. You can later attach each face texture to fbo color attachment and render to texture. It would save memory and maybe run faster.

Ok. I wanted to say : Do attaching a depth map to a FBO “for cube map” is supported only by G80 processor? :wink:

About the single depthmap : I have tried this solution but when I saw that it was slow, I think that it could be due to the dynamic attachment. So I created one depth map for each face…

Today, what are the solution to render into a cubemap with depth testing without having a G80 card? (except glCopytexture and pixelbuffer)

There was a similar problem here about glFramebufferTexture2DEXT performances here:

glFramebufferTexture2DEXT slow

Maybe this could help you.


I have choosen to develop a virtual depth environment map unsing an indirection cubemap.
I hope it will be fast enough…

virtual depth environment map

what is this?

ok perhaps the term virtual depth cube map is better :wink:

Basically, I have one 2D texture in wich I will render each face of the cube map (+X, -X, +Y…) and these one will only be a depthmap. Then, during the shadow algorithm, I use the direction vector to read the cubemap. However, I do not read the depth but a uv coordinate which tell me where I have to look in the 2D texture to read the depth (the indirection cubemap).

It’s only one texture read more than the algorithm I originally wanted.

Ok thank you, I understand now. :slight_smile: Is this shadow mapping with point lights?


I have almost finished…