Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (483)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3] 4
  ignore  |  Print  
  Java2D/JOGL Interoperability Demo  (Read 90703 times)
0 Members and 1 Guest are viewing this topic.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #60 - Posted 2006-07-25 11:02:27 »

Sorry, I can't reproduce this behavior. On my laptop (Windows XP, NVidia graphics hardware) without the Java2D/OpenGL pipeline JDK 5.0 runs the demos.jgears.JGears application at about 4 FPS when the demo is maximized, and JDK 6 runs it at about 6 FPS. Of course these numbers are really far off the numbers when the Java2D/OpenGL pipeline is enabled with JDK 6 (83 FPS).

Are you specifying -Dsun.java2d.noddraw=true in both cases? This is required for correctness; see the JOGL User's Guide.
Offline samkass

Junior Newbie





« Reply #61 - Posted 2006-07-28 19:41:03 »

Are you specifying -Dsun.java2d.noddraw=true in both cases? This is required for correctness; see the JOGL User's Guide.

I had  -Dsun.java2d.ddscale=true and -Dsun.java2d.d3d=true, and didn't specify noddraw=true.  I'll try those.  Do you think noddraw=true will improve the performance?

I'll also try putting together my version of JCanyon into a self-contained app that can reproduce this behavior.  If I do so, should I submit the bug to Sun or send it elsewhere?
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #62 - Posted 2006-07-28 21:37:32 »

I had  -Dsun.java2d.ddscale=true and -Dsun.java2d.d3d=true, and didn't specify noddraw=true.  I'll try those.  Do you think noddraw=true will improve the performance?

These options enable more DirectDraw and Direct3D functionality in the Java2D implementation. DirectDraw/D3D and OpenGL are fundamentally incompatible at the driver level. I have seen many problems on various vendors' cards when they are combined at all in the same application. The only way to guarantee robust behavior of JOGL on Windows platforms is to completely disable Java2D's use of DirectDraw and D3D. The only Java2D command-line option you should specify is -Dsun.java2d.noddraw=true.

Quote
I'll also try putting together my version of JCanyon into a self-contained app that can reproduce this behavior.  If I do so, should I submit the bug to Sun or send it elsewhere?

You should file a bug using the Issue Tracker on the JOGL home page. You'll need to be an Observer of the project to do so.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline samkass

Junior Newbie





« Reply #63 - Posted 2006-07-29 17:13:50 »

These options enable more DirectDraw and Direct3D functionality in the Java2D implementation. DirectDraw/D3D and OpenGL are fundamentally incompatible at the driver level. I have seen many problems on various vendors' cards when they are combined at all in the same application. The only way to guarantee robust behavior of JOGL on Windows platforms is to completely disable Java2D's use of DirectDraw and D3D. The only Java2D command-line option you should specify is -Dsun.java2d.noddraw=true.

I tried taking the unmodified jcanyon JOGL demo source, building it on Java 1.6 beta 2 (with JOGL beta 5) and running it, and comparing it to Java 1.5.0_07 running with -Dsun.java2d.noddraw=true (and without the opengl pipeline).  This is with the AWT/heavyweight rendering.  The slowdown is less obvious in heavyweight, but is still present.  Once you approach the canyon, Java 1.5 beats Java 1.6 by a few fps consistently.  With the extra slowdown involved in lightweight rendering, the "few fps" slowdown remains but becomes a much higher percentage.  (eg. heavyweight I'd get, perhaps, 17fps->14fps, while in lightweight I'd get 8fps->5fps.)

I guess I'll start with filing a JOGL bug, since this slowdown brings the rendering speed below the threshold at which it appears to be "animation" and turns it into a fast slideshow, and I'd really like to embed 3D in this non-opengl-mode, lightweight application.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #64 - Posted 2006-07-29 18:53:52 »

I don't think there's anything that can be done in JOGL for this. While I don't know why you're seeing a slowdown with Mustang relative to 5.0, the framerates you're getting for the heavyweight case clearly indicate that the lack of accelerated 3D on your ThinkPad is the issue. On modern hardware you should easily be getting >30 FPS for the heavyweight JCanyon case. The GLJPanel is going to be significantly slower in all configurations except when you can enable the Java2D/OpenGL pipeline with Mustang with -Dsun.java2d.opengl=true.
Offline samkass

Junior Newbie





« Reply #65 - Posted 2006-07-30 00:08:31 »

I pretty much reached the same conclusion this afternoon.  I think because of the weak GPU features I'm processor-limited here in execution time.

And it appears JDK 1.6 is simply slower at the general-purpose tasks involved in rendering JCanyon.  Looks like we'll just have to see if it speeds up before release or wait for JDK 1.6.1.

Offline Ken Russell

JGO Coder




Java games rock!


« Reply #66 - Posted 2006-07-30 02:25:53 »

The Java HotSpot client compiler has been almost completely rewritten in Mustang and uses much more general internal representation, code generation and register allocation schemes. Our internal benchmarks indicate that it beats the old client compiler on all benchmarks. That having been said, I ran the JCanyon demo side-by-side with 5.0 and do seem to see about a 10% slowdown with Mustang in some areas of the terrain. On the other hand, if you run with the server VM (java -server) there is a large speed boost in these same areas.

The direction we are moving in the Java SE 7 release is toward a tiered compilation system where the client and server compilers are merged. This will yield the startup characteristics of the client compiler and the peak performance characteristics of the server compiler. There isn't going to be a 1.6.1 release, though there will be update releases to Mustang once it ships. It's possible the tiered system may appear in an update although that work is targeted toward Java SE 7. I don't anticipate an extensive amount of optimization work being done in the client compiler in the interim.
Offline yottzumm

Junior Newbie





« Reply #67 - Posted 2006-09-17 19:35:16 »

Has anyone tried JEditorPane with content type text/html with a transparent background overlaid with JLayeredPane on top of an animation?  I'm doing this,
and it looks like the bottom part of the text is cut off.  MacOSX, Java 6, DP5.

Yes, I know I'm challenging the technology.   But it ALMOST works!  So close!  I want a web HUD.

John
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #68 - Posted 2006-09-17 22:23:23 »

Do you have a test case? We can check to see whether the problem happens on other platforms.
Offline yottzumm

Junior Newbie





« Reply #69 - Posted 2006-09-17 23:26:53 »

Just bring up the Java console.  The problem shows up there.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline yottzumm

Junior Newbie





« Reply #70 - Posted 2006-09-17 23:28:31 »

Not all fonts are bad in JEditorPane, h1 an h3 work, just the ordinary fonts show similar to the Java Console.  I can't reproduce the problem on Linux
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #71 - Posted 2006-09-18 21:48:39 »

I haven't seen any problems with the Java console on OS X. Could you please provide a self-contained test case if you're seeing problems?
Offline ChrisNF

Senior Newbie





« Reply #72 - Posted 2007-02-12 05:11:37 »

Hello,

I'm trying to run the JGears demo on a Radeon 7000 with the latest drivers and JDK 6.  I have 2 monitors connected, but the window is running on only one.  I'm using these arguments:

-Dsun.java2d.opengl=true
-Djogl.debug.Java2D
-Djogl.debug.GLJPanel

The debugging output follows.  At the start, the frame rate is good (around 60) and it decreases as I increase the window size.  But, if I make the window wider than about 1024, the gears disappear.  This is less than full screen (I'm running at 1280X1024).  The background still looks ok.  The frame rate drops to about 10 and my mouse pointer becomes jumpy.  I can make it full height no problem. 

I tried -Dsun.java2d.noddraw=true as well, but it didn't have any effect.

I can run Chris Campbell's Bezier3DAnim demo (the one that introduced this interoperability) and the other demos that don't use Java2d integration (i.e. Gears) at full screen without any problem.

Christopher

JOGL/Java2D integration enabled
Starting initialization of J2D FBO share context
Ending initialization of J2D FBO share context
GLJPanel.addNotify()
GLJPanel.handleReshape: (w,h) = (292,246)
Sending reshape because viewport changed
  viewportX (0) ?= oglViewport.x (0)
  viewportY (0) ?= oglViewport.y (24)
INIT GL IS: com.sun.opengl.impl.GLImpl
Chosen GLCapabilities: GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
glViewport(0, 24, 292, 246)
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: RADEON 7000 DDR x86/SSE2
GL_VERSION: 1.3.1072 WinXP Release
GLJPanel.handleReshape: (w,h) = (292,247)
Sending reshape because surface changed
New surface = sun.java2d.opengl.WGLSurfaceData$WGLOffScreenSurfaceData@435a3a
Sending reshape because viewport changed
  viewportX (0) ?= oglViewport.x (0)
  viewportY (24) ?= oglViewport.y (289)
INIT GL IS: com.sun.opengl.impl.GLImpl
Chosen GLCapabilities: GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
glViewport(0, 289, 292, 247)
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: RADEON 7000 DDR x86/SSE2
GL_VERSION: 1.3.1072 WinXP Release
GLJPanel.handleReshape: (w,h) = (961,742)
Sending reshape because surface changed
New surface = sun.java2d.opengl.WGLSurfaceData$WGLOffScreenSurfaceData@3b1f38
Sending reshape because viewport changed
  viewportX (0) ?= oglViewport.x (0)
  viewportY (289) ?= oglViewport.y (24)
INIT GL IS: com.sun.opengl.impl.GLImpl
Chosen GLCapabilities: GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
glViewport(0, 24, 961, 742)
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: RADEON 7000 DDR x86/SSE2
GL_VERSION: 1.3.1072 WinXP Release
GLJPanel.handleReshape: (w,h) = (1008,742)
Sending reshape because surface changed
New surface = sun.java2d.opengl.WGLSurfaceData$WGLOffScreenSurfaceData@1f01a29
INIT GL IS: com.sun.opengl.impl.GLImpl
Chosen GLCapabilities: GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
glViewport(0, 24, 1008, 742)
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: RADEON 7000 DDR x86/SSE2
GL_VERSION: 1.3.1072 WinXP Release
GLJPanel.handleReshape: (w,h) = (1011,742)
Sending reshape because surface changed
New surface = sun.java2d.opengl.WGLSurfaceData$WGLOffScreenSurfaceData@1dee400
INIT GL IS: com.sun.opengl.impl.GLImpl
Chosen GLCapabilities: GLCapabilities [DoubleBuffered: true, Stereo: false, HardwareAccelerated: true, DepthBits: 24, StencilBits: 0, Red: 8, Green: 8, Blue: 8, Alpha: 0, Red Accum: 0, Green Accum: 0, Blue Accum: 0, Alpha Accum: 0, Multisample: false ]
glViewport(0, 24, 1011, 742)
GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: RADEON 7000 DDR x86/SSE2
GL_VERSION: 1.3.1072 WinXP Release
GLJPanel.handleReshape: (w,h) = (1071,742)   <******* HERE IS WHERE IT STOPS DRAWING GEARS ******
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #73 - Posted 2007-02-12 08:48:39 »

Sorry for the trouble, but I doubt we're going to be able to do anything about it. A Radeon 7000 is completely ancient at this point and I'm surprised that the Java 2D / JOGL bridge works on it at all. I don't even think we have any of these cards in-house to test on. Have you tried running this on a more recent video card?
Offline ChrisNF

Senior Newbie





« Reply #74 - Posted 2007-03-02 23:46:34 »

Hi,

Thanks for your attention to my question -- your response helped me get a better graphics card for my machine.  So, now I have an NVidia GEForce 7900 and I'm having a different problem.

I have installed the newest driver 93.71 and I've also tried 93.47 and 93.81 beta with the same result. 

When I run JGears demo I get an exception in nvoglnt.dll -- only if I enable -Dsun.java2d.opengl=true.  I'm not getting any more debugging output than that.  Obviously this is an NVidia driver file problem, but if anyone has any suggestion about what to do, I'd appreciate it.  I checked the NVidia support page, and they basically insist you contact the manufacturer (Dell, in my case) which is ridiculous.  I will email them too, but I bet they will claim it's a JOGL/Java2d interoperability problem.

If I don't enable JOGL/Java2d interoperability, it doesn't crash, but slows to a crawl when I enlarge the window.

Oh, and I enable -Dsun.java2d.noddraw=true in all cases.

The other demos, which don't use GLJPanel, appear to work without any problems.

Does anyone also have this problem?  Any advice on how I should proceed?  Right now I'm thinking I'll just have to use a GLCanvas, but I was really wanted a lightweight component.

Christopher
Offline ChrisNF

Senior Newbie





« Reply #75 - Posted 2007-03-02 23:48:18 »

I should also add I've tried the newest nightly build of JOGL as well as the most recent release.

Chris
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #76 - Posted 2007-03-03 04:30:50 »

I suspect this is a known and fairly recent regression in NVidia's drivers. If you also specify -Dsun.java2d.opengl.fbobject=false does that get you past the crash?
Offline ChrisNF

Senior Newbie





« Reply #77 - Posted 2007-03-03 19:23:26 »

Ken -- thanks so much!  That worked like a charm... full screen FPS now > 300.

Chris 
Offline pjacobs

Junior Newbie





« Reply #78 - Posted 2008-04-04 18:15:05 »

Could I ask what the current status of this demo is?  I've tried it on a handful of machines (OS X, Vista 32, Vista 64, XP 32, with nVidia and ATI video cards), but I haven't had any luck.  On the windows machines, the demo window doesn't redraw at all.  On the Mac, the demo desktop is visible, and the Hello World sub-window is visible, but none of the demos in the Action menu work.

In general, in my own code, I've been having the problem that whenever the Java2d OpenGL pipeline is enabled, nothing renders into any lightweight Swing components (even when not using GLJPanels).  Disabling fb objects when using nvidia cards doesn't seem to make a difference.  I've tried a couple different JVM versions, with no luck.

Thanks,

Paul
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #79 - Posted 2008-04-07 15:08:11 »

Work is being done on the Java 2D OpenGL pipeline in the 6u10 release under development to change how it draws its pixels to the screen to use better-tested code paths through the OpenGL drivers. This should significantly increase its reliability.

Offline pjacobs

Junior Newbie





« Reply #80 - Posted 2008-04-07 17:34:41 »

Ken -

Thanks for the reply!  This is very exciting work!

The problems I'm having, at least on some of these machines, are multi-monitor related.  Everything works fine on one monitor, and I can see from the debug console that the OpenGL pipeline is enabled for only one screen.  I'm also seeing a nice performance increase!  Is there a way to enable hardware acceleration on two (or more) monitors?

Thanks,

Paul
Offline campbell

Junior Member




Java games rock!


« Reply #81 - Posted 2008-04-16 00:08:54 »

The problems I'm having, at least on some of these machines, are multi-monitor related.  Everything works fine on one monitor, and I can see from the debug console that the OpenGL pipeline is enabled for only one screen.  I'm also seeing a nice performance increase!  Is there a way to enable hardware acceleration on two (or more) monitors?

Hi Paul,

Unfortunately, on Windows, the OpenGL-based Java 2D pipeline is currently only configured to work properly on the primary screen (i.e., we enable it for the primary screen, but fallback on the GDI-based pipeline for other screens).  This is more an artifact from a few years ago when the OGL pipeline was first developed and drivers were less robust in multi-monitor scenarios.  With some more labor and testing we could probably remove this restriction, maybe in a future update release.

Thanks,
Chris
Offline ChrisNF

Senior Newbie





« Reply #82 - Posted 2008-10-30 21:46:38 »

Hello,

I've recently started having problems, and unfortunately I cannot track down the source of the problem. 

I'm using JOGL 1.1.1 (but I also tried 1.1.0) and NVidia drivers 178.24 (the latest) on a GeForce 8800 GTX card, and I'm unable to run applications which use a GLJPanel and the Java2D/OpenGL bridge.  If I do not specify -Dsun.java2d.opengl=true it works ok but with a slow framerate.  With the pipeline enabled, I'm seeing that either the Java2D elements are not rendered correctly (the JGears bottom bar with the JCheckBox is just black), or the OpenGL context flickers horribly (this happens with Chris Campbell's BezierAnim3D demo).  I'm using JDK 1.6.0 u 10.  I've tried downgrading JOGL, my video driver, and the JDK to no avail.  For now I have to run without the pipeline enabled, which is painfully slow.

I've also tried:
-Dsun.java2d.noddraw=true
-Dsun.awt.noerasebackground=true
-Dsun.java2d.opengl.fbobject=false

and I've tried to change gl.setSwapInterval(0) but that was a silly thing to try because that only affects GLCanvas, I think.

Anyone else experiencing flickering or Swing components not painting properly?

Thanks,

Chris
Offline ChrisNF

Senior Newbie





« Reply #83 - Posted 2008-11-26 21:21:03 »

I've just updated to the latest NVidia drivers again with no luck.  I've isolated the problem to the combination of:

-Dsun.java2d.noddraw=true
-Dsun.java2d.opengl=True

Without the first one, I get no rendering (as expected).  Without the second the rendering is slow as the Java2D/JOGL pipeline is disabled.  With both, I get horrible flickering, between my image and black.

Any suggestions?

Chris
Offline validator

Junior Newbie





« Reply #84 - Posted 2009-02-02 12:17:57 »

How can I find these  samples ' s  jogl source code
Offline bienator

Senior Member




OutOfCoffeeException


« Reply #85 - Posted 2009-02-03 19:46:45 »

the interoperability demo is part of the jogl demos project (https://jogl-demos.dev.java.net/)

just download them directly or install the OpenGL Pack plugin if you are a NetBeans user

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #86 - Posted 2009-07-09 04:13:04 »

JOGL demos are failing on Open Solaris because of a missing GlueGen library:

com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://download.java.net/media/gluegen/webstart-2.x/gluegen-rt-natives-solaris-i586.jar
   at com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:1325)
   at com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:1465)
   at com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:1443)
   at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:1546)
   at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:1474)
   at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:211)
   at com.sun.javaws.LaunchDownload.downloadJarFiles(LaunchDownload.java:931)
   at com.sun.javaws.LaunchDownload.downloadEagerorAll(LaunchDownload.java:814)
   at com.sun.javaws.Launcher.downloadResources(Launcher.java:1163)
   at com.sun.javaws.Launcher.prepareLaunchFile(Launcher.java:687)
   at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:212)
   at com.sun.javaws.Launcher.launch(Launcher.java:106)
   at com.sun.javaws.Main.launchApp(Main.java:354)
   at com.sun.javaws.Main.continueInSecureThread(Main.java:216)
   at com.sun.javaws.Main$1.run(Main.java:104)
   at java.lang.Thread.run(Thread.java:619)

Offline bienator

Senior Member




OutOfCoffeeException


« Reply #87 - Posted 2010-02-22 18:15:34 »

Thanks for reporting.
Sven and I have no longer access to download.java.net and to be honest I don't know from what sources the binaries actually are built which are located there.

Offline gouessej
« Reply #88 - Posted 2012-11-20 07:54:03 »

JOGL demos are failing on Open Solaris because of a missing GlueGen library:

com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://download.java.net/media/gluegen/webstart-2.x/gluegen-rt-natives-solaris-i586.jar
Rather look at them here in the future:
http://jogamp.org/deployment/jogamp-current/jar/

JOGL deployment is explained here.

Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #89 - Posted 2012-11-20 08:42:27 »

WTF this is over 2.5 years old!

Pages: 1 2 [3] 4
  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.

CopyableCougar4 (18 views)
2014-08-22 19:31:30

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (63 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (38 views)
2014-08-06 19:49:38
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!