XNA 抗锯齿问题!

发布于 2024-08-11 18:19:40 字数 447 浏览 5 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

弱骨蛰伏 2024-08-18 18:19:40

我会尝试按照 MSDN 上的说明进行操作。在 XNA 论坛的此帖子中,Shawn Hargreaves 告诉另一个人 (谁正在使用与您类似的代码)这不是设置多重采样的方法。他表示应该在创建设备时在参数中指定。 MSDN 文章显示了要在适当的时间处理哪个事件来设置抗锯齿。 这个帖子也基本上表明了同样的事情:你应该执行这个事件处理程序中的设置类型。

另外,我相信 MSDN 示例会检查 4XAA 和 2XAA,因此您可能需要更改代码以支持 16XAA。在研究这个问题时,我在我链接的第一个 XNA 线程中看到了这句话:

此外,据我所知,没有任何 GPU 支持 16 个子样本进行多重采样。例如,您在 Nvidia 8000 和 9000 系列上看到的模式名称“16x”实际上使用 4 个样本,质量级别为“2”IIRC。这些GPU最多支持8个子样本,对应“8xQ”和“16xQ”设置。

所以,我不知道你必须使用什么设置才能获得 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:

Also, I know of no GPU that supports 16 sub-samples for multisampling. For example the mode names "16x" that you see on Nvidia's 8000 and 9000 series actually uses 4 samples, with a quality level of "2" IIRC. The most those GPU's support is 8 sub-samples, which corresponds to the "8xQ" and "16xQ" settings.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文