Hi,

https://doc.qt.io/qt-6/qtquick3d-requirements.html#opengl-specifics (calling 
and honoring QQuick3D::idealSurfaceFormat())  is probably required in this 
case. (otherwise, not sure why it ends up using GLSL ES 100 shaders)

Yet better, in Qt 6.1 and newer the whole pre-filtering process can be, and 
should be, done offline: 
https://doc.qt.io/qt-6/quick3d-asset-conditioning-ibl.html#pre-generating-ibl-cubemap

This boils down to, with your example, running 'balsam galaxy.hdr' and 
referencing the generated galaxy.ktx from qml.

If you were using CMake this could also be automated and left to the build 
system by adding something like the following to your CMakeLists:

qt6_quick3d_bake_lightprobe_hdri(target "ibl_assets"
    PREFIX
        "/"
    FILES
        "galaxy.hdr"
)

and then referencing "galaxy.ktx" from the qml file.

Best regards,
Laszlo

________________________________
From: Interest <interest-boun...@qt-project.org> on behalf of joao morgado via 
Interest <interest@qt-project.org>
Sent: Saturday, July 31, 2021 3:52 AM
To: Qt Interest <interest@qt-project.org>
Subject: [Interest] Skybox Qt Quick3D bad performance in Android

I'm testing Quick3D on Android, all good, but if I use a skybox the performance 
is really bad or does not work at all.


The following test project with  trivial code is just a skybox and a red 
cilinder.

SkyBoxTest.zip<https://drive.google.com/file/d/1Z1AQLtcihkDjEPFYNYVgSznKLVtYLZcy/view>

<https://drive.google.com/file/d/1Z1AQLtcihkDjEPFYNYVgSznKLVtYLZcy/view>
[https://s.yimg.com/lb/brands/80x80_google.png]
SkyBoxTest.zip


Runs fine in desktop linux mint, windows, MacOS, iPhone, but in my 2 android 
devices:

- tablet Lenovo Tab M10 TB-X306F, OS Android 11, when I run the program, I get 
a black screen, it takes 55 seconds to load the image of the skybox and the red 
cylinder

- mobile nokia 5.4 OS Android 10:  compilation fails with the following errors:

---------------------------------------------------------------------------------------------------------------
E VpsExtension: Failed to get binder for service "vendor.vpsservice"
E VpsExtension: Failed to get binder for service "vendor.vpsservice"
I AdrenoGLES-0: ERROR: 0:2: '' :     GLSL error: extension 
'GL_EXT_shader_texture_lod' is not supported
I AdrenoGLES-0: ERROR: 0:77: 'textureCubeLodEXT' : no matching overloaded 
function found
I AdrenoGLES-0: ERROR: 0:77: 'xyz' :  field selection requires structure, 
vector, or matrix on left hand side
I AdrenoGLES-0: ERROR: 0:77: 'return' : function return is not matching type:
I AdrenoGLES-0: ERROR: 4 compilation errors.  No code generated.
07-31 02:35:03.170 24150 24253 I AdrenoGLES-0:
W libSkyBoxTest_arm64-v8a.so: Failed to compile shader: ERROR: 0:2: '' :     
GLSL error: extension 'GL_EXT_shader_texture_lod' is not supported
W libSkyBoxTest_arm64-v8a.so: ERROR: 0:77: 'textureCubeLodEXT' : no matching 
overloaded function found
W libSkyBoxTest_arm64-v8a.so: ERROR: 0:77: 'xyz' :  field selection requires 
structure, vector, or matrix on left hand side
W libSkyBoxTest_arm64-v8a.so: ERROR: 0:77: 'return' : function return is not 
matching type:
W libSkyBoxTest_arm64-v8a.so: ERROR: 4 compilation errors.  No code generated.
07-31 02:35:03.170 24150 24253 W libSkyBoxTest_arm64-v8a.so:
07-31 02:35:03.170 24150 24253 W libSkyBoxTest_arm64-v8a.so:
W libSkyBoxTest_arm64-v8a.so: Source was:
W libSkyBoxTest_arm64-v8a.so: #version 100
W libSkyBoxTest_arm64-v8a.so: #extension GL_EXT_shader_texture_lod : require
W libSkyBoxTest_arm64-v8a.so: precision highp float;
W libSkyBoxTest_arm64-v8a.so: precision highp int;
07-31 02:35:03.170 24150 24253 W libSkyBoxTest_arm64-v8a.so:
W libSkyBoxTest_arm64-v8a.so: struct LightSource
W libSkyBoxTest_arm64-v8a.so: {
W libSkyBoxTest_arm64-v8a.so:     vec4 position;
W libSkyBoxTest_arm64-v8a.so:     vec4 direction;
W libSkyBoxTest_arm64-v8a.so:     vec4 diffuse;
W libSkyBoxTest_arm64-v8a.so:     vec4 specular;
W libSkyBoxTest_arm64-v8a.so:     float coneAngle;
W libSkyBoxTest_arm64-v8a.so:     float innerConeAngle;
W libSkyBoxTest_arm64-v8a.so:     float constantAttenuation;
W libSkyBoxTest_arm64-v8a.so:     float linearAttenuation;
W libSkyBoxTest_arm64-v8a.so:     float quadraticAttenuation;
W libSkyBoxTest_arm64-v8a.so: };
07-31 02:35:03.170 24150 24253 W libSkyBoxTest_arm64-v8a.so:
W libSkyBoxTest_arm64-v8a.so: struct cbMain
W libSkyBoxTest_arm64-v8a.so: {
W libSkyBoxTest_arm64-v8a.so:     vec3 qt_cameraPosition;
W libSkyBoxTest_arm64-v8a.so:     vec4 qt_lightProbeProperties;
W libSkyBoxTest_arm64-v8a.so:     vec3 qt_light_ambient_total;
W libSkyBoxTest_arm64-v8a.so:     vec4 qt_material_base_color;
W libSkyBoxTest_arm64-v8a.so:     vec3 qt_material_emissive_color;
W libSkyBoxTest_arm64-v8a.so:     vec4 qt_material_properties;
W libSkyBoxTest_arm64-v8a.so:     vec4 qt_material_properties2;
W libSkyBoxTest_arm64-v8a.so:     vec4 qt_material_
W libSkyBoxTest_arm64-v8a.so: Failed to build graphics pipeline state
------------------------------------------------------------------------------------------------------------

It seems that skybox uses an extension that is not available in nokia 5.4 GPU 
or software.
I will report a bug, but before that, maybe someone wants to give theirs 2 
cents ?


The code is


Window {

    visible: true

    width: 640

    height: 480

    title: qsTr("Hello World")





    View3D {

        id: view3D

        visible: true

        width: parent.width

        height: parent.height


        //SkyBox mode

        environment: SceneEnvironment {

            backgroundMode: SceneEnvironment.SkyBox

            lightProbe: Texture {

                source: "qrc:/galaxy.hdr"

                mappingMode: Texture.LightProbe

            }

        }


        // color mode

        /*environment: SceneEnvironment {

            backgroundMode: SceneEnvironment.Color

            clearColor: "skyblue"

        }*/


        //! [camera]

        PerspectiveCamera {

            id: cam

            position: Qt.vector3d(0, 0, 500)

        }

        //! [camera]



        DirectionalLight {

            eulerRotation.x: -45

        }


        Model {

            id: ball

            //source: "#Cylinder"

            source: "#Cylinder"

            scale: Qt.vector3d(1, 1, 1)

            materials: [ DefaultMaterial {

                    diffuseColor: "red"

                }

            ]

            position: Qt.vector3d(-100, -150, 0)

            onPositionChanged: console.log(position)

        }

    }

}


Cheers
João
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to