Jump to content
  • Advertisement
Sign in to follow this  
storage

Color depths

This topic is 4798 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

I've been looking around for a while, but I can't find any information (maybe I'm just stupid, could be) on how many bits for everything is used at different "bits per pixel". I'm wondering if my "table" below is correct,a nd what the ?'s should be.
          red    green    blue    alpha    depth buffer    stencil buffer
16 BPP    5      6        5       0(?)     16(?)           ?
24 BPP    8      8        8       0(?)     24(?)           ?
32 BPP    8      8        8       8        24(?)           8
I'm trying to make my engine (which uses GLFW for window creation and input handling) use bits per pixel instead of having the user write the depth of every color manually. Thanks in advance! :) Sorry if I'm totally lost, it's very possible I am.

Share this post


Link to post
Share on other sites
Advertisement
Actually, you are right in a sense, and yet not.

Because, at least when using Direct3D, you can select what each depth should contain, such as R5G5B6 (for R:5 B:5 G:5), or perhaps X1R5G5B5, or you chould use 24D8S (depth:24 stencil:8)... and so on.

Check the Direct3D for documentation on backbuffers and a like and you will see.

So as you pointed out, the bits are just spread out in the different fields according to the format.

from DX documentation:

D3DFMT_D24S8 - 32-bit z-buffer bit depth using 24 bits for the depth channel and 8 bits for the stencil channel.

D3DFMT_R8G8B8 - 24-bit RGB pixel format with 8 bits per channel.
D3DFMT_A8R8G8B8 - 32-bit ARGB pixel format with alpha, using 8 bits per channel.
D3DFMT_X8R8G8B8 - 32-bit RGB pixel format, where 8 bits are reserved for each color.

Share this post


Link to post
Share on other sites
GLFW lets you specify all of those components seperately in glfwOpenWindow. If the video card driver doesn't support the combination you supplied (unlikely unless you did something wacky) then GLFW will choose the closest mode.

There is no table that maps bpp to the depth and stencil buffer, there isn't really any relation between the two. Is there a reason you need anything other than the standard 32 bpp color, 32bpp depth screen format?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!