Headless Rendering

Started by smith, August 26, 2010, 00:18:06

Previous topic - Next topic

smith

Is it possible to use OpenGL to render without creating a Display. Pbuffers don't seem to work for me, when I try glReadPixels I get 1282 (invalid operation) errors. I am using Ubuntu and NVidia's drivers and reading using:

GL11.glReadPixels(0, 0, 800, 600, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, byteBuffer);

A HeadlessDisplay class that efficiently updates a Java2D BufferedImage (or even a ByteBuffer) would be a pretty cool addition to LWJGL.




Estraven

Hi,

I agree, I indeed had the same problem,

I worked it around this by creating a very small AWTGLCanvas outside my JFrame, and then used only FBOs.

But you have to open a JFrame at some point.

Estraven

smith

I finally managed to make the issue go away. After much trial and error the PixelFormat that is used to create the pBuffer seems to be the issue. The default constructor doesn't require depth or stencil buffers and for some reason this causes a Invalid Operation when trying to readPixels(). Changing to an 8,8,1 PixelFormat fixed the issue.