PDA

View Full Version : Float depth buffer and 3D texture



Cyril
07-11-2007, 11:26 AM
I try to use a 3D texture with the new GL_DEPTH_COMPONENT32F_NV floating point depth buffer format (NV_depth_buffer_float) to render in a layered depth buffer but it don't seems to work. I get invalid_operation error on :

glTexImage3D( GL_TEXTURE_3D, 0, GL_DEPTH_COMPONENT32F_NV, 32, 32, 32, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);

The spec is not clear on the fact that this internal format is supported for 3D texture, anybody know if it should work ?

It seems to work with GL_TEXTURE_2D_ARRAY_EXT target so I wonder why it don't work with TEXTURE_3D.

I am using a 8800 GTS with 162.01 drivers under windows XP.


Thank you in advance.

Korval
07-11-2007, 12:55 PM
That's because it probably isn't. 3D depth textures (of any kind) almost certainly don't work.

Cyril
07-12-2007, 01:25 AM
Since rendering in a layered way (selecting the layer par vertex) into a 3D texture is allowed and every attachment point of a FBO must be of the same target when rendering layered, I think 3D depth texture should be allowed. It should not be a big technical problem since 2D texture array works I think.

Humus
07-12-2007, 09:49 AM
2D texture arrays are quite different from 3D textures. There's no filtering between slices in a texture array for instance. A 2D array has more in common with 2D textures than with 3D.