Jump to content
  • Advertisement
Sign in to follow this  
footnick

Xna multi sample anti aliasing without Game

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

We have an XNA app targeting PC’s but don’t use a Game object, we implement our own graphic device and content managers. We use the BasicEffect shader and RenderTarget2D (for integration with WPF).

To try to enable multi sample anti aliasing we set the following :


[indent=1]graphicDevice.PresentationParameters.MultiSampleCount = 4;


[indent=1]RasterizerState state = new RasterizerState();

[indent=1]state.CullMode = CullMode.CullCounterClockwiseFace;

[indent=1]state.MultiSampleAntiAlias = true;

[indent=1]graphicDevice.RasterizerState = state;


The documentaton suggests we should set GraphicsDeviceManager.PreferMultiSampling to true, but since we have implemented our own GraphicsDeviceManager class so we can't.

What else do we have to do to enable multi-sampling with the BasicEffect shader?

Share this post


Link to post
Share on other sites
Advertisement
If you're rendering to a render target and not to the backbuffer, then you'll need to make sure that you create that render target with MSAA enabled.

Share this post


Link to post
Share on other sites

If you're rendering to a render target and not to the backbuffer, then you'll need to make sure that you create that render target with MSAA enabled.


Thanks MJP that was what I was missing.

Much appreciated.

Nick

Share this post


Link to post
Share on other sites
Sign in to follow this  

×

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!