Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (499)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Threading issue with JOGL (I think?)  (Read 3342 times)
0 Members and 1 Guest are viewing this topic.
Offline lhkbob

JGO Knight


Medals: 32



« Posted 2009-04-24 01:49:59 »

I have a renderer done in jogl that uses the GLEventListener model for making contexts current on the AWT thread, etc.  I noticed that the duration of frames is wildly unstable, ranging from 50s to 1500s in simple scenes (generally in the 1000s, but then the slow frames made it jerky).  When profiling the threads, it showed that my main thread and the AWT thread would alternate blocking each other (doesn't seem good).

I then switched to using an active rendering approach to keep all rendering on my main thread.  Besides a substantial performance boost, the frame rates were very stable (compared to before).  Unfortunately, active rendering isn't as well supported, or so the docs warn about, so I'd like to use the GLEventListener model.

I don't have the multi-threading experience to track down what specifically causes the blocks.  Does anyone have advice for debugging this situation?

Thanks

Offline gouessej

« In padded room »



TUER


« Reply #1 - Posted 2009-04-24 16:32:54 »

Hi!

I use GLEventListener but I explicitly call canvas.display() and it works reliably and fast. However, my frame rate is more stable since I use both JME 2.0 & JOGL. Maybe you should watch the source code of JME and mine too, I wrote a replacement of StandardGame because it didn't work fine with JOGL.

Offline DzzD
« Reply #2 - Posted 2009-04-24 17:45:09 »

and alternately you can check this one wich dont use GLEventListener :

http://www.java-gaming.org/topics/active-rendering-with-jogl/17661/view.html

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lhkbob

JGO Knight


Medals: 32



« Reply #3 - Posted 2009-04-24 19:50:55 »

Hi!

I use GLEventListener but I explicitly call canvas.display() and it works reliably and fast. However, my frame rate is more stable since I use both JME 2.0 & JOGL. Maybe you should watch the source code of JME and mine too, I wrote a replacement of StandardGame because it didn't work fine with JOGL.

I've noticed this, and that's why it's troubling to me.  In my old applications I had stable rates with JOGL too.  I just don't what I did that changed things, and I was hoping someone could point out a general attack plan to track down the problem.

and alternately you can check this one wich dont use GLEventListener :

http://www.java-gaming.org/topics/active-rendering-with-jogl/17661/view.html

I use active rendering very much like this.  Unfortunately I've discovered artifacts when using it on Mac OS X.  When frame rates are low (< 20), other windows can cause artifacts in the java frame (it resemebles double-buffering conflicts).

Offline DzzD
« Reply #4 - Posted 2009-04-24 20:06:18 »

Quote
I use active rendering very much like this.  Unfortunately I've discovered artifacts when using it on Mac OS X.  When frame rates are low (< 20), other windows can cause artifacts in the java frame (it resemebles double-buffering conflicts).
thanks to share your experience, I did not know there was issue on Mac, di you try to found a solution or reasons of those artefacts ?

Offline lhkbob

JGO Knight


Medals: 32



« Reply #5 - Posted 2009-04-24 20:24:03 »

I haven't found a solution yet, but I'll look into it if I can't get the AWT thread to perform better.

Here are some graphs of the fps of a test scene, each sample is the average fps of 10 consecutive frames.  The data was taken after a reasonable start-up time.  The first is the fps when using single-threaded active rendering on the main thread, the second is using the GLEventListener on the AWT thread.

Offline lhkbob

JGO Knight


Medals: 32



« Reply #6 - Posted 2009-04-24 20:34:49 »

Here is an example of what the active rendering glitch looks like on Mac.

Offline DzzD
« Reply #7 - Posted 2009-04-24 20:38:37 »

I already see such but on window with Applet, it appear as it become a dead zone never more rendered. probably a solution can be found but dont have any idea right now...

EDIT :
maybe validate/invalidate/repaint the canvas ?

Offline lhkbob

JGO Knight


Medals: 32



« Reply #8 - Posted 2009-04-25 09:20:34 »

I've set the canvas and frame to ignore repaints.  I tried using a BufferedStrategy (that failed miserably).  I'm at a complete loss as to what causes it (it doesn't seem to be in response to paint calls).  Also, for some reason it only seems to happen now when I use display lists, and then the problem only starts once another window becomes focused.  AGGHHGHG!!!!

Offline gouessej

« In padded room »



TUER


« Reply #9 - Posted 2009-04-27 22:26:56 »

I spoke too fast... Sad I still have some very short slowdowns  Cry Please Kenneth tell us when we could benefit of a release version of JOGL 2.0 with a native window without AWT.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (31 views)
2014-04-15 18:08:23

BurntPizza (28 views)
2014-04-15 03:46:01

UprightPath (43 views)
2014-04-14 17:39:50

UprightPath (26 views)
2014-04-14 17:35:47

Porlus (42 views)
2014-04-14 15:48:38

tom_mai78101 (64 views)
2014-04-10 04:04:31

BurntPizza (124 views)
2014-04-08 23:06:04

tom_mai78101 (224 views)
2014-04-05 13:34:39

trollwarrior1 (190 views)
2014-04-04 12:06:45

CJLetsGame (198 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!