Issue with Java 3D under OpenJDK 7 / Mac OS X

classic Classic list List threaded Threaded
87 messages Options
12345
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
Hi,

I just tested Sweet Home 3D under Java 6 then Java 7 with Java3D-1.6.0-pre3 and JOGL 2.0 rc10 for Mac OS X.
It still worked well with Java 6 but failed with Java 7 with the same error as the one I reported in June, i.e.

3D [dev] 1.6.0-pre3-daily-experimental daily

2012-10-03 16:09:51.204 java[9161:ad03] invalid drawable
2012-10-03 16:09:51.471 java[9161:ad03] invalid drawable
2012-10-03 16:09:51.609 java[9161:ad03] invalid drawable
Oct  3 16:09:57 .......... java[9161] <Error>: CGContextGetCTM: invalid context 0x0
Oct  3 16:09:57 .......... java[9161] <Error>: CGContextSetBaseCTM: invalid context 0x0
Oct  3 16:09:57 .......... java[9161] <Error>: CGContextGetCTM: invalid context 0x0
Oct  3 16:09:57 .......... java[9161] <Error>: CGContextSetBaseCTM: invalid context 0x0
javax.media.opengl.GLException: drawable has invalid handle: MacOSXOnscreenCGLDrawable[Realized true,
	Factory   jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory@6b0c47e5,
	handle    0x0,
	Window    JAWT-Window[windowHandle 0x7fefc8b7cd90, surfaceHandle 0x0, bounds [ 0 / 0  765 x 526 ], insets [ l 0, r 0 - t 0, b 0 - 0x0], shallUseOffscreenLayer false, isOffscreenLayerSurface true, pos 0/0, size 765x526, visible true, lockedExt false,
	config AWTGraphicsConfiguration[AWTGraphicsScreen[AWTGraphicsDevice[type AWT, connection Display 69678464, unitID 0, awtDevice sun.awt.CGraphicsDevice@778e7e6a, handle 0x0], idx 0],
	chosen    GLCaps[offscr, rgba 0x5/5/5/1, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], pixmap],
	requested GLCaps[on-scr, rgba 0x5/5/5/1, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw]],
	CGLGraphicsConfig[dev=69678464,pixfmt=0],
	encapsulated MacOSXCGLGraphicsConfiguration[DefaultGraphicsScreen[MacOSXGraphicsDevice[type MacOSX, connection decon, unitID 0, handle 0x0], idx 0],
	chosen    GLCaps[offscr, rgba 0x5/5/5/1, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], pixmap],
	requested GLCaps[on-scr, rgba 0x5/5/5/1, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw]]]],
	awtComponent com.eteks.sweethome3d.j3d.Component3DManager$1[canvas2,0,0,765x526],
	surfaceLock <280f7e08, 111b53c4>[count 1, qsz 0, owner <J3D-Renderer-1>]]]
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:447)
	at javax.media.j3d.JoglPipeline.createNewContext(JoglPipeline.java:6198)
	at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4773)
	at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2407)
	at javax.media.j3d.Renderer.doWork(Renderer.java:893)
	at javax.media.j3d.J3dThread.run(J3dThread.java:270)
Error in Java 3D : 3 Renderer: Error creating Canvas3D graphics contextOct  3 16:10:02 .......... java[9161] <Error>: CGContextGetCTM: invalid context 0x0
Oct  3 16:10:02 .......... java[9161] <Error>: CGContextSetBaseCTM: invalid context 0x0

Did any body among you actually see Java 3D work under Java 7 / Mac OS X?
What can I do to help you fix this issue?

By the way, antialisaing still doesn't work under Mac OS X, as it didn't with Java 3D 1.5.2 already, as you can see in the screen capture I posted at the beginning of this thread.
Calling setSceneAntialiasing(GraphicsConfigTemplate3D.PREFERRED) or setSceneAntialiasing(GraphicsConfigTemplate3D.REQUIRED) on the GraphicsConfigTemplate3D instance used to generate a GraphicsConfiguration has no effect.
Could you check if there's an easy fix for that?
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

gouessej
Administrator
Which version of Mac OS X do you use?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
I tried under Mac OS X 10.7.4
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

gouessej
Administrator
Ok. You can report the issue of anti-aliasing on Github, in the "issue" section. The other problem is more difficult to resolve, could you at least use the latest aggregated build (of September 29th) or the latest autobuild to see whether it fixes the problem?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
I found how to force antialiasing on screen: quite strangely you have to set j3d.implicitAntialiasing property to true.
I don't fully understand why this property has to be set if you already called GraphicsConfigTemplate3D.setSceneAntialiasing(GraphicsConfigTemplate3D.PREFERRED); but it works on my computer. Miserably it has no effect for offscreen rendering.

Where the last autobuild of Java 3D can be found?
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Sven Gothel
Administrator
On 10/04/2012 04:56 PM, Manu [via jogamp] wrote:
> I found how to force antialiasing on screen: quite strangely you have to set
> /j3d.implicitAntialiasing/ property to true.
> I don't fully understand why this property has to be set if you already called
> GraphicsConfigTemplate3D.setSceneAntialiasing(GraphicsConfigTemplate3D.PREFERRED);
> but it works on my computer. Miserably it has no effect for offscreen rendering.
>

Well, to have native MSAA w/ OSX CALayer (openjdk, OSX >= 10.8, applets w/ OSX >= 10.5),
the new FBO impl. is required, which you find in the latest
aggregated test builds, not in RC10.

~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
Trying with JOGL nightly builds of the 4th of October (gluegen-2.0-b597-20121004-macosx-universal.7z + jogl-2.0-b820-20121004-macosx-universal.7z) and Java 3D 1.6.0-pre3 version, gives a different error:

3D [dev] 1.6.0-pre3-daily-experimental daily

javax.media.opengl.GLException: BackingLayerHost w/ unknown handle (!FBO, !PBuffer): MacOSXOnscreenCGLDrawable[Realized true,
	Factory   jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory@694f21f3,
	Handle    0x7ff335024340,
	Surface   JAWT-Window[windowHandle 0x7ff33515aea0, surfaceHandle 0x7ff335024340, bounds [ 0 / 0  256 x 234 ], insets [ l 0, r 0 - t 0, b 0 - 0x0], shallUseOffscreenLayer false, isOffscreenLayerSurface true, pos 0/0, size 256x234, visible true, lockedExt false,
	config AWTGraphicsConfiguration[AWTGraphicsScreen[AWTGraphicsDevice[type .awt, connection Display 69678464, unitID 0, awtDevice sun.awt.CGraphicsDevice@7bb6aea4, handle 0x0], idx 0],
	chosen    GLCaps[rgba 0x5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]],
	requested GLCaps[rgba 0x5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], on-scr[.]],
	CGLGraphicsConfig[dev=69678464,pixfmt=0],
	encapsulated MacOSXCGLGraphicsConfiguration[DefaultGraphicsScreen[MacOSXGraphicsDevice[type .macosx, connection decon, unitID 0, handle 0x0, NullToolkitLock[]], idx 0],
	chosen    GLCaps[rgba 0x8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]],
	requested GLCaps[rgba 0x5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], on-scr[.]]]],
	awtComponent javax.media.j3d.Canvas3D[canvas1,0,0,256x234],
	surfaceLock <4edb440a, 1d5014f8>[count 1, qsz 0, owner <J3D-Renderer-1>]]]
	at jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl.contextRealized(MacOSXCGLContext.java:612)
	at jogamp.opengl.macosx.cgl.MacOSXCGLContext.contextRealized(MacOSXCGLContext.java:292)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:528)
	at javax.media.j3d.JoglPipeline.createNewContext(JoglPipeline.java:6198)
	at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4773)
	at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2407)
	at javax.media.j3d.Renderer.doWork(Renderer.java:893)
	at javax.media.j3d.J3dThread.run(J3dThread.java:270)

DefaultRenderingErrorListener.errorOccurred:
CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context
graphicsDevice = sun.awt.CGraphicsDevice@7bb6aea4
canvas = javax.media.j3d.Canvas3D[canvas1,0,0,256x234]

This was tested under Mac OS X 10.7.4 and not 10.8 which is not my main system yet. I sincerely hope you don't target only Mac OS X 10.8, otherwise it would make it much less useful (see these recent statistics).
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Sven Gothel
Administrator
On 10/04/2012 06:58 PM, Manu [via jogamp] wrote:

> Trying with JOGL nightly builds of the 4th of October
> (gluegen-2.0-b597-20121004-macosx-universal.7z +
> jogl-2.0-b820-20121004-macosx-universal.7z) and Java 3D 1.6.0-pre3 version,
> gives a different error:
>
> 3D [dev] 1.6.0-pre3-daily-experimental daily
>
> javax.media.opengl.GLException: BackingLayerHost w/ unknown handle (!FBO, !PBuffer): MacOSXOnscreenCGLDrawable[Realized true,
> Factory   jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLDrawableFactory@694f21f3,
> Handle    0x7ff335024340,
> Surface   JAWT-Window[windowHandle 0x7ff33515aea0, surfaceHandle 0x7ff335024340, bounds [ 0 / 0  256 x 234 ], insets [ l 0, r 0 - t 0, b 0 - 0x0], shallUseOffscreenLayer false, isOffscreenLayerSurface true, pos 0/0, size 256x234, visible true, lockedExt false,
> config AWTGraphicsConfiguration[AWTGraphicsScreen[AWTGraphicsDevice[type .awt, connection Display 69678464, unitID 0, awtDevice sun.awt.CGraphicsDevice@7bb6aea4, handle 0x0], idx 0],
> chosen    GLCaps[rgba 0x5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]],
> requested GLCaps[rgba 0x5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], on-scr[.]],
> CGLGraphicsConfig[dev=69678464,pixfmt=0],
> encapsulated MacOSXCGLGraphicsConfiguration[DefaultGraphicsScreen[MacOSXGraphicsDevice[type .macosx, connection decon, unitID 0, handle 0x0, NullToolkitLock[]], idx 0],
> chosen    GLCaps[rgba 0x8/8/8/8, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], offscr[auto-cfg]],
> requested GLCaps[rgba 0x5/5/5/0, opaque, accum-rgba 0/0/0/0, dp/st/ms: 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.hw], on-scr[.]]]],
> awtComponent javax.media.j3d.Canvas3D[canvas1,0,0,256x234],
> surfaceLock <4edb440a, 1d5014f8>[count 1, qsz 0, owner <J3D-Renderer-1>]]]
> at jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl.contextRealized(MacOSXCGLContext.java:612)
> at jogamp.opengl.macosx.cgl.MacOSXCGLContext.contextRealized(MacOSXCGLContext.java:292)
> at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:528)
> at javax.media.j3d.JoglPipeline.createNewContext(JoglPipeline.java:6198)
> at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:4773)
> at javax.media.j3d.Canvas3D.createNewContext(Canvas3D.java:2407)
> at javax.media.j3d.Renderer.doWork(Renderer.java:893)
> at javax.media.j3d.J3dThread.run(J3dThread.java:270)
>
> DefaultRenderingErrorListener.errorOccurred:
> CONTEXT_CREATION_ERROR: Renderer: Error creating Canvas3D graphics context
> graphicsDevice = sun.awt.CGraphicsDevice@7bb6aea4
> canvas = javax.media.j3d.Canvas3D[canvas1,0,0,256x234]
>
>
> This was tested under Mac OS X 10.7.4 and not 10.8 which is not my main system
> yet. I sincerely hope you don't target only Mac OS X 10.8, otherwise it would
> make it much less useful (see these recent statistics
> <http://www.computerworld.com/s/article/9231937/OS_X_Mountain_Lion_s_torrid_upgrade_pace_cools_>).
Very good, thank you!

Java3D's Canvas3D needs to adapt the offscreen-layer caps,
then it will work.

The exception states that offscreen-layer is detected (and enabled by JAWTWindow),
however the wrong drawable type has been instantiated.

In AWT's GLCanvas of JOGL, the proper drawable
  "drawable = (GLDrawableImpl) GLDrawableFactory.getFactory(capsReqUser.getGLProfile()).createGLDrawable(jawtWindow);"

GLDrawableFactory.createGLDrawable(NativeSurface) does select the proper capabilities
and drawable type. This is somehow missing in Canvas3D I assume, and an onscreen drawable
is used.


~Sven



signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

hharrison
Thanks for decoding that for me, I'll have a look this weekend, the whole capabilities selection that Canvas3d is doing is
pretty ugly, just haven't had the time to figure it out.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Sven Gothel
Administrator
On 10/04/2012 07:58 PM, hharrison [via jogamp] wrote:
> Thanks for decoding that for me, I'll have a look this weekend, the whole
> capabilities selection that Canvas3d is doing is
> pretty ugly, just haven't had the time to figure it out.

Great, if you can simply use the factories we use (see GLDrawableFactoryImpl),
then it should just work.

Fixing caps is done in: GLGraphicsConfigurationUtil, as you can see
in aforementioned factory.

Then native MSAA w/ FBO'ed CALayerd OSX AWT should be no problem
- what a sentence :)

~Sven

>
> Harvey
>


signature.asc (907 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
Great to see this issue is about to be resolved.
By the way, if you could have a look why antialiasing works on screen but not with off screen rendering, that would be perfect!
I'm looking forward to testing a workable solution...
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
This post was updated on .
To help you fix this issue more easily with Sweet Home 3D, I built a Jar executable version with Java 3D 1.6 pre3 and JOGL2 b824.
This executable file should work under Mac OS X, Windows 32/64 bits and Linux 32/64 bits. Miserably, it runs successfully only under Mac OS X with Java 6, and it crashes under the other systems. Simply run the Jar executable to get the logs. If you want to test some fixes, you can easily change the Jars and the Dlls included in the Jar executable file.

It doesn't use the temp jar cache of JOGL but another classloader system I programmed in Sweet Home 3D. From the error reported when the program crashes, I'm pretty sure this classloader isn't the issue.

Feel free to split this message in a separate topic if you want.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

gouessej
Administrator
Ok I assume it crashes for the same reasons than just before Siggraph.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
Harvey, Sven, any news about this issue?
I downloaded java3d-core sources, succeeded to build a j3dcore.jar file in Eclipse and reproduce the issue with Java 7 / Mac OS X.
But I don't know what I should change around line 6198 in JoglPipeline.java 
From Sven message, the error is probably in line 6178:
  draw = GLDrawableFactory.getFactory(getDefaultProfile()).createGLDrawable(nativeWindow);
but there's so much to learn before I could be able to update this line! Any hint about the change I could try?
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

gouessej
Administrator
The wrong native window is used or the context should not be made current here, depending on which thread tries to do it.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
Suddenly, this Java 3D port looks much more urgent: Apple doesn't support Java 6 applets and Java Web Start applications anymore under Mac OS X 10.7 and 10.8, from their last Java update.  It's a fact, not a prerelease warning.
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

gouessej
Administrator
I'm sad to say that but if you really want to use an actively maintained scenegraph working fine especially under Mac, please consider switching to Ardor3D. Renanse is always under Mac, I fix bugs in its renderer based on JOGL 2.0 within hours or (a few) days in the worst case. The problem is that there are a very few people with good skill in Java3D and there are a very few people able to fix some of its main annoying design flaws.

Of course, I would be happy if we found a solution to fix Java3D.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

elotter
How's the progress with RC11 and binary downloadable jars (auto builds?) for Java3D that will be compatible with it? Looking forward to return to testing this combination on various platforms (previous experiences on Ubuntu has been hit and miss, due to the freezing bug).

Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

Manu
elotter wrote
How's the progress with RC11 and binary downloadable jars (auto builds?) for Java3D that will be compatible with it?
It' doesn't work with the jogl autobuild at the moment in Sweet Home 3D case.
I hope that Harvey will be able to fix the few remaining configuration parameters. We seem so close to a working solution...
Emmanuel Puybaret
Reply | Threaded
Open this post in threaded view
|

Re: Issue with Java 3D under OpenJDK 7 / Mac OS X

gouessej
Administrator
Manu wrote
We seem so close to a working solution...
It really needs a redesign of the canvas creation. We know the root cause but it is a bit tricky and when you go on relying on AWT / Swing, you will experience problems under Mac even though the situation will get improved as time goes by.
Julien Gouesse | Personal blog | Website
12345