Qt3D face culling



  • Hi,

    we are developing a desktop application with 3D graphics using Qt3D. We have run into some issues when using the Qt3DRender.CullFace settings in the Qt3DRender.StateSet module.

    Basically we have an open surface which was correctly rendering the front, but not the back face. We then added the Qt3DRender.CullFace settings like this (QML):

               Scene3D {
                .....
                .....
                    // Top-level entity
                    entity: Qt3DCore.Entity {
                    .....
                    .....
                        // Simple framegraph that just renders the scene from the camera
                        components: [
                            Qt3DRender.FrameGraph {
                                activeFrameGraph: Qt3DRender.Viewport {
                                    rect: Qt.rect(0, 0, 1, 1) // From Top Left
                                    clearColor: "transparent"
    
                                    Qt3DRender.CameraSelector {
                                        camera: camera
    
                                        Qt3DRender.ClearBuffer {
                                            buffers : Qt3DRender.ClearBuffer.ColorDepthBuffer
    
                                            Qt3DRender.StateSet {
                                                Qt3DRender.CullFace {
                                                    //mode: Qt3DRender.CullFace.FrontAndBack
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        ]
    
                 } //Top-level entity
        } //Scene3D 
    
    

    The obvious first strange thing here is that we don't even have to add the mode setting of the CullFace to make it work - even though the line is commented out, both the front and back face is rendered correctly.

    The other issue is that when rotating the camera, the depth mode seems to be broken - we have two objects in the scene, and now one of them is always in the front of the other when rotating 360 degrees.

    It seems to us that we are either not using the correct way of changing culling settings, or that when adding the Qt3DRender.StateSet part this overwrites other settings as well, related to depth etc.

    Any ideas?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Qt3D being in tech preview, I'd recommend posting your question on the interest mailing list. You'll find there Qt3D's module maintainers/developers (this forum is more user oriented)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.