如何获取GPU多重采样模式描述?
我在 OpenGL 游戏中实现 AA,并使用 wglChoosePixelFormatARB 来选择合适的渲染上下文。但选择正确的模式存在问题。
您可能知道 GPU 可以以各种组合使用各种 AA 策略(MSAA、SSAA、CSAA 等)。例如,如果我请求 WGL_SAMPLES_ARB = 8
我会得到非常好的抗锯齿效果,但当我调用 glDisable(GL_MULTISAMPLE)
时,它只会部分禁用,而当我请求 WGL_SAMPLES_ARB = 7
,可以很好地禁用它。
这是我找到的引用:
最初只有多重采样抗锯齿 (MSAA)。 SAMPLES 指定为每个像素分配给该系统帧缓冲区的 MSAA 样本数。干净、简单。
然后,GPU 供应商添加了对超级采样抗锯齿 (SSAA)、覆盖采样抗锯齿 (CSAA) 以及三者组合的支持。例如,以下是采用最新 OpenGL 3.3 驱动程序的 NVidia GTX285 上可用的模式:
<小时>AA 模式/说明
- 0 - 关闭
- 1 - 2x (2xMS)
- 5 - 4x (4xMS)
- 7 - 8x(4xMS,4xCS)
- 8 - 16x(4xMS,12xCS)
- 9 - 8x(4xSS,2xMS)
- 10 - 8x (8xMS)
- 12 - 16x(8xMS、8xCS)
因此,我正在寻找一种方法来获取 AA 模式描述,以及它组合了哪些类型的 AA。我该怎么办?
I'm implementing AA in my OpenGL game and I'm using wglChoosePixelFormatARB
to select suitable rendering context. There's a problem with selecting the right mode though.
As you may know GPUs can use various AA strategies in various combinations (MSAA, SSAA, CSAA, etc). E.g. if I request WGL_SAMPLES_ARB = 8
I get very nice anti-aliasing, but it does disables only partially when I call glDisable(GL_MULTISAMPLE)
, while when I request WGL_SAMPLES_ARB = 7
, it can be disabled well.
Here's quote that I've found:
Originally there was only multisample antialiasing (MSAA). SAMPLES was designated for the number of MSAA samples per pixel to allocate for that system framebuffer. Clean, simple.
Then the GPU vendors added support for supersample antialiasing (SSAA), coverage sample antialiasing (CSAA), and combinations of the three. For instance, here are the modes available on an NVidia GTX285 on the latest OpenGL 3.3 drivers:
AA Mode / Description
- 0 - Off
- 1 - 2x (2xMS)
- 5 - 4x (4xMS)
- 7 - 8x (4xMS, 4xCS)
- 8 - 16x (4xMS, 12xCS)
- 9 - 8x (4xSS, 2xMS)
- 10 - 8x (8xMS)
- 12 - 16x (8xMS, 8xCS)
So, I'm looking for a way to get AA mode description, which kinds of AA it combines. Ho do I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,通过交叉检查相关供应商的相关文档,除了您所写的内容之外,没有任何描述。
不幸的是,OpenGL 或 Direct3D 都没有提供任何有关 AA 模式实际含义的文档。
To the best of my knowledge, there is no description, other than what you write, by cross-checking the relevant documentation from the relevant vendor.
Neither OpenGL or Direct3D provide any kind of documentation of what the AA mode actually means, unfortunately.