off screen render in LWJGL

Started by kapcip, July 14, 2016, 05:40:15

Previous topic - Next topic

kapcip

I need to implement off screen rendering where I can draw without creating the Display Window.
Then I would save the pixels to the file system as JPEG/PNG image.

I've read on Internet that PBuffer is one lead. I created PBuffer and didn't create the Display (Display.create()) but that is not getting updated after each draw or some other operation.

One example is: http://forum.lwjgl.org/index.php?topic=3347.0;prev_next=prev#new

What is the way to do it or any working example of PBuffer?

quew8

My recommendation would be to update to LWJGL3. GLFW is the windowing api and it will let you create a hidden OpenGL context (via the GLFW_VISIBLE window creation hint) which you can render to as normal. LWJGL3 also comes with the stb library which has utilities for saving image files so most of that work is done for you too without messing around with ImageIO and the like.

If you want to stick with LWJGL2 then you are going to have to explain in what way the example you linked isn't working. What isn't being updated?