3D "overlay" in Qt Quick 3D

23 Views Asked by At

I'm porting a three.js app to QML / Qt Quick 3D.

I have the following section to draw certain things (3D objects) "on top" of everything, i.e. disregarding depth order (this is a THREE.Object3D):

if(overlay) {
    this.renderOrder = 999; // render last
    this.material.depthTest = false; // skip depth test
    this.material.depthWrite = false; // don't write to depth
    this.onBeforeRender = function (renderer) {
        renderer.clearDepth(); // clear depth before render
    };
}

How can the same achieved in Qt Quick 3D?

Edit: there is a depthTestEnabled property but that toggles depth testing globally, not just for a single Node.

1

There are 1 best solutions below

3
user2230199 On

QtQuick 3D is part of QtQuick and the 3D scene is rendered withing the SceneGraph. This means if you want to create an "overlay" you just need to create any QML Item that is on higher z-order than your 3D scene (not part of the scene nodes but the parent QML Item) and it will be rendered on top of everything.