Jump to content
  • Advertisement
Sign in to follow this  
xegoth

How to enabel antialiasing?

This topic is 5465 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'm using DX 9.0c and I want to turn on anti aliasing for my 3d game, the trouble is the only way I know how is by changing my 3d card settings to force antialiasing. Does anyone know how to set it in the DX code? Even better would be if I could check what the card supports and do as much antialiasing as possible.

Share this post


Link to post
Share on other sites
Advertisement
Use:

IDirect3D9::CheckDeviceMultiSampleType

to check how much the card can multisample.

Use this to cycle through and find what level the card is capable:

D3DMULTISAMPLE_TYPE

The above is an enumerated type, so you just have to place an integer variable in its place in the first function.

You also have to specify a different swap effect to enable it. In other words, you need to alter your D3DPRESENT_PARAMETERS structure's SwapEffect, MultiSampleQuality, and MultiSampleType members. Then, you pass that structure into IDirect3D::CreateDevice() as usual.

So:

1) use for-loop with IDirect3D9::CheckDeviceMultiSampleType as the body, iterating through the D3DMULTISAMPLE_TYPE argument.

2) Select whatever multisampling value you wish, stick it into your D3DPRESENT_PARAMETERS structure.

3) Pass that D3DPRESENT_PARAMETERS structure into IDirect3D::CreateDevice function.

Hope this helps at least somewhat.

PS: to further this, go to:

DirectX Graphics : Referrence : Direct3D Referrence : Structures : D3DPRESENT_PARAMETERS

and

DirectX Graphics : Referrence : Direct3D Referrence : Enumerated Types : D3DSWAPEFFECT

and

DirectX Graphics : Referrence : Direct3D Referrence : Interfaces : IDirect3D9 : CreateDevice

ALL of these are in the SDK documentation. Each colon represents the next level down within the documentation.
:)

Share this post


Link to post
Share on other sites
you can control stuff with renderstates to (after actually setting it in the present params that is) have a look at:

DirectX Graphics -> Programming Guide -> Advanced Topics -> Antialiasing -> Full-Scene Antialiasing

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!