qt 3d Qml Прозрачная текстура Scene2D - PullRequest
0 голосов
/ 15 ноября 2018

Как визуализировать сетку текстуры, без этого по умолчанию серый фон?Я имею в виду, использовать компонент Scene2D, чтобы генерировать текстуру с альфа.Теперь похоже, что под моим красным прямоугольником был PhonMaterial.

Entity {
id: root

components: [cubeTransform, cubeMaterial, cubeMesh]
PlaneMesh {
    id: cubeMesh
    width: 10
    height: 10
}
Transform {
    id: cubeTransform
    translation: Qt.vector3d(0, 4, 0)
    scale3D: Qt.vector3d(1, 1, 1)
}
TextureMaterial   {
    id: cubeMaterial
    texture: textureId
}
Scene2D {
    id: qmlTexture
    output: RenderTargetOutput {
        attachmentPoint: RenderTargetOutput.Color0
        texture: Texture2D {
            id: textureId

            width: 100
            height: 1024
            format: Texture.RGBA8_UNorm
            generateMipMaps: true
            magnificationFilter: Texture.Linear
            minificationFilter: Texture.LinearMipMapLinear
            wrapMode {
                x: WrapMode.ClampToEdge
                y: WrapMode.ClampToEdge
            }
        }
    }
    Rectangle {
        x: 50
        width: 50
        height: textureId.height
        color: "red"
    }
}
 }

Теперь половина сетки красная (как и должно быть), но вторая - белая, а не прозрачная.

enter image description here

...