문제

I'm having problems with drawing in OpenGL and I need to see exactly what values are being placed in the depth buffer. Can anyone tell me how to retrieve these values? Thanks Chris

도움이 되었습니까?

해결책

Use glReadPixels with format = GL_DEPTH_COMPONENT, for example:

float depth;
glReadPixels(0, 0, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth);

Will get the depth of pixel (0, 0).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top