Hi all. Since I’ve been unable to locate a jogl sample for reading the depth buffer, I tried the following only to have jogl crash in native method glReadPixels
// Grab screen z value
FloatBuffer buffer = ByteBuffer.allocateDirect(viewPortWidth * viewPortHeight).asFloatBuffer();
gl.glReadPixels(x, y, viewPortWidth, viewPortHeight, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT, buffer);
depth = buffer.get();
glReadPixels work fine for reading the frame buffer with a ByteBuffer, but the depth component is float so I can’t read to a byte buffer as a byte.
Anyone?