how do i go about getting java 3d running on an intel mac.. nothing turned up searching the forum, and the 2003 j3d/jai won't install (complains that i need os 10.3). I'm assuming with 1.5 with it running on top of jogl, that there will be a sun supported version, given that it seems like apple isn't taking care of it anymore??

As of the recent build 3 of Java3D 1.5.0 (here) the JOGL pipeline for Java3D runs on Intel-based Macs. You need the built jar files like j3dcore.jar from one of the other platforms' builds as well as a recent build of JOGL. You can either set up your CLASSPATH to point to these jars or drop them into the JDK's extensions directory. I'm aware that the latter is the recommended practice but it can cause problems with Java Web Start so I don't recommend it. You then need to follow the installation instructions for JOGL including the setting of DYLD_LIBRARY_PATH if necessary. I believe it is documented in the readme exactly how to make it work. Note that Apple ships an older version of Java3D I believe somewhere in the /System tree which you need to either delete or move aside since its presence will prevent you from running the newer version (unless you overwrite the older version with the newer version).

Once it's installed, you then need to specify -Dj3d.rend=jogl on the command line to activate the JoglPipeline. The JoglPipeline isn't yet fully functional (it will print out messages if unimplemented routines are called) and some more work has gone into it since build 3, but please give it a try and let us know how it is working.

Awesome, thanks for the help. So basically Jogl takes the place of any other native libraries in 1.5?

Quote

Note that Apple ships an older version of Java3D I believe somewhere in the /System tree which you need to either delete or move aside since its presence will prevent you from running the newer version (unless you overwrite the older version with the newer version).

I can't seem to find an existing Java3D install on my system, aside from some examples in Developer/Examples/Java/Java3D

I tried the simple cube example and it worked even without specifying -Dj3d.rend=jogl which was surprising... i don't have any native libraries so I'm guessing rendering a cube was simple enough to not rely on native code...

I tried an old project with the -Dj3d.rend=jogl switch and i got the following errors even though it did display the window with the expected contents...2006-06-07 10:47:37.765 java[481] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x12603, name = 'java.ServiceProvider'See /usr/include/servers/bootstrap_defs.h for the error codes.2006-06-07 10:47:37.765 java[481] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)

also managed to get a model loaded using ObjectFile both including -Dj3d.rend=jogl and not.

Awesome, thanks for the help. So basically Jogl takes the place of any other native libraries in 1.5?

Correct.

Quote

I can't seem to find an existing Java3D install on my system, aside from some examples in Developer/Examples/Java/Java3D

Look in /System/Library/Java/Extensions/ . I think you'll either need to move aside or delete the old Java3D (and preferably at least the core native library) or copy the new one on top of it.

Quote

I tried the simple cube example and it worked even without specifying -Dj3d.rend=jogl which was surprising... i don't have any native libraries so I'm guessing rendering a cube was simple enough to not rely on native code...

There's no way it can render without native code of some sort so my guess would be you're picking up the old Java3D.

Quote

I tried an old project with the -Dj3d.rend=jogl switch and i got the following errors even though it did display the window with the expected contents...2006-06-07 10:47:37.765 java[481] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x12603, name = 'java.ServiceProvider'See /usr/include/servers/bootstrap_defs.h for the error codes.2006-06-07 10:47:37.765 java[481] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)

also managed to get a model loaded using ObjectFile both including -Dj3d.rend=jogl and not.

I haven't seen those errors. Do they occur with the HelloUniverse demo as well?

Do you see any printouts like "JoglPipeline.hasDoubleBuffer()"? If not I think it's actually unlikely the JoglPipeline is active.

It may be the case that the JoglPipeline is already the default in Java3D 1.5.0 build 3 on OS X; I don't remember whether that switch has been flipped in the shared code. In this case -Dj3d.rend=jogl and not specifying it would have the same effect.

There isn't anything in the extensions folder. On my old mac, I had to download apple's java3d update (which dates from dec 2003). http://www.apple.com/support/downloads/java3dandjavaadvancedimagingupdate.htmlBefore starting this thread I tried to install that and it refused to install saying it required os x 10.3, i think 10.3.9. So I'm not sure what version of Java3D could have been installed on my computer. i.e. what version runs on the intel macs aside from j3d 1.5? Does apple have an internal build of java3d for intel macs that they install as part of osx or developer's tools? originally i had all the jogl/java3d library jars in /Library/Java/Extensions/ directory and have moved them into a subdirectory of home ( Lib/ ). now, things are still compiling & running without setting the classpath to point to the java3d jars. so that leads me to believe there is some system install of java3d that i'm unable to find. I've tried searching for java3d but all i get is the example files i found before...a search for "j3dcore" only turns up the jar i have in Lib/ . i'm not seeing any joglPipeline.hasDoubleBuffer() printout..when i print out the result of System.getProperty("j3d.rend") I get "null"I've again tried the stuff I was running before and hellouniverse and they both run with no errors. wierd.

BTW, the web start 1.5 demos do not work on a Mac "out of the box" because web start does not override the install Java3D. So say they don't work isn't really complete though, some work but it's only because they don't do anything 1.4 can't and so there is no errors, but the demos are using 1.4

If you run say a shader demo you get a noMethodError as you would expect when it links to the installed version.

BTW this is getting to be a bigger and bigger issue with web start for us. Basically I can set web start up right and even deliever the user the correct jars (and libs) but they don't run because web start won't use them! This make web start ever more useful as a casual game delivery method :-(

What's a game dev-er to do?!

(Trying to pave the last mile on Mac's for Apple WWDC next week)[mod]So I just trashed all the j3d (and JOGL) related system files on my Mac, and then the web start launched our engine just fine.Unfortunately, the render is then same as the Win JOGL version - mostly grey, no world, no background, no characters, then it crashed.

OK I got a Intel Mac to test the Intel Mac/Web Start/Java3D(JOGL) version of our game (damn, look at that configuration, this is getting outta hand) and I get the same render error as PC and Mac PPC, so that's good, they are all rendering the same it appears...

No wait that's BAD!I would like it to work (render correctly) on the Intel Mac for the Apple WWDC next week! Any chance that next build will make it into web start jars before then?

OK I got a Intel Mac to test the Intel Mac/Web Start/Java3D(JOGL) version of our game (damn, look at that configuration, this is getting outta hand) and I get the same render error as PC and Mac PPC, so that's good, they are all rendering the same it appears...

No wait that's BAD!I would like it to work (render correctly) on the Intel Mac for the Apple WWDC next week! Any chance that next build will make it into web start jars before then?

Thanks for any help.

We're in the process of doing a build5 now. We discovered a D3D problem (it's been broken in the daily build for a while and we just noticed it), but we'll go ahead and do at least the Web Start release anyway. I'll post when ready.

We're in the process of doing a build5 now. We discovered a D3D problem (it's been broken in the daily build for a while and we just noticed it), but we'll go ahead and do at least the Web Start release anyway. I'll post when ready.

The JNLP build for 1.5.0-build5 is ready. Give it a spin and let me know if it works for you.

OK! I got a working version of JOAL on the Intel Mac (universal actually) from Justin (awesome thanks much) but now that I can get further into the game it crashing :-(Now of course this could be JOAL or JOGL or Java3D or some mix and really I don't know so...Sorry for the spam but maybe this will help you guys, here is the complete crash dump from the Mac.Also if you have a Mac handy you can try running this thing now, I'll post the link in the next post.----------Ok the Mac error dump was so huge it won't post in the forum.I'll have ti set something up if anyone wants to see it.--------So I also crash shortly after start up on the PPC Mac.I guess you guys can give it a try here's the link:www.imilabs.com/CosmicBirdie/Dist/cbJOGL.jnlpIt does seem like we are oh-so-close...

It looks like the crash is audio-related. Could you please try taking out your sound code and seeing whether that gets you working again? I agree this is not the best workaround, but I think you would be better showing it without sound than not being able to show it at all.

The crash appears to be deep inside Apple's audio code. It's unclear to me whether this could be a bug in JOAL, a bug in Apple's OpenAL implementation, a bug in lower-level sound libraries, or a bug in the application which happens to not crash the app on Windows but does on Mac OS X due to differences in the OpenAL implementation.

If you could extract the sound code again into a self-contained test case we can look into this more, but probably after WWDC given the lack of available time before the conference.

Thanks much, I disabled the sound and sure enough no crash..So it's working, sort of... On the test Mac I have I am running boot camp. In Windows, the game runs 60hz, rock solid. However, in OS X I am getting 16hz!So I set up the same cb.JOGL web start launcher without soudn you can try it out, but I have to go catch the plane now :-)

As I said it works runs, just reallu so in Mac OS X only. I woudl think that was an error printing every frame to Standard.out, it's that different, but the console shows no error.

In any case thanks so much for the help and if you figure out the slowest let me know if there is an update to the Java3D jar I can jsut point the .jnlp to that build. If not, thanks anyway. I'll be back on later tonight.

I can reproduce the poor performance on OS X with my Intel-based Mac Mini (with only the Intel Integrated graphics chipset). However, I'm sorry, but there is no way we are going to be able to debug this on the Java 3D / JOGL side. The JavaOne version of the Cosmic Birdie demo ran extremely fast on a PowerPC mac with an NVidia graphics card and reasonably fast on a Mac Mini. I suspect you must be going down a code path through Apple's drivers which isn't optimized. I actually think your going to WWDC is a good thing in this regard because you may be able to get a member of Apple's OpenGL team or Developer Technical Support team to help you run the demo with their OpenGL profiler enabled to see where all of the time is going. Another thing you could do is to try turning off the new rendering functionality added to your demo since JavaOne piece-by-piece and see which one slows it down. If you can track it down to one particular thing added recently (some multitextured thing, or the HUD / overlay text, or something similar) then we can look at it in the context of Java 3D as well and see whether there is something we could be doing differently. Keep in mind there is no Mac-specific code in the Java 3D implementation on top of JOGL, so in theory there should be no differences between the Mac and Windows platforms.

OK sounds good, thanks for all the help. I'll try to post this week as I go along.

Monday morning -I am at the VIP waiting area for the Keynote. :-) Should be sweet, all the banners are covered up inside so something cool hiding under there.On the OpenGL front, it looks like I will totally be able to get some debugging help and make good contacts with the OpenGL team because they have "labs" on wednesday where I can run my app and have them look at it, just as you explaining Ken.Looking forward to it now.Well I'm out, back after the Keynote...

Wow, Leopard makes Vista look like Win2000. :-) I guess my next workstation will be the Mac Pro (Quad Xeon), good for multi-threading Java code!Back after the Mac OS X State of Union keynote....

[mod]I got to run the demo on the new Mac Pro (nVidia graphics) and it ran great out of the box! Sounds like ATI driver issue to me (my laptop is ATI and I'm betting your test Mac Mini is ATI. Regardless I still will be meeting with graphics people in the labs and will get a chance to have it profiled and show them it runnign sllloooww on my MacBook. I'm out for the day.

Sounds good. Please do raise the JOAL-related crash with Apple; at first glance it looks like a bug in their OpenAL implementation.

Yes, I pretty much got confirmation of that.One of the way they told me to help get it more attention was to go ahead and use the crash report feature in OS X (go figure). The more apps and different user/machines that fiel a report on that will bump it's priority, so after the many I have report here on the different conference machines anyone else that crash should send the report.Right now the live web link does load up sounds so it doesn't fail, but I have one on my machine that does and I'll put the link back up online ASAP for JGO users to try, crash and report :-)

so profiling info from Shark on Mac OS X...com.sun.opengl.Impl -> GLImp:pushAttrib is the number one time spent.I actually got a screenshot, I know this is kinda shot in the dark, but i thought it might be of some use until I can do a bit more testing over here :-).

I know the amount of pushAttrib is going to be driven by the graph but our graphs TRY to use the least Appearances as possible, and they are certainly less than the number of Shape3D. Matt Drance says "Hello" and that they added a bunch of stuff you wanted in Java 6 BUT in 6.0 webstart won't launch the app because of a security error I was getting on launch Wndows mustang 88, but was fixed in mustang 92. The current Mac 6.0 is 88 so we can't know jsut yet it seems.

Does that make sense?

Ok we did get to run it command-line for Java 6.0 and it didn't SEEM like any different, but we couldn't profile it because there profiler "shark" threw exceptions trying to connect to Java 6.0 HAHA, Matt has to go file a bug report on that one

Shawn: thanks very much for the information. Based on this I've tracked the slowdown to a bug in Java 3D (on all platforms) where in some of the texturing routines we were calling glPushAttrib(GL_MATRIX_MODE) which is an illegal argument and was probably causing OpenGL errors to be raised. The correct argument is glPushAttrib(GL_TRANSFORM_BIT). I've fixed this in the JoglPipeline and placed a build of the resulting j3dcore.jar at http://download.java.net/media/jogl/builds/tmp/j3dcore.jar . As far as I can tell this fixes the slowdown of Cosmic Birdie on Mac OS X. Please give it a try and let me know whether it works. I'll file a bug against Java 3D's NativePipeline so this gets fixed there as well. Again thanks for your and the Apple team's help in getting the profiling output and sorry for the trouble.

WOW, that is great!I tried it (downloaded and put int extension on Mac) but keep getting a launch error j

java.lang.reflect.InvocationTargetException - this happened when J3D 1.4 loaded and my app called a 1.5 method...here it's from caused by: java.lang.NoClassDefFoundError: javax/media/opengl/GLException so it's not hooking up/finding into the JOGL lib correclty it seems...

I may not have it configured just right yet but I have all the j3d jars and the JOGL jars and libs in the extensions folder now, and still get that error...ok even with the original j3dcore.jar I get that error, so possibly this related to the "rend" jogl proprety in the .jnlp? I say that because it's running the smae .jnlp but the jars are already in the extension folder, but it doesn't seem to be executing them correctly.

[mod] at this point I have tried many different .jnlp/install extension combinations and keep getting that error unless I just remove them all and run the original .jnlp, and thus not the j3dcore fix.

[mod[ OK I got ti working in the extensions folder. sweet

But Still...

In testing across several machines here, the best way is using Web Start, because we only have to yank the default J3D 1.4 jars, and web start works after that.To test with the jar we have to put it on each machine.Is there any way you can set up a tmp-dev web start .jnlp like the current 1.5.0 is?Whether or not please let me know ASAP so I know what actions I'll need to take to streamline what I can do.And thanks SO much for the amazing support!

I've asked Kevin Rushforth to re-push the Java Web Start binaries for Java 3D 1.5.0. Let's see whether that can be done today.

Great. I managed to get to profile on one machine so far and the pushAttrib is no longer the top hit, it's glDrawElements, as I would expect since my scene is all indexed.The second hit is glPushAttrib at about have the time of glDrawElements. That still seems a bit high but it is definitely different than before. I will get to test on more machines as the day goes on.One thing to note is that i am seeing no performance improvement on my MacBook. The test shouldn't be fill bound, and I can see that frame resize isn't affect the frame rate, as well as that on Windows on this hardware, it is running ~twice as fast for a complex scene. That is what i am trying to get Apple to see right now. Once I get some more feedback I'll post again then.

Ok I at least got another window grab of the current profile for what it's worth. One thing to note is that the Mac Mini is the Intel graphics, this MacBook is ATI and the new Mac Pro is nVidia...

A new JNLP build is available that includes Ken's fix. I put it in the same place, since it is an interrim, experimental build anyway. It should identify itself as Java 3D version 1.5.0-pre6-0608091256-experimental (at least on Mac and Windows).

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