PDA

View Full Version : Pixel formats



mandroka
09-07-2000, 06:10 PM
Hi!

I would have the following question:
How I can figure out the maximum Z precision of a card?

I mean what is the maximum value of the cDepthBits field of the PIXELFORMATDESCRIPTOR structure.

Anybody?

----

I am sure that the z precision is somehow connected to the colour depth. I do not understand why I can not set higher precision in 16bpp mode. (I mean I use less memory, so there must be place for Z precision)

Below is a part of my log.

When I call setpixelformat cDepthBits is always 32.

Here's what I could set up (NVIDIA TNT2 - DETONATOR 3):

I have changed to a 16 bpp mode
Opengl::SetPixelFormat -Start
ColorBits:16
DepthBits:16
AccumBits:64
StencilBits:0
Opengl::SetPixelFormat - End

I have changed to a 32 bpp mode
Opengl::SetPixelFormat -Start
ColorBits:32
DepthBits:24
AccumBits:64
StencilBits:0
Opengl::SetPixelFormat - End


thanks,

mandroka

[This message has been edited by mandroka (edited 09-07-2000).]

Serge K
09-15-2000, 05:30 PM
Many 3D cards cannot use arbitrary combinations of Z & color depth.
TNT requires the same size for Z & color buffers:

(color : Z)
16 : 16
32 : 24 + 8 (unused / or stencil buffer).

Zocleus
09-18-2000, 12:29 PM
Hi !
I don't know if this helps but you can get all the available pixel formats that your driver supports with DescribePixelFormat(). Then you can choose the one that you like. I have a program that lists all the pixelformats supported for each driver. If you want it send me an email.

Crusader
09-19-2000, 05:26 AM
could you show us the URL ?

or send it please

dave.sur@caramail.com

Thanks

Zocleus
09-19-2000, 12:25 PM
You guys can check your emails. I sent you the app.

Enjoy !

mandroka
09-19-2000, 05:51 PM
Thank you guys.

Actually what I wanted is to figure out the maximum precision, because my terrain renderer engine has a lot of Z fighting bugs. When I set higher precision these are gone.

Actually, I asked someone at nvidia, and he told me that in 16 bpp mode the max z depth is equal to the colordepth.

Thanks for the app.

Crusader
09-20-2000, 01:56 PM
Thank you

my engine is becoming as quake 0.1

little things always make the big !

Maybe in 1 week I will be able to show
you my engine. http://www.opengl.org/discussion_boards/ubb/smile.gif

birju
09-20-2000, 02:38 PM
you could try to enumerate through all the pixelformat descriptors until you find one with the greatest z buffer precision

Originally posted by mandroka:
Hi!

I would have the following question:
How I can figure out the maximum Z precision of a card?

I mean what is the maximum value of the cDepthBits field of the PIXELFORMATDESCRIPTOR structure.

Anybody?

----

I am sure that the z precision is somehow connected to the colour depth. I do not understand why I can not set higher precision in 16bpp mode. (I mean I use less memory, so there must be place for Z precision)

Below is a part of my log.

When I call setpixelformat cDepthBits is always 32.

Here's what I could set up (NVIDIA TNT2 - DETONATOR 3):

I have changed to a 16 bpp mode
Opengl::SetPixelFormat -Start
ColorBits:16
DepthBits:16
AccumBits:64
StencilBits:0
Opengl::SetPixelFormat - End

I have changed to a 32 bpp mode
Opengl::SetPixelFormat -Start
ColorBits:32
DepthBits:24
AccumBits:64
StencilBits:0
Opengl::SetPixelFormat - End


thanks,

mandroka

[This message has been edited by mandroka (edited 09-07-2000).]

mandroka
09-21-2000, 04:05 AM
My routine does the same. Well, I set the desired z depth value, and it choses the next best matching pixelformat that is higher or equal, but in our cards (mostly nvidia) we do have those ugly z issues.

Thr33d
09-23-2000, 11:01 AM
You usually shouldn't have too many z-buffer fighting problems, you don't sound like a newbie (and i am one) but one thing i've noticed is, do NOT put the near clip plane to 0, i think the usual value people suggest is 1, although i guess it depends alot upon the scale of your scene.

-mike

mandroka
09-23-2000, 11:13 AM
Our engine is a glide based one. I do the gl conversion. It is almost ready except the Z buffer bugs.

(It is an outdoor, heightfiled based terrain engie)

What I found interesting is that the near clipping plane is in 1, and the far plane is between 700 and 4000 according to the player's maximum distance setting.

I have solved this bug once, but I can not remeber what I was doing. http://www.opengl.org/discussion_boards/ubb/frown.gif -(shame)