Jump to content

  • Log In with Google      Sign In   
  • Create Account

Multisampling in XNA?


Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1   Members   -  Reputation: 236

Like
0Likes
Like

Posted 12 April 2014 - 06:21 AM

Hey guys, simple question. How do you change the multisample count/quality in Xna 4?

I've seen plenty of articles talking about it back in xna 3.1 but none for 4.

 

And what different options are there? I've seen a project that chose between 2x and 4x. I know some modern games (and unity I believe) do 8x now. 

Thanks muchly!



#2   Members   -  Reputation: 510

Like
0Likes
Like

Posted 14 April 2014 - 02:34 AM

I did find some documentation on the Microsoft site for this a while ago but I can't find it again. You were selecting sample count on a device reset handler or something like this.

 

Without being able to locate that resource again all I can do is tell you that if you use render targets, you can create the render target with a given sample count. No support for non 0 quality levels on render targets though.



#3   Members   -  Reputation: 236

Like
0Likes
Like

Posted 14 April 2014 - 05:02 AM

Yeah, I've seen that you can (supposedly) set the multisample count when you instantiate a rendertarget2D. 

 

I'm rather suspicious as to whether it's doing anything (or maybe I'm missing something else) because I've compared screenshots between supposed 2 and 8 multisample counts and they look identical. Also, it doesn't throw any kind of exception if you stick in a 900 count or something ridiculous.

 

So I'd conclude that there's either a bug that it's far too late to expect a solution to or you have to do something else on top of that that I'm missing? 



#4   Members   -  Reputation: 510

Like
0Likes
Like

Posted 14 April 2014 - 05:49 AM

No no, render targets work. I have a solution working in front of my eyes right now. I don't think I did anything special for it to work. The only thing I couldn't figure out was how to determine the maximum supported setting. If you put something wrong, it gets ignored, no exception raised.

#5   Crossbones+   -  Reputation: 7529

Like
0Likes
Like

Posted 14 April 2014 - 08:55 AM


I'm rather suspicious as to whether it's doing anything (or maybe I'm missing something else) because I've compared screenshots between supposed 2 and 8 multisample counts and they look identical. Also, it doesn't throw any kind of exception if you stick in a 900 count or something ridiculous.

 

XNA is probably just ignoring it and setting it to a valid value. You can trivially check this in the debugger, as the RenderTarget2D has a MultiSampleCount. If I put in 900, I get a RenderTarget2D with 8 for MultiSampleCount.

 

As for screenshots looking identical - what are you drawing? Multisampling will only make a difference on the edges of your geometry. So if you're, say, drawing a full screen texture with SpriteBatch or something, you won't see any difference.



#6   Members   -  Reputation: 236

Like
0Likes
Like

Posted 18 April 2014 - 04:53 AM

Sorry about the delay, busy week. Thanks for pointing out that 900 will be truncated to 8. I guess that makes sense. 

 

Haha and yes, I understand what multisampling does. I'm just drawing a regular scene with an environment (trees, bridges etc) and some characters. But no noticable difference (in visuals OR framerate).

 

Whereas in something like Unity, the difference between 2x and 8x is incredibly clear. If anyone can post screenshots of a noticeable difference in XNA 4, I'd love to hear from them!

 

Thanks






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.




PARTNERS