PDA

View Full Version : FBO, cubemap and depthmap



hseb
07-10-2008, 02:36 PM
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.

dletozeun
07-10-2008, 03:54 PM
Do attaching a depth map to a FBO is supported only by G80 processor?


I hope so! :)

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.

hseb
07-11-2008, 12:48 AM
Ok. I wanted to say : Do attaching a depth map to a FBO "for cube map" is supported only by G80 processor? ;-)

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)

dletozeun
07-11-2008, 01:40 AM
There was a similar problem here about glFramebufferTexture2DEXT performances here:

glFramebufferTexture2DEXT slow (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=235237)

Maybe this could help you.

hseb
07-11-2008, 02:13 AM
Thx.

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

dletozeun
07-11-2008, 04:02 AM
virtual depth environment map


what is this?

hseb
07-11-2008, 08:35 AM
ok perhaps the term virtual depth cube map is better ;-)

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.

dletozeun
07-11-2008, 09:55 AM
Ok thank you, I understand now. :) Is this shadow mapping with point lights?

hseb
07-11-2008, 03:15 PM
Yep....

I have almost finished...