多重采样 FBO 深度/模板和 OpenGL 规格
OpenGL 4.2 规范(第 3.3.1 节)明确指出:
因为每个样本都包含颜色、深度和模板信息,所以颜色(包括 纹理操作)、深度和模板函数的执行效果与 单样本模式。 一个额外的缓冲区,称为多重采样缓冲区,被添加到帧缓冲区中。 像素样本值,包括颜色、深度和模板值,存储在此 缓冲。样本包含每个片段颜色的单独颜色值。 什么时候 帧缓冲区包括多重采样缓冲区,但不包括深度或模板 buffers ,即使多重采样缓冲区不存储深度或模板值。 然而,颜色缓冲区确实与多样本缓冲区共存。
但是,如果我需要深度/模板测试,我必须设置一个 height_stencil 多重采样渲染缓冲区。
这是否违反规格或者我遗漏了什么?
the OpenGL 4.2 specs (section 3.3.1) clearly states that:
Because each sample includes color, depth, and stencil information, the color (including
texture operation), depth, and stencil functions perform equivalently to the
single-sample mode.
An additional buffer, called the multisample buffer, is added to the framebuffer.
Pixel sample values, including color, depth, and stencil values, are stored in this
buffer. Samples contain separate color values for each fragment color.
When
the framebuffer includes a multisample buffer, it does not include depth or stencil
buffers , even if the multisample buffer does not store depth or stencil values.
Color buffers do coexist with the multisample buffer, however.
However, if I need depth/stencil test I have to setup a depth_stencil multisampled renderbuffer.
Does this go against the specs or am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,让我们看看。第 4.4.4 节规定:
在“下面”提到的许多规则中:
因此,如果您的深度/模板缓冲区未进行多重采样,而您的颜色缓冲区进行了多重采样,那么您的 FBO 将不完整。并且您无法渲染到不完整的帧缓冲区对象。
所以,是的,您不仅需要确保它们是多重采样的,而且还必须使用相同数量的样本。
Well, let's see. Section 4.4.4 states:
Among the many rules mentioned "below":
So if your depth/stencil buffer is not multisampled while your color buffer is multisampled, then your FBO will not be complete. And you cannot render to an incomplete framebuffer object.
So yes, you need to not only make sure that they are multisampled, they must use the same number of samples.