Kuesa Runtime

QuickSceneMaterial QML Type

Convenience wrapper that renders QtQuick content onto a Qt 3D texture set on a Kuesa Material as the diffuseMap property. More...

Detailed Description

QuickSceneMaterial takes care of instantiating a Scene2D with a proper RenderTarget and Texture2D color attachment. The Texture2D is then set on a Kuesa::GLTF2MaterialProperties node as the diffuseMap if present, otherwise as the baseColorMap.

 import QtQuick 2.15
 import Kuesa 1.3 as Kuesa

 Item {
     id: root

     KuesaUtils.View3D {
         id: scene3D
         anchors.fill: parent
         source: "qrc:/car.gltf"
         camera: "CamSweep_Orientation"

         // Renders QtQuick into a Texture and set it as the diffuseMap
         // property of the MatScreen material
         Kuesa.QuickSceneMaterial {
             name: "MatScreen"
             collection: scene3D.materials

             Item {
                 width: 512
                 height: 512

                 Text {
                     anchors.centerIn: parent
                     text: "Hello! I'm a QtQuick Text Item"
                     font.pixelSize: 36
                     color: "white"