Weird error with multiple Viewports in JOGL 2.0.2

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

Weird error with multiple Viewports in JOGL 2.0.2

painofangels
Hi All,

Since moving from JOGL 2.0 to 2.0.2 I'm having troubles with rendering into different parts of the screen.

I need to render 4 different "subscreens" into one GLJpanel for a medical application. To achieve this, I use the following pseudo-code:

glViewport(0, 0, panel.width / 2, panel.height / 2);
drawView1();

glViewport(panel.width / 2, 0, panel.width / 2, panel.height / 2);
drawView2();

glViewport(0, panel.height / 2, panel.width / 2, panel.height / 2);
drawView3();

glViewport(panel.width / 2, panel.height / 2, panel.width / 2, panel.height / 2);
drawView4();

I would expect (and this worked perfectly in JOGL 2.0) that the whole screen is filled with the renderings of the four different views. Instead, only a fourth of the screen is rendered each time as you can see in the screenshot (note: panel.width and panel.height does not change).
Viewport-Error

One thing I noticed which might be related to this issue: JOGL 2.0 used pBuffers for GLJPanels internally and had to re-initialize the gl-context each time the window was resized. In JOGL 2.0.2 this issue seems to be resolved since I can freely resize my window without any re-initialization... could it be that JOGL 2.0.2 manages its own viewport internally and conflicts with my own settings? How could I work around this?

I hope you guys have any hints.
Greetings!
Reply | Threaded
Open this post in threaded view
|

Re: Weird error with multiple Viewports in JOGL 2.0.2

painofangels
A quick update: It works if I set glCaps.setPBuffer(true) - but why is this neccesary? ;)
Reply | Threaded
Open this post in threaded view
|

Re: Weird error with multiple Viewports in JOGL 2.0.2

gouessej
Administrator
Hi

There is probably a problem with FBOs, that's why you have to use PBuffers instead :( Thank you for the feedback. Maybe fill a bug report, try to provide a tiny test case.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Weird error with multiple Viewports in JOGL 2.0.2

Sven Gothel
Administrator
On 08/27/2013 02:41 PM, gouessej [via jogamp] wrote:
> Hi
>
> There is probably a problem with FBOs, that's why you have to use PBuffers
> instead :( Thank you for the feedback.

It's about GLJPanel's FBO/Java buffer handling and GLSL, yes.

Simply set the viewport back to 'normal' after your draw-commands,
i.e. before GLJPanel composites the buffers.
Otherwise (your erroneous case) our FBO/GLSL code
will use your custom viewport.

~Sven



signature.asc (911 bytes) Download Attachment