# Initialization

## Recommended Posts

Hey guys I'm starting this BIG app and I want the developer to have control of various configuration modes, so I check for display formats, device capabilities, set an option to fullscreen and now I'm checking for multisample, is multisample == AA? cause all games here can run on 16x AA and now I'm checking the backbuffer format (usually D3DFMT_A8R8G8B8) and I can't go over 8 samples O_o I have a geforce 9800 GTX+ and, as I said, all my games work with 16xCSAA Any ideas?

##### Share on other sites
Yes, multisampling is used for anti-aliasing. It's commonly abbreviated as MSAA.

The "16x" MSAA mode on Nvidia GPU's isn't actually real 16xMSAA, it only uses 8 subsamples. Hence in DX the maximum number of subsamples will be 8. To enable 16x AA and 16x CSAA, you need to specify a non-zero quality level.

This page explains the different MSAA modes in more detail, and tells you what parameters to pass.

##### Share on other sites
Thank you!

I really should look into that a little more...

##### Share on other sites
I implemented AA in my project yesterday so it's fresh in my memory.

The first mistake I did was to simply pass D3DMULTISAMPLE_X_SAMPLES when I create my device.

Here's how you check if a certain mode is supported and the number of quality levels for that mode:

// Default = No multisampling.D3DMULTISAMPLE_TYPE MultiSampleType = D3DMULTISAMPLE_NONE;DWORD MultiSampleQuality = 0;DWORD outQuality = 0;if (D3D_OK == m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,			D3DDEVTYPE_HAL,  			D3DFMT_A8R8G8B8, // Backbuffer format			!bFullscreen,    // Windowed			D3DMULTISAMPLE_X_SAMPLES,			&outQuality)     // Quality levels			) 			&&	D3D_OK == m_pD3D->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,			D3DDEVTYPE_HAL,			D3DFMT_D24S8,    // Depth buffer format			!bFullscreen,			D3DMULTISAMPLE_X_SAMPLES,			NULL) 			){	// Success	MultiSampleType = D3DMULTISAMPLE_X_SAMPLES;	MultiSampleQuality = outQuality - 1;}else{	// Failure}

Also, you can only use D3DSWAPEFFECT_DISCARD when using multisampling or CreateDevice will return Invalid call.

##### Share on other sites
Ha! thanks! I got my way around it, but I was about to post right now about depth/stencil buffer formats, If I could check them like I check for framebuffer types! let me show you how it looks so far

I made a big scene graph and some basic modules previously, but I had to recompile everytime I wanted a new PC to run (with a different/older gfx card) now I'm making some initialization dialogs and stuff to allow me to test Dx features and make it more stable.

Another thing, how can I compile a "release" version of my app that does not require Dx SDK? is there a simple way? once long ago I tried sending the DLLs but it gave me lots of problems and didn't work in the end... I wanted other ppl to test device capabilities (see if it really works...)

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

• ### Forum Statistics

• Total Topics
628281
• Total Posts
2981797

• 10
• 11
• 17
• 14
• 9