Login  Register

Re: Java3D Android support released

Posted by philjord on Aug 27, 2023; 9:07pm
URL: https://forum.jogamp.org/Java3D-Android-support-released-tp4042907p4042915.html

Sven, thanks for the feedback.

Java3D-Android uses Jogl 2.4.2, the Android binding.
In fact I only attempted this because the ES2 support in Jogl was so great.

It’s almost entirely ordinary Java3D, users should be able to convert form desktop to Android in a couple of hours.

It has  two significant alterations from base Java3D

A new Pipeline class that automatically supports fixed function coding paradigm being pushed out to a programmable world, so it has a bunch of “virtual” attributes and uniforms that magically appear if needed on the shader based on the Java3D Shape3D  attributes. It also has an Appearance class that writes shaders for the user, who can then inspect them and see FFP to programable conversion examples.

It also had to have every class that touches java.awt swapped for a very similar version that uses javaawt package instead. So of the 409 Java3D main classes this project alters only 69 of those, and only about 10 of them significantly.

The biggest differences are that image loading is a bit “at odds with” normal awt, so if you want to show a BufferedImage on a ImageIcon and also in Java3D you have to load it twice, one in java.awt and one in javaawt.
Also the Canvas3D has been royally mashed up.

I had to make a stack of memory optimisations, that should flow back to Java3D core at some point.I made it support compressed Textures as well, because phones are very small platforms.

So once iPhone is running on Jogl I’m very keen to follow up with a Java3D for that platform.

As an interesting note, I had to make some “bug” fixes in a couple of Newt classes to get the Android code to run well, and I had to create a couple of new class in the Newt space. At some point I’ll present these idea to you as a PR.

I also had to package the .so file in a very particular way to get the library loader to find them on Android, I just could not get the gradle system to get them down and in the right place. I’ll discuss with you at some point.