64bit color and directx

Started by
6 comments, last by MadHaTr 16 years, 11 months ago
Okay so i'm new to dx and still learning but I discovered that i can make a 64bit fullscreen window rather than a 32bit one with this "D3DFMT_A16B16G16R16" I put it in here void initD3D(HWND hWnd) { d3d = Direct3DCreate9(D3D_SDK_VERSION); // Create the DIIRECT3D interface D3DPRESENT_PARAMETERS d3dpp; // Create a struct to hold various device information ZeroMemory(&d3dpp, sizeof(d3dpp)); // clear out the struct for use d3dpp.Windowed = FALSE; // program windowed not full screen d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; // Discard old frames d3dpp.hDeviceWindow = hWnd; // set the window be used by direct3D d3dpp.BackBufferFormat = D3DFMT_A16B16G16R16; // set the back buffer format to 32 bit !!!!RIGHT HERE!!!! d3dpp.BackBufferWidth = SCREEN_WIDTH; // sets our back buffers screen width d3dpp.BackBufferHeight = SCREEN_HEIGHT; // Sets our back buffers screen height // create a device class d3d->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev); return; } Now I get a runtime error. Is 64bit only for dx10 cards. i have vista(x64) i read vista supports 64bit color so is it my dx9 card. thanks in advance, will post more info if needed
Advertisement
The format enum contains many different format types. Some can be used as backbuffers, and some can't.

If you're curios which ones you can use, you can check the caps viewer for a complete list.

Most likely, your graphics card supports creating textures of 64bit formats, but not using them as backbuffers.

Most importantly, however, is why exactly you'd want to use 64 bit color? Your monitor doesn't support it anyways...
Sirob Yes.» - status: Work-O-Rama.
They easiest way to see what formats are supported for what purposes on your card is using the DX caps viewer which comes with the SDK.

The floating point formats can't be used as back buffers on any card. The highest accuracy format is A2R10G10B10. However, you can create a floating point render target and then convert to fixed point. Look up "HDR rendering" on the net.
The 64 bit and 128 bit formats are intended for use as high dynamic range render targets or textures. Since current monitors can't display high dynamic range formats directly you can't create a back buffer with that format, you have to do a final tonemapping pass on your HDR render target to convert it into a 32 bit buffer that your monitor is capable of displaying directly.

Game Programming Blog: www.mattnewport.com/blog

Okay I checked out the CAPS, and yeah it is not supported by my backbuffer. So now i'm a little confused, why have 64 and 128bit color on textures or anything if monitors can't display them? When you convert from 128 or 64 down to 32 do you get better results visually?

Render Target formats was supported and all the other texture formats were supported
Quote:Original post by MadHaTr
Okay I checked out the CAPS, and yeah it is not supported by my backbuffer. So now i'm a little confused, why have 64 and 128bit color on textures or anything if monitors can't display them? When you convert from 128 or 64 down to 32 do you get better results visually?

Render Target formats was supported and all the other texture formats were supported

Higher bitrate surfaces are useful for many, many things. One prime example is using HDR, where you calculate lighting at a very high precision level, and then tone-map it down to a lower precision level. This allows the scene to retain detail both in areas that are very bright, and areas that are very dark.

If course, there are many other uses, floating point surfaces can be used for general-use, for storing anything from normals and positions to depth and velocity. The uses are endless, but in all cases, the actual data in the texture is never directly presented to the user.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
Quote:Original post by MadHaTr
Okay I checked out the CAPS, and yeah it is not supported by my backbuffer. So now i'm a little confused, why have 64 and 128bit color on textures or anything if monitors can't display them? When you convert from 128 or 64 down to 32 do you get better results visually?


The point of rendering to a 64 or 128 bit buffer is so you have the full range of brightness available. On a 32-bit surface, the sun might be white (R:255, G:255, B:255). But, the clouds around it are also white. Having the clouds and the sun the same brightness just isn't right. High dynamic range involves rendering to a high-precision buffer such as A16B16G16R16F. Now you have the full range of contrast values stored in a high-precision buffer. But since your monitor can't display this much information directly, you have to tonemap it down to 32 bit.

In effect, this allows bright things to look bright, and dark things to look dark. If you look up at the sun, the sky and clouds around it will appear to darken while the sun will remain at full brighness. This gives the impression that the sun is much brighter than the clouds and sky. It's the same effect you get when taking pictures with a digital camera, since the 32-bit data format can't store the full range of values from real life, it automatically tonemaps the image.
NextWar: The Quest for Earth available now for Windows Phone 7.
Thanks for all the great info guys. It was really helpful. :)

This topic is closed to new replies.

Advertisement