如何在OGRE中设置深度缓冲区(z缓冲区)的位宽/精度?

时间:2016-09-22 11:35:10

标签: precision ogre depth-buffer

我读到可以使用

找到zbuffer_value
z_buffer_value = (1<<N) * ( a + b / z )

其中:

N = number of bits of Z precision
a = zFar / ( zFar - zNear )
b = zFar * zNear / ( zNear - zFar )
z = distance from the eye to the object

我正在使用OGRE 1.82。如何设置/知道数字“N”?我检查了OGRE :: depthbuffer类,但没有找到数字N的提示。 我正在使用Nvidia GTX TitanX

1 个答案:

答案 0 :(得分:0)

交叉发布:Same question ogre3d.org/forums

您可以通过以下方法获取深度缓冲区的位深度:

uint16 DepthBuffer::getBitDepth() const

API link