Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 03:47:32 pm
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)SWT Progress
Pages: [1]
Print
Author Topic: SWT Progress  (Read 1843 times)
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« on: 15. February 2007, 10:04:49 pm »

Just want to let everyone know that I have SWT working nearly perfectly in my own environment, both as an Eclipse plug-in as well as a standalone application.  It's rough around the edges and not very Xith-like at the moment so hopefully Marvin can have an IM discussion with me at some point so that I can refactor it in line with Xith design goals.

Also interesting, it behaves much better on the Mac OS X platform now.  Previously, it ran but a number of warnings to the console indicated native memory leaks and the native code would crash upon exit quite frequently.  Now, it seems perfect.

The only outstanding issue is attempting to dispose an object after it has already been disposed.  Once I solve that, SWT will be working in all threading models standalone or inside Eclipse.  Then it's just refactoring it so that it is usable through an API that looks like the AWT, Swing, and LWJGL modes of Xith.

On that last day when I said I would take off, I really didn't so I've put in about 20 straight days > 12 hrs each day.  I'm going to take a rest tonight after a slacker 9 hr day Wink and take some rest over the next few.  Don't be alarmed if I'm not around quite as often for a few days.

I ran these 4 benchmark tests at the same time in the same process just using multiple threads.  Using JOGL_AWT, input went to the right screen at the right time so the user would think that it is 4 separate programs unless you told them.  Using JOGL_SWT, the Q3FlightBenchmark grabbed the mouse and wouldn't let go.

Code:
DisplayMode displayMode = DisplayModeSelector.getImplementation( OpenGLLayer.JOGL_AWT ).getBestMode( 800, 600 );
new MD2LoaderTest( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "MD2Test" ), null );
new BulletTest( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "BulletTest" ), null );
new SharedGroupTest( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "SharedGroupTest" ), null );
new Q3FlightBenchmark( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "Q3FlightBenchmark" ), null );

CameraFlight started.
CameraFlight ended. (average FPS: 78.19)
CameraFlight ended. (average FPS: 75.33)
The MD2LoaderTest was reporting about 90 FPS in the title bar
CPU usage on my Mac Powerbook Pro (Core Duo 2.4 GHz laptop) was about 80% of 1 core


Code:
DisplayMode displayMode = DisplayModeSelector.getImplementation( OpenGLLayer.JOGL_SWT ).getBestMode( 800, 600 );
new MD2LoaderTest( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "MD2Test" ), null );
new BulletTest( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "BulletTest" ), null );
new SharedGroupTest( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "SharedGroupTest" ), null );
new Q3FlightBenchmark( new CanvasConstructionInfo( displayMode, Xith3DTest.DEFAULT_FULLSCREEN, "Q3FlightBenchmark" ), null );

CameraFlight started.
CameraFlight ended. (average FPS: 57.9)
CameraFlight ended. (average FPS: 61.02)
The MD2LoaderTest reported about 60 FPS in the title bar
CPU usage on my Mac Powerbook Pro (Core Duo 2.4 GHz laptop) was about 110% of 1 core
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 16. February 2007, 04:31:07 am »

Looks promising. Thanks for keeping us updated.

Please check your PMs.
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #2 on: 16. February 2007, 11:39:34 am »

I integrated the most recent trunk updates.  Good news and bad news for SWT integration.

Good news
  • no more attempts to dispose() the Canvas widget more than once when closing the Shell via the system close box.  Previously, this was an infrequent intermittent bug but it wasn't all that hard to reproduce.  So far, I haven't seen it once.
  • Q3FlightBenchmark no longer grabs the mouse during flight
Bad news
  • Q3FlightBenchmark still grabs the mouse from the system and permanently centers it on Q3FB window until you begin the flight
  • shooting bullets in BulletTest no longer works

Standalone benchmarks from my system; i.e., I didn't run 4 benchmarks simultaneously for these like I did yesterday when I was stress testing SWT threading.  (These were run outside Eclipse)

AWT
Hit "Y" to invert the mouse y-axis. Hit ESC to exit.
CameraFlight started.
CameraFlight ended. (average FPS: 194.07)
CameraFlight ended. (average FPS: 203.68)

AWT started from RCP environment - this was my only AWT benchmark yesterday
Hit "Y" to invert the mouse y-axis. Hit ESC to exit.
CameraFlight started.
CameraFlight ended. (average FPS: 168.14)
CameraFlight ended. (average FPS: 170.18)

SWT
Hit "Y" to invert the mouse y-axis. Hit ESC to exit.
CameraFlight started.
CameraFlight started.
CameraFlight ended. (average FPS: 172.57)
CameraFlight ended. (average FPS: 173.76)

Since today's results show the same performance for AWT & SWT, yesterday's results probably showed worse for SWT because of the multi-threading.  As far as I know how to do, SWT only supports one Display widget.  Since UI output can only occur in a Thread attached to a Display, I had to transfer all low-level drawing instructions from the X3D rendering thread to the SWT Display thread.  I believe this resulted in yesterday's reduced SWT performance.

Also important: Apple released a Java update today which had some SWT fixes in it.  This may have also helped/hurt.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 16. February 2007, 01:52:47 pm »

  • Q3FlightBenchmark still grabs the mouse from the system and permanently centers it on Q3FB window until you begin the flight

Well, this is done (and wanted) by the FirstPersonInputHandler. If not suspended, it grabs the mouse and auto-centers it and hides the mouse cursor. You should be able to move around with keyboard and mouse until you start the flight.

Oh, ths is a change, that I haven't reported in the API hints thread.

Marvin
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #4 on: 16. February 2007, 03:05:14 pm »

Things appear good enough to check in so I have checked in the latest SWT changes.  If you run SWT mode from the test launcher, you will get an exception describing what you need to do to correctly use SWT as well notes regarding my thoughts about the API Marvin and I will discuss tomorrow night.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
kif74
Just dropped in

Offline Offline

Posts: 1


View Profile
« Reply #5 on: 02. December 2007, 08:54:05 pm »

Hi horati,

i'm interesting in integration of Xith3d in eclipse RCP Platform and would like to contribute in the SWT process.

i dont know if i'm in the right place to post this proposal but if you need my help we can work together (and anyone interested in !) to increase perf on swt ;-)

Regards.
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #6 on: 02. December 2007, 09:42:03 pm »

My SWT tests definitely indicate slightly slower performance than AWT tests; however, they are only 5-10% slower than AWT windowed mode on my hardware.  What kind of relative performance are you seeing when you run benchmarks?  Given the likely uses of Xith in SWT and the easy/straightforward integration without optimizing, I never considered this a problem.  Of course if you are seeing significantly different numbers, we should take a look.

If you just want to get started looking into the SWT code, (nearly?) the whole integration is in CanvasPeerSWTImpl.  It just runs an event pump between the SWT render thread and the Xith render thread.  To convert existing code to SWT does require one change: you MUST pass a non-null owner into the Canvas3D factory method and it MUST be of type org.eclipse.swt.Composite.

Also FYI, I haven't been actively monitoring the Xith forum lately but I do receive private messages (they forward to my e-mail).  Luckily, Marvin told me about this one and I'll try to monitor this thread for the next few days.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic