Bug 497 - JOGL applet test doesn't work on Firefox or Chrome on Mac OS X 10.6.7
Summary: JOGL applet test doesn't work on Firefox or Chrome on Mac OS X 10.6.7
Status: VERIFIED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: applet (show other bugs)
Version: 2
Hardware: All macosx
: --- normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2011-04-23 00:25 CEST by Wade Walker
Modified: 2011-12-02 08:03 CET (History)
4 users (show)

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments
Java console output during applet load (175.55 KB, application/octet-stream)
2011-04-23 00:31 CEST, Wade Walker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wade Walker 2011-04-23 00:25:21 CEST
The applet test page at http://jogamp.org/jogl-demos/www/applettest-jnlp.html shows a blank applet in Firefox 4.0 and Chrome 10.0.648.205. The Java console log shows that it's using JNLP2ClassLoader to load the applet, and it seems to find the native libraries and load the applet OK.

This same test page works fine in Safari 5.0.4, probably because it's using the JNLPAppletLoader.

This is on Mac OS X 10.6.7 with Java 1.6.0_24 on a MacBook Air with an NVIDIA GeForce 320M.
Comment 1 Wade Walker 2011-04-23 00:31:03 CEST
Created attachment 251 [details]
Java console output during applet load

This log file shows the applet loading (apparently normally, even though we can't see anything but a white blank). It also shows the applet's close message when I close the browser window.
Comment 2 Sven Gothel 2011-07-23 03:20:31 CEST
known issue, pls set your java settings to compatible, i.e. not in it's own process.

after siggraph, we have to tackle OSX in a whole.
Comment 3 Wade Walker 2011-08-23 00:32:43 CEST
Found some additional info on this at http://lists.apple.com/archives/java-dev/2011/Aug/msg00067.html. It looks like under Lion, as of Safari 5.1 and later, all browsers use Plugin2, which currently requires a new rendering model to use correctly.

There's some example code at http://developer.apple.com/library/mac/#samplecode/JAWTExample/Introduction/Intro.html, which I successfully built and tested in Xcode 4 (it required a few project changes), but to work this into JOGL seems like it would require major changes, since you can only draw when you're inside the drawInOpenGLContext of the custom NSOpenGLLayer.
Comment 4 Sven Gothel 2011-08-23 21:55:36 CEST
I will have a look at it at a later time.
However, it should be possible to fix NEWT on OSX (main thread issue),
and then just use the NEWT/AWT parenting, where we use JAWT for acquiring the native window handle.
I almost completed this change for NEWT/OSX when I left this work behind.

Maybe you are right in case of native AWT peer rendering (the AWT GLCanvas) method.

Just a few thoughts ..
Comment 5 Wade Walker 2011-08-23 23:55:45 CEST
Supposedly that won't work (see here for details: http://lists.apple.com/archives/java-dev/2011/Aug/msg00067.html).

The Apple engineers say that OS X has some security restrictions that prevent other processes from rendering into your window or creating new controls that are children of your window.

So their solution is for applets to render into a layer that's shared with the browser, but even this rendering can't happen asynchronously -- it must be done only when CAOpenGLLayers allows it.

They say they're working with Oracle engineers on this, and are willing to work with JOGL and LWJGL engineers too, but the way forward doesn't seem clear yet.
Comment 6 Sven Gothel 2011-08-24 00:44:16 CEST
I briefly read the example code as well .. hmm.

so you say it's not enough to have the  ds->Lock(ds) <do it> ds->Unlock(ds)
block in place ? i.e. drawing surface lock ?
if the surface lock is all which is required, the NEWT/JAWT code shall work though.

maybe we can chat later today or next week about this to plan a solution,
I would appreciate this. Hopefully we can make an outline the 'playground'.
Comment 7 Bino George 2011-10-24 17:23:10 CEST
As of Java for Mac OS X 10.6 Update 4 and 10.5 Update 9 there is an addition to the JAWT API that enables 3rd party 3D technologies in applets outside of the browser process (Plugin2). More info at :

http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate4LeopardUpdate9RN/NewandNoteworthy/NewandNoteworthy.html

The JAWT example at : http://developer.apple.com/library/mac/#samplecode/JAWTExample/Introduction/Intro.html has been modified to show how to use this new API.

The LWJGL folks have already adopted this API and you can see there results at :

http://lwjgl.org/forum/index.php/topic,4023.0.html

Official announcement here: <http://lwjgl.org/forum/index.php/topic,4023.msg22405.html#msg22405>
Demos here: <http://app.3dviewr.com/#test/sintel_rig_cleaned.dae>


If JOGL needs to render from arbitrary threads into the layer, you will need to go through an FBO, such that arbitrary rendering from multiple threads go to the FBO for the applet and then the contents of the FBO is copied to the CALayer in the layer's  drawInCGLContext: method.

http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAOpenGLLayer_class/Introduction/Introduction.html
Comment 8 Sven Gothel 2011-11-27 20:44:43 CET
Implemented and manual tested. Will be available for public w/ RC4 (ie next signed release).
Comment 9 Gabriel Nicula 2011-11-28 17:27:19 CET
(In reply to comment #8)
> Implemented and manual tested. Will be available for public w/ RC4 (ie next
> signed release).

Hello,

My name is Gabriel Nicula and we would be interested in the new release containing this major fix - we have a Java3D applet that doesn't run anymore on MacOS with JRE above 1.6.0.17.
When is this RC4 scheduled for?
Conversely, could we use one of the dayly/nightly builds?
Thx, Gabi