Да, абсолютно. Например. (кодируется как I):
glEnable(GL_DEPTH_TEST); // to enable writing to the depth buffer
glDepthFunc(GL_ALWAYS); // to ensure everything you draw passes
glDepthMask(GL_TRUE); // to allow writes to the depth buffer
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
// so that whatever we draw isn't actually visible
glClear(GL_DEPTH_BUFFER_BIT); // for a fresh start
/* here: draw geometry to clip to the inside of, e.g. at z = -2 */
glDepthFunc(GL_GREATER); // so that the z test will actually be applied
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
// so that pixels are painted again...
glDepthMask(GL_FALSE); // ... but don't change the clip area
/* here: draw the geometry to clip inside the old shape at a z further than -2 */
Итак, основные функции:
- тест глубины всегда можно настроить на прохождение
- цветная графика может быть отключена, даже если установлены другие значения буфера