gpt4 book ai didi

opengl - 多重采样 FBO 深度/模板和 OpenGL 规范

转载 作者:行者123 更新时间:2023-12-04 06:01:42 26 4
gpt4 key购买 nike

OpenGL 4.2 规范(第 3.3.1 节)明确指出:

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.



但是,如果我需要深度/模板测试,我必须设置一个 depth_stencil 多采样渲染缓冲区。

这是否违反规范,还是我遗漏了什么?

最佳答案

走着瞧。第 4.4.4 节指出:

A framebuffer object is said to be framebuffer complete if all of its attached images, and all framebuffer parameters required to utilize the framebuffer for rendering and reading, are consistently defined and meet the requirements defined below. The rules of framebuffer completeness are dependent on the properties of the attached images, and on certain implementation-dependent restrictions.



在“下面”提到的许多规则中:

The value of RENDERBUFFER_SAMPLES is the same for all attached render-buffers; the value of TEXTURE_SAMPLES is the same for all attached tex-tures; and, if the attached images are a mix of renderbuffers and textures, the value of RENDERBUFFER_SAMPLES matches the value of TEXTURE_-SAMPLES.



因此,如果您的深度/模板缓冲区不是多重采样而您的颜色缓冲区是多重采样的,那么您的 FBO 将不完整。并且您无法渲染到不完整的帧缓冲区对象。

所以是的,您不仅需要确保它们是多重采样的,还必须使用相同数量的样本。

关于opengl - 多重采样 FBO 深度/模板和 OpenGL 规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8832902/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com