Skip to main content
gamedev.net
🔒 Locked

Floating point depth buffer for main framebuffer?

Started by Prune May 14, 2009 at 3:37 PM 8 replies 3.5k views
Original Post
Prune
Prune
How do I set the main framebuffer when I create an OpenGL context to use a floating point depth buffer as per WGL_EXT_depth_float (see http://www.opengl.org/registry/specs/ARB/depth_buffer_float.txt )? In the PIXELFORMATDESCRIPTOR do I simply set depthbits to 32? I'm guessing it's not that simple. (note this is different from GL_NV_depth_buffer_float which is for textures rather than the framebuffer)
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)
Prune
Prune
Hi, I can't get it to work, which is strange given I have the latest NVIDIA driver and a GTX285 card.
wglChoosePixelFormat fails with the following attributes if I use the WGL_DEPTH_FLOAT_EXT

WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
WGL_COLOR_BITS_ARB,bitsPerPixel,
WGL_ALPHA_BITS_ARB,8,
//WGL_DEPTH_FLOAT_EXT,GL_TRUE,
WGL_DEPTH_BITS_ARB,depthBits,
WGL_STENCIL_BITS_ARB,0,
WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
WGL_SAMPLES_ARB, 4,
0,0

I tried commenting out the multisampling ones, and also various depthBits, but WGL_DEPTH_FLOAT_EXT still causes the wglChoosePixelFormat to fail. How do I get it working?

A second question as well: how do I set the CSAA coverage amount in my program? i.e., how do I get 8xQ instead of 8x for example. I'd like to do it in the program instead of having to force it in the control panel.

Thanks.
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)
Prune
Prune
Actually it says that extension is taken by wglChoosePixelFormatExEXT rather than wglChoosePixelFormatARB/EXT
There's no such ...Ex function on GLee and I can't find it documented anywhere. Where is it?

[Edit:]Meh, looks like common cards simply don't support that extension. Talk about going after a red herring...
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)
V-man
V-man
Quote:
Original post by Prune
Actually it says that extension is taken by wglChoosePixelFormatExEXT rather than wglChoosePixelFormatARB/EXT
There's no such ...Ex function on GLee and I can't find it documented anywhere. Where is it?

[Edit:]Meh, looks like common cards simply don't support that extension. Talk about going after a red herring...


I'm sure they meant wglChoosePixelFormatEXT
zedz
zedz
why do u need a 32bit fp depth buffer?
keep in mind a lot of hardware wont support it (I dont think any nvidia hardware does for a start)
I suppose with shaders it would be possible to emulate fp32 depth if u really needed it
V-man
V-man
I just noticed that the extension is from 1999. I`m sure someone hardware supported it back then.
Yann L
Yann L
Quote:
Original post by zedz
why do u need a 32bit fp depth buffer?
keep in mind a lot of hardware wont support it (I dont think any nvidia hardware does for a start)
I suppose with shaders it would be possible to emulate fp32 depth if u really needed it

Of course nvidia supports 32fp depth buffers - as depth textures or render buffers attached to FBOs. They're actually very useful, especially combined with shadow mapping or delicate coplanar geometry viewed from a far distance. But since a modern engine is very likely to do all its rendering to an FBO anyway, and will just blit it to the (depthbuffer-less) framebuffer in a last 2D step, no framebuffer fp depth support is needed anymore.
zedz
zedz
yes I see theyre now supported, though only on the latest hardware (Nv8x + better)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.