Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt3D face culling

    General and Desktop
    qt3d qt 5.6
    2
    2
    1740
    Loading More Posts
    • 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.
    • Widgy
      Widgy last edited by

      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?

      1 Reply Last reply Reply Quote 1
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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)

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post