java 3d on intel macs

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).
[/quote]
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.

Correct.

[quote]I can’t seem to find an existing Java3D install on my system, aside from some examples in Developer/Examples/Java/Java3D
[/quote]
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.

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.

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.

[quote]It may be the case that the JoglPipeline is already the default in Java3D 1.5.0 build 3 on OS X
[/quote]
https://j3d-core.dev.java.net/j3d1_5_0/RELEASE-NOTES-pre.html says that The JOGL renderer is the default on Mac OSX

[quote]my guess would be you’re picking up the old Java3D.
[/quote]
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.html
Before 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.

Tiger has a default java3d 1.3 install in /System/Library/Java/Extensions
http://lists.apple.com/archives/java-dev/2006/Jun/msg00179.html

I have the same error with j2me bluetooth stack, so i think it’s a problem of macosx and java.
Someone try to give this respons at the problem:

[b]The message is a system diagnostic telling you that more than one process tried to register Services (i.e. the “Services” submenu of your Application menu) with the process name “java”.

It should be harmless; if your app is crashing, it’s for some other reason.[/b]

this is your message error (with java3D)


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. 

this is my message error (with j2me bluetoothStack initialization)

run:
Starting emulator in execution mode
2006-06-16 20:43:39.325 java[2121] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x10203, name = 'java.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2006-06-16 20:43:39.335 java[2121] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)
mpowerplayer 2.0.1127
bt_browser: getBluetoothStack BluetoothStack not initalized. 
/home/Bluetooth_discovery/nbproject/build-impl.xml:295: Execution failed with error code 255.
BUILD FAILED (total time: 12 seconds)

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 :frowning:

What’s a game dev-er to do?! :slight_smile:

(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.

But it did launch correctly, and that’s the best I can make happen!

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.

– Kevin

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

– Kevin

Woo-hoo it “worked”!

It at least launched, everything I can see looks rendered correctly and it hasn’t crashed yet.

Unfortunately, since I don’t have JOAL working on the Intel Macs, the game is hanging up at the begining and I can’t play it yet but I’ll cut out the sound shortly to get mo’ better test.

However, it looks much, much better so far!
Awesome job all!

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 :frowning:
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.jnlp
It does seem like we are oh-so-close… :slight_smile:

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 :slight_smile:

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. :slight_smile: 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. :slight_smile: 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.

Actually again the Mac Mini has the Intel Integrated graphics chipset, not an ATI chipset.

Ahh, my mistake. Interesting… hopefully I will get in the lab with a developer tomorrow…

Making some progress on the JOGL/JOAL Mac issues over here at the conference.

I have been going between a few developers collectiong different errors across the G5/Intel/Tiger/Leopard configs here as well as getting the CB app in Apple’s hand for testing.

All in all going just quite well.