OpenGL 中 glClearDepth 的用途是什么?
What is the purpose of glClearDepth in OpenGL?
好像和glClearColor函数类似。 glClearColor 控制将什么值写入颜色缓冲区,那么这是否意味着 glClearDepth 控制将什么值写入深度缓冲区?
如果给它0.5会怎样?
这个功能什么时候有用?
does this mean that glClearDepth controls what value gets written to the depth buffer?
Description
glClearDepth
specifies the depth value used by glClear
to clear the
depth buffer. Values specified by glClearDepth
are clamped to the
range [0,1].
别忘了您可以使用 other comparisons 而不是默认的 GL_LESS
; GL_EQUAL
特别适用于多通道光照渲染,以防止在不需要时重新计算未绘制的片段。
好像和glClearColor函数类似。 glClearColor 控制将什么值写入颜色缓冲区,那么这是否意味着 glClearDepth 控制将什么值写入深度缓冲区?
如果给它0.5会怎样? 这个功能什么时候有用?
does this mean that glClearDepth controls what value gets written to the depth buffer?
Description
glClearDepth
specifies the depth value used byglClear
to clear the depth buffer. Values specified byglClearDepth
are clamped to the range [0,1].
别忘了您可以使用 other comparisons 而不是默认的 GL_LESS
; GL_EQUAL
特别适用于多通道光照渲染,以防止在不需要时重新计算未绘制的片段。