Jump to content
  • Advertisement
Sign in to follow this  
RPTD

Depth Cube Maps horribly slow (ATI prob)

This topic is 3167 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So far I used depth encoded into a color cube map for point light shadow casting. In OGL 3.0 though you can use now samplerCubeShadow hence I want to step things up to depth cube maps in the hope of getting perhaps some HW PCF for free. Anyways when I render to depth cube maps the speed is horribly slow. For comparison: Depth encoded into color cube map: 109 fps Depth with depth cube map: 11 fps The card is an ATI Radeon HD 4750 and therefore supports depth cube maps. Are depth cube maps that slow or is something else wrong? Has somebody depth cube maps working with reasonable speed? Any ideas in this case what could cause troubles? [Edited by - RPTD on October 17, 2009 11:25:06 AM]

Share this post


Link to post
Share on other sites
Advertisement
A little update to the problem. I tried the same code on an ATI and an nVidia machine. Looks like the ATI machine drops down to 10-20% of the speed if using a depth cube map while the nVidia machine seems to stick with the same speed. Is there something special you have to do to get ATI to not crumble in speed when using depth cube maps? Or is this just a driver problem you have no way of solving except using the depth-to-color hack?

It's just that with a color cube I don't know how to make soft shadows since you can not use PCF ( you can but the result is lackluster at best ) nor bilinear filtering in any way.

Share this post


Link to post
Share on other sites
Quote:
Original post by RPTD
A little update to the problem. I tried the same code on an ATI and an nVidia machine. Looks like the ATI machine drops down to 10-20% of the speed if using a depth cube map while the nVidia machine seems to stick with the same speed. Is there something special you have to do to get ATI to not crumble in speed when using depth cube maps? Or is this just a driver problem you have no way of solving except using the depth-to-color hack?
At < 20% speed, it sounds like you have triggered a software fallback. Have you made sure that the exact depth texture format you are using is supported natively?

Share this post


Link to post
Share on other sites
Not sure. I'll post the results my engine finds maybe somebody figures out a problem.

I do first in my engine a test run in which I try to create all sorts of cube maps testing which work and which fail. These are the results:
Quote:
OpenGL > dm_capabilities fboTexCube_found
Found FBO Cube-Texture formats:
( various color formats... )
- GL_DEPTH_COMPONENT
- GL_DEPTH_COMPONENT16
- GL_DEPTH_COMPONENT24
- GL_DEPTH_COMPONENT32
- GL_DEPTH_STENCIL_EXT
- GL_DEPTH24_STENCIL8_EXT


From this list I pick the one I think is best. This would be like that:
Quote:
OpenGL > dm_capabilities fboTexCube_use
Used FBO Cube-Texture formats:
( various color formats... )
- Depth: GL_DEPTH_COMPONENT
- Packed Depth/Stencil: GL_DEPTH_STENCIL_EXT


Hence my engine uses GL_DEPTH_COMPONENT on the ATI machine and also the nVidia machine. Should I use an explicit format instead?

Share this post


Link to post
Share on other sites
Incidentally the 3.2 spec's a tad vague on whether you'll actually get PCF, depending on your sample filter...

Share this post


Link to post
Share on other sites
The other question would be how to get soft shadows on a depth cube map ( or a depth-to-color cube map ) otherwise. I'm using already a sort of PCF hack in that I calculate two rotation matrices and using this as sort of u-step and v-step but this produces blocky shadows since the samples are not weighted. Since there's no pixel match on a cube map as with texture maps it would be a problem to make a shader based PCF version.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!