Garbage on screen?

Hi All,

I’ve ported my stuff over to jsr-231 and when the application first starts up the screen is full of garbage for a split second before the scene displays. I’ve been changing a lot of code recently so don’t know if it’s the new lib or some problems I’ve generated. Has anyone seen this sort of thing? have any suggestions?

Cheers

Peter

Same thing here. I haven’t searched yet the cause of this problem (a too long first frame ?)

Lilian

Be sure to glClear the colors of your framebuffer, otherwise it might show garbage or the last closed gl-context.

glClear is there, and my first frame just starts a couple of threads. There’s some other stuff on the swing side that I suppose could be having an impact. Whats the latest on threading in jogl, is the rendering on the event thread or it’s own thread?

Cheers

Peter

First of all, creating a couple of new threads is quite costly, and the first frame won’t be rendered until the display() method of JOGL has returned.

That could be quite a delay, during which you look at garbage.

The threads are created in the init mthod, and only the start() is called in display. But I changed this now so the threads are started in the init() method too. But still the same garbage. But I now noticed it looks like there are two reshapes being called with identical dimensions, could it be something to do with this?

Thanks

Peter

It’s hard to know exactly what could be going on. I recall some similar issues when porting the jogl-demos over to the new APIs but they largely revolved around the more eager creation of pbuffers. The old 1.1.1 release used to create them lazily but they’re now created and initialized eagerly. Lots of crappy code in applications to detect whether we had to defer the first render was thereby eliminated.

If the jogl-demos exhibit the same problem then please file a bug. Otherwise if you could try to track down what’s going on a little further that would be helpful. Riven’s point that you shouldn’t hold up init() or display() for too long is a good one and you should experiment with making those methods do less work.

Regarding threading, the current default is still for JOGL’s OpenGL work to all be done on the AWT event dispatch thread, but code to switch to using its own thread is in the source tree and we plan to make that the default for the next JSR-231 beta. You can enable it in the current nightly builds with “-Dopengl.1thread=worker”.

So, after some re-work I’ve managed to reduce the time spent in the init() method and the problem is much less noticible. So this is deffinately related to my delays in the init() method. I have a few more changes to make that should speed things up further but I expect this is now fixed :slight_smile:

Thanks all

Peter