DirectX11非固态线框 [英] DirectX11 Non-Solid wireframe

查看:85
本文介绍了DirectX11非固态线框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用C ++在DirectX11中绘制100x100网格,但是会发生以下问题:

I'm attempting to draw a 100x100 grid in DirectX11 using C++, but the following issue happens:

上面的图像显示了我正在使用线框绘制的网格,使用的栅格化器的填充模式设置为"D3D11_FILL_WIREFRAME"和"D3D11_PRIMITIVE_TOPOLOGY_LINELIST"拓扑.线框的线条看起来是交错的,而不是笔直的,线框的某些部分丢失了.

The image above shows a grid I am drawing in wireframe, using a rasterizer with its fillmode set to 'D3D11_FILL_WIREFRAME' and a 'D3D11_PRIMITIVE_TOPOLOGY_LINELIST' topology. The lines of the wireframe appear staggered rather than straight, with some parts of the wireframe missing.

由于我不确定此问题是什么,因此我不确定应该寻找什么,因此,我们将为您提供帮助.

As I'm not sure what this issue is referred to as, I'm not entirely sure what I should be looking for and as such, any help is appreciated.

推荐答案

这是混叠"的经典问题.

This is a classic problem of 'aliasing'.

对于Direct3D 11,您可以使用MSAA(这是常规的抗锯齿选项),或者如果不使用MSAA,则可以使用特定的行算法.请参见 D3D11_RASTERIZER_DESC AntialiasedLineEnable MultisampleEnable .

With Direct3D 11, you can use either MSAA which is a general anti-aliasing option, or use a specific line algorithm if you are not using MSAA. See D3D11_RASTERIZER_DESC AntialiasedLineEnable and MultisampleEnable.

请参见别名 更新:我已将MSAA和AA模式添加到DirectX工具套件教程.

UPDATE: I've added MSAA and the AA mode to the DirectX Tool Kit tutorial.

这篇关于DirectX11非固态线框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆