多重采样时,如何在OpenGL纹理中解析深度值? [英] How are depth values resolved in OpenGL textures when multisampling?

查看:606
本文介绍了多重采样时,如何在OpenGL纹理中解析深度值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FBO将场景渲染为深度纹理(GL_DEPTH_COMPONENT).当我在应用程序中启用多重采样时,这些采样被解析为单个纹理像素,但是如何将它们组合在一起?是存储到纹理的最近样本的深度还是样本的平均值?这种行为是否与供应商有关?

I'm using an FBO to render my scene to a depth texture (GL_DEPTH_COMPONENT). When I enable multisampling in my application, those samples are resolved to a single texel, but how are they combined? Is the depth of the nearest sample stored to the texture, or the average of the samples? Is this behavior vendor-dependent?

推荐答案

请参见多样本规格文件:

"如果深度测试通过,则所有多样本缓冲区深度样本值 设置为片段最中心样本深度的深度 值,并且所有多样本缓冲区颜色样本值均设置为 传入片段的颜色值."

"If the depth test passes, all multisample buffer depth sample values are set to the depth of the fragment's centermost sample's depth value, and all multisample buffer color sample values are set to the color value of the incoming fragment."

这篇关于多重采样时,如何在OpenGL纹理中解析深度值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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