GLJPanel + FBO + J2D OpenGl pipeline

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GLJPanel + FBO + J2D OpenGl pipeline

rachotilko
Hello

I'm trying to do an offscreen texture generation using FBOs during the 'display' routine of the GLJPanel-attached GLEventListener. My framebuffer's color-attached textures are generally larger than GLJPanel's surface. Once the offscreen rendering is finished, I render a part of the resulting texture on-screen.

Anyway, the output texture of the rendering process is glitched, when the J2D OpenGL pipeline is activated. The output is just fine when not using any J2D accelleration.

Note that:

1, I am aware of the fact that J2D OpenGL pipeline utilizes FBO's, so I take care to properly save&restore the current framebuffer binding and its color attachments at the start/end of the offscreen rendering.

2, The problem is not caused by subsequent on-screen drawing of the texture, as I saved the texture into the file and it turned out to be glitched the exactly same way as on the screen.

So, my question is: "is the combination of GLJPanel + FBO + (accelerated J2D) supported ?"

PS. I'm doing this in the context of old JOGL1 (I use it for the sake of JOGL1's cute Netbeans plugin, which is still not ported to JOGL2). Will migrating help to JOGL2 mitigate the issue ?
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel + FBO + J2D OpenGl pipeline

Rami Santina
Administrator
Not sure of the internals of the J2D Ogl Pipeline but i guess it uses pBuffers which will surely causes u problems.

My question is why do you need J2D acceleration?

>>PS. I'm doing this in the context of old JOGL1 (I use it for the sake of JOGL1's cute Netbeans plugin, which is still not ported to JOGL2). Will migrating help to JOGL2 mitigate the issue ? 
IMHO  for sure you should migrate to jogl2 since even if a fix/workaround is doable to any problem, jogl1 is not supported anymore. and it will be added/tested to the latest code.
Besides migrating to jogl 2 is easy, mainly change in namespace etc (guess Micheal has a good tutorial for this). And you would benefit from many enhancements on the fly. 

Cheers,
Rami
Reply | Threaded
Open this post in threaded view
|

Re: GLJPanel + FBO + J2D OpenGl pipeline

rachotilko
Thank you for your answer. Anyway, problems were caused by GLJPanel's use of glScissor, which I was no aware of. After I took into account this fact in my code (by properly saving/reseting/restoring scissor box) everything worked just fine ...