Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Nodeinstantiator performance issue
Forum Updated to NodeBB v4.3 + New Features

Nodeinstantiator performance issue

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 252 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ChabaC Offline
    ChabaC Offline
    Chaba
    wrote on last edited by Chaba
    #1

    Hello all,
    I want to visualize x,y,z points as cubic blocks. I use C++ for backend and qtquick/javascript for frontend. I have implemented QAbstractListModel in C++ side and exposing to qml (qtquick) with QQmlApplicationEngine rootContext. Data include only x,y,z points and color codes. Data have arround 500 thousand coordinate points. I'm trying to visualize this data with NodeInstantiator dynamically. But it takes too much time to create objects, and ram usage increasing rapidly to 5-6 GB. If I solve the performance issue, I will try to add border lines to blocks. And I don't know how to do it aswell. OS: Windows 10 Ram: 8 GB max GPU: Nvidia 970 GTX QT Creator 7.0.0 Kit: Desktop Qt 5.15.2 MinGW 64 Bit

    import QtQuick 2.15
    import QtQuick.Window 2.15 as W
    import QtQuick.Scene3D 2.15
    import Qt3D.Core 2.15
    import Qt3D.Render 2.15
    import Qt3D.Extras 2.15
    import Qt3D.Input 2.15
    
    import QtQuick.Controls 2.5
    
    //import QtQuick3D 1.15
    
    Page {
        Rectangle {
    
            id: rect1
            x:0
            y:0
            width: 100
            height: 100
            color: "red"
        }
    
        Scene3D {
            id: scene3dId
            anchors.top: rect1.bottom
    
            anchors.bottom: parent.bottom
            anchors.right: parent.right
            anchors.left: parent.left
    
            //anchors.fill: parent
            aspects: ["input", "logic"]
    
            Entity {
                id: scene
                property color baseColor
                property real metalness
                property real roughness
                property real exposure
                property real gamma
    
                components: [
                    RenderSettings {
                        activeFrameGraph: ForwardRenderer {
                            camera: mainCamera
                            clearColor: "white"
                            gamma: scene.gamma
                        }
                    },
                    // Event Source will be set by the Qt3DQuickWindow
                    InputSettings { }
                ]
    
                Camera {
                    id: mainCamera
                    position: Qt.vector3d(0, 0, 12)
                    viewCenter: Qt.vector3d(0, 0, 0)
                    fieldOfView: 60
                    exposure: scene.exposure
                }
    
                OrbitCameraController {
                    camera: mainCamera
                    linearSpeed: 1000
                    lookSpeed: 240
                }
                CuboidMesh{
                    id: cubeMesh
                    xExtent: 1
                    yExtent: 1
                    zExtent: 1
                }
    
                NodeInstantiator {
                        id: grid
                        model: BM
    
                        Entity {
                            Transform {
                                id: sphereTransform
                                translation: Qt.vector3d(model.X, model.Y, model.Z)
                            }
                            PhongMaterial {
                                id: cubeMaterial2
                                ambient: model.Color
                            }
                            components: [sphereTransform, cubeMesh, cubeMaterial2]
                        }
                    }
            }
        }
    }
    

    And here is an example of what I want to do:
    alt text

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved