Это устаревший способ, но он должен работать на картах ATI.Это отображает карту глубины в текстуру, но вы можете визуализировать почти все.
// generate texture (in init method)
init(){...
glGenTextures(1, &depthTexture);
glBindTexture(GL_TEXTURE_2D, depthTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 512,
512, 0, GL_DEPTH_COMPONENT,GL_FLOAT, 0);}
// draw the mesh to fill the depth buffer
glDisable(GL_LIGHTING);
draw_mesh();
// copy depth buffer to texture
glBindTexture(GL_TEXTURE_2D, depthTexture);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 512, 512);
// clear screen
cls();
// enable texturing and bind the depth texture
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, depthTexture);
// overlay texture to fullsizequad
drawFullsizeQuad();