1

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

Mark
  • 2,167
  • 4
  • 32
  • 64
  • I can reproduce this as well, running on a Nexus 6 with Android 7.0. What device and Android version is yours? Also, can you check with `adb logcat` which openGL version are you using (right after launching the app)? – José Pereda Feb 19 '17 at 19:53
  • @JoséPereda I updated the device model. logcat gave a lot of text. what am i looking for or what filter do i give it? – Mark Feb 19 '17 at 22:06
  • Search for `System.out: Graphics Vendor`, right after launching the app – José Pereda Feb 19 '17 at 22:08
  • @JoséPereda System.out: Graphics Vendor: Qualcomm – Mark Feb 19 '17 at 22:13
  • And two lines after that, you'll find the openGL version – José Pereda Feb 19 '17 at 22:13
  • @JoséPereda Version: OpenGL ES 3.1 V@139.0 (GIT@I8f3b63409d) – Mark Feb 19 '17 at 22:17
  • Ok, could you please take and post a screenshot of the effect you are describing? I'm not sure if we are talking about the same issue. – José Pereda Feb 19 '17 at 22:18
  • @JoséPereda i uploaded the Android recording. working on the desktop one for comparison. – Mark Feb 19 '17 at 22:50
  • Thanks, it is the same issue, but I was thinking it was happening only with OpenGL 3.2. Could you file an issue [here](https://bitbucket.org/javafxports/javafxmobile-plugin/issues?status=new&status=open)? – José Pereda Feb 19 '17 at 23:01
  • Could you do this quick test as well? Just create the BasicView with this single line: `setCenter(new StackPane(new Sphere(100)));`, and test it again on desktop and on Android. [This](https://dl.dropboxusercontent.com/u/27006338/Screenshot_20170219-201720.png) is how it looks like on android 7.0 (wrong shading). – José Pereda Feb 19 '17 at 23:11
  • @JoséPereda yes, same. black ring on android, full sphere on desktop. – Mark Feb 19 '17 at 23:22
  • Ok, thanks for testing. It works fine on some Android 6.0 devices, not sure why it fails in yours. It fails on 7.0, so it is definitely an issue that has to be addressed. Please file it in the link I posted before, and refer to this question. – José Pereda Feb 19 '17 at 23:26
  • 1
    @JoséPereda added the link to the bitbucket at the bottom of the question. – Mark Feb 19 '17 at 23:31
  • @JoséPereda there is a week old question i had which you might be able to help me with if you can please: http://stackoverflow.com/questions/42188836/how-can-i-send-java-object-between-client-and-server-on-android-and-ios – Mark Feb 19 '17 at 23:52
  • Sure, I will tomorrow. Since the question is a little bit too broad maybe you can specify with more detail what are you asking for. – José Pereda Feb 19 '17 at 23:59

0 Answers0