Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (516)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
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  
  Performance of LWJGL vs JOGL  (Read 2465 times)
0 Members and 1 Guest are viewing this topic.
Offline Vorax

Senior Duke


Projects: 1


System shutting down in 5..4..3...


« Posted 2005-10-15 05:26:00 »

I managed to get  my code updated to use LWJGL instead of JOGL.   I have one version of each at the moment - exactly the same code, except the GL API calls.  I have everything setup to do performance testing since I was already doing that before switching to LWJGL.  The test is a single scene in a game I am working on that pushes the engine hard.  The GL calls to render it cover a broad set and it has a high vertex count.  This isn't a full fledge benchmark of course, or I would need numbers on the calls, verts, etc...but it's a realistic test based on typical usage.

The results:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
Tested using AMD 2600+, 512MB RAM, nVidia Geforce 5700OC, 256MB (latest drivers)

1) FPS - No shadows

            JOGL |  LWJGL
--------------------------------------------------------
  800x600:    140 |  155
1024x768:     100 |  110


2)  FPS - With full scene dynamic stencil buffer shadows (1 light source)

            JOGL |  LWJGL
--------------------------------------------------------
  800x600:    50 |  51
1024x768:     35 |  35


The engine is very optimized.  For JOGL, the code has been profiled every which way from sunday using numerous tools checking everything from memory to CPU.  Rendering is sorted using an optimized hash algorithm that works specifically with the types of state changes, material, texturing etc that you would want to avoid.  The reason I decided to try out LWJGL is because the biggest bottlenecks I could find (that could possibly be optimized)  where now in JOGL iteslf (not the GL calls, but the API). 

I have yet to optimize the code for LWJGL.  I expect there is a fair amount I can do because so much of the API uses NIO, where my original code was using java arrays for many of the calls (except VBO's and Vertex Arrays which in JOGL also use nio buffers).  I am sure I am allocating buffers that I don't need to, etc.  in the current LWJGL version.

Bottom line - I am impressed with LWJGL.  Smiley


Offline princec

JGO Kernel


Medals: 409
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2005-10-15 10:52:53 »

And so you should be Smiley Elias & Spasi & Matzon have worked long and hard to make it better than everything else  Grin

Cas Smiley

Offline Ken Russell

JGO Coder




Java games rock!


« Reply #2 - Posted 2005-10-17 22:22:20 »

Are you running full-screen or windowed mode?

If you're running on Windows, does specifying the system property -Djogl.GLContext.nofree have any effect on the performance of the JOGL version?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Vorax

Senior Duke


Projects: 1


System shutting down in 5..4..3...


« Reply #3 - Posted 2005-10-18 14:41:18 »

Are you running full-screen or windowed mode?

If you're running on Windows, does specifying the system property -Djogl.GLContext.nofree have any effect on the performance of the JOGL version?


The tests were done in windowed mode.

I tried the switch and got the following exception:

net.java.games.jogl.GLException: Error making context current: 127
   at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:153)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:125)
   at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:248)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.invokeGL(WindowsOnscreenGLContext.java:79)
   at net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:236)
   at net.java.games.jogl.GLCanvas.display(GLCanvas.java:77)
   at com.vorax.VoraxEngine.doGameLoop(VoraxEngine.java:459)
   at com.vorax.VoraxEngine.startGame(VoraxEngine.java:430)
   at com.vorax.VoraxEngine.engineLoop(VoraxEngine.java:922)
   at Pacifica.main(Pacifica.java:87)

Offline Ken Russell

JGO Coder




Java games rock!


« Reply #4 - Posted 2005-10-18 15:28:37 »

I think the difference in frame rates is probably due to the fact that LWJGL leaves its AWTGLCanvas's OpenGL context current on the AWT event queue thread. while JOGL releases it after each frame for correctness purposes. JOGL's nofree option (which emulates this behavior and is a workaround for memory leaks in ATI's Mobility Radeon 9700 drivers) seems to work for me and if you are willing to try to diagnose why you're getting the error please contact me via PM.
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.

TehJavaDev (32 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (58 views)
2014-10-16 15:22:06

Norakomi (47 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!