XNA 抗锯齿问题!
我在 XNA 和抗锯齿方面遇到了问题。 但是我可以使用它来激活它
graphics.PreferMultiSampling = true;
graphics.ApplyChanges();
- 它只是 2 倍抗锯齿。即使我设置
graphics.GraphicsDevice.PresentationParameters.MultiSampleType = MultiSampleType.SixteenSamples;
它也只保持 2 倍抗锯齿。如果我进入我的显卡驱动程序设置 (NVIDIA GeForce 9800 GT) 并将应用程序中的抗锯齿类型设置为 16x,那么我会得到漂亮且干净的抗锯齿效果。但如果它设置为“应用程序决定”,我不会得到超过 2 倍的结果
有人知道为什么吗? 谢谢!
I've got problems with XNA and antialiasing. I can activate it using
graphics.PreferMultiSampling = true;
graphics.ApplyChanges();
however - it's only 2x antialiasing. Even if I set
graphics.GraphicsDevice.PresentationParameters.MultiSampleType = MultiSampleType.SixteenSamples;
it stays only 2x antialiasing. If i go to my graphics driver settings (NVIDIA GeForce 9800 GT) and set Antialiastype from Application decides to 16x, then I get nice and clean antialiasing. But if it's set on 'Application decides' i don't get more than 2x
Anyone an idea why?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会尝试按照 MSDN 上的说明进行操作。在 XNA 论坛的此帖子中,Shawn Hargreaves 告诉另一个人 (谁正在使用与您类似的代码)这不是设置多重采样的方法。他表示应该在创建设备时在参数中指定。 MSDN 文章显示了要在适当的时间处理哪个事件来设置抗锯齿。 这个帖子也基本上表明了同样的事情:你应该执行这个事件处理程序中的设置类型。
另外,我相信 MSDN 示例会检查 4XAA 和 2XAA,因此您可能需要更改代码以支持 16XAA。在研究这个问题时,我在我链接的第一个 XNA 线程中看到了这句话:
所以,我不知道你必须使用什么设置才能获得 16XAA;你可能需要稍微尝试一下。
I would try following these instructions on MSDN. In this thread at the XNA forums, Shawn Hargreaves tells another person (who is using code similar to yours) that this isn't the way to setup multisampling. He indicates that it's supposed to be specified in the parameters when you create the device. The MSDN article shows which event to handle to set up antialiasing at the proper time. This thread also basically indicates the same thing: that you should perform this type of setup in the event handler.
Also, I believe the MSDN example checks for 4XAA and 2XAA, so you may have to change the code to support 16XAA. While looking into this though, I saw this quote in the first XNA thread I linked:
So, I don't know exactly what settings you'll have to use to get 16XAA; you may have to play around with it a bit.