I looked at the OffscreenRenderer class… can Framebuffer objects be created without a display context? I know it's possible to create a pbuffer because it has its own context.
I agree. The main difference between the two classes is how the FBO is initialized.
A fallback method is now implemented in TextureRenderer, should be easy to adapt it.
low level access to the IntBuffer should be kept, even if higher level utility functions should be incorporated. Image objects tend to depend on the GUI toolkit… I'm also concerned about perfs: today it's impossible to update the IntBuffer 60 times per second. I haven't looked where the bottleneck is (grabScreenContents or image conversion).
2) low level access to the IntBuffer should be kept, even if higher level utility functions should be incorporated. Image objects tend to depend on the GUI toolkit... I'm also concerned about perfs: today it's impossible to update the IntBuffer 60 times per second. I haven't looked where the bottleneck is (grabScreenContents or image conversion).
I don't really think you understood what I meant..
grabScreenContents makes a direct call to GL, but uses RGBA8888 as the image format. The jME Image class directly maps to the OpenGL image formats so there's very little effort needed to implement reading to an Image object.
IRT speed, when you are evaluating be aware that reading data back from the card is going to be fairly slow on most cards as they are optimized mostly for sending data one way (to the card.) I know there were some concerns about that in a related thread.
Well this is mainly for doing offscreen rendering, for producing a video, thumbnails, etc. If you want to render to a GUI you would use a canvas instead.
In my case, it's for integrating in a GUI but outside of the jME canvas (for instance a separate window, etc.)
I don't need 60fps but still, I'd like to optimize the process (right now I'm circumventing the problem with on demand rendering, i.e. I update the image when some event is received)