Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Quick 3D use transparent textures with Model



  • Im trying to add a 3D model of a car to a 3D QML scene. With only base texture it looks normal, but the windows are not transparent. To solve this problem I added an opacity map:

            PrincipledMaterial {
                id: material__62_material
                baseColor: "#ffffffff"
                baseColorMap: Texture {
                    source: "maps/base.png"
                    tilingModeHorizontal: Texture.Repeat
                    tilingModeVertical: Texture.Repeat
                }
                opacityMap: Texture {
                    source: "maps/opacity.png"
                    tilingModeHorizontal: Texture.Repeat
                    tilingModeVertical: Texture.Repeat
                }
            }
    

    And now the model looks like B image
    demo.jpg
    I tried to set different alpha value. Even if the opacity texture is completely white, I still can see through the model. The same way it looks if I add alpha channel to base.png
    What configurations shall I use for correct alpha blending?

    source code: https://drive.google.com/file/d/1Vnt3DafzEKMUUcbUkB4gQ9u8EhswbBjr/view?usp=sharing


Log in to reply