I wrote a simple test application for 3D rendering. It features a rotating box in a 3D subscene. To make everything as simple as possible I created a new single Gluon Mobile view project (no FXML) with the new project wizard for eclipse. Then I changed the BasicView
constructor from the default to this:
public BasicView(String name) {
super(name);
Box box = new Box();
box.setMaterial(new PhongMaterial(Color.GREEN));
RotateTransition rt = new RotateTransition(Duration.seconds(3), box);
rt.setAxis(new Point3D(1, 1, 1));
rt.setByAngle(120);
rt.setCycleCount(Animation.INDEFINITE);
rt.setInterpolator(Interpolator.LINEAR);
rt.play();
Group controls = new Group(box);
SubScene scene = new SubScene(controls, 0, 0, true, SceneAntialiasing.BALANCED);
PerspectiveCamera camera = new PerspectiveCamera(true);
camera.setTranslateZ(-20);
scene.setCamera(camera);
scene.widthProperty().bind(widthProperty());
scene.heightProperty().bind(heightProperty());
setCenter(scene);
}
so instead of the label and button i have the above.
This works both on Android and Windows but on Android I get an additional black shadow during the box's rotation that does not seem to be needed there. if you can run on both OS's you will see what i'm talking about for sure.
Video:
Android - https://youtu.be/zLKPuadNyis
Windows - https://youtu.be/tx6cIe74s1w
Android version is 6.0 on an Xperia Z5 compact.
Gradle build file is left mostly untouched only i changed the versions to newer ones
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.2'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonapplication.GluonApplication'
dependencies {
compile 'com.gluonhq:charm:4.2.0'
}
jfxmobile {
downConfig {
version = '3.1.0'
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
compileSdkVersion = 23
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
Why does this happen? is it a bug/problem with JavaFXPorts? Can I get a consistent behavior across platforms?
Edit:
Issue was submitted to JavaFx Ports at https://bitbucket.org/javafxports/javafxmobile-plugin/issues/74/inconsistent-3d-rendering-on-desktop-and