Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. The QLayer in Qt3D has an error, may be a bug
Forum Updated to NodeBB v4.3 + New Features

The QLayer in Qt3D has an error, may be a bug

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 646 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.
  • W Offline
    W Offline
    wang_qt
    wrote on last edited by
    #1

    0_1524146102766_p2.png

    Please look at this picture. I have tried many times, but still cannot solve this problem.

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Are you rendering from a secondary thread?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wang_qt
        wrote on last edited by
        #3

        Hi VRonin,
        Thanks for your reply. I didn't create any thread in my program.

        The following is the framegraph I made to show 4 viewports,
        //Four viewports
        //Framegraph top node
        m_pSurfaceSelectorFourViewPorts = new Qt3DRender::QRenderSurfaceSelector();
        m_pSurfaceSelectorFourViewPorts->setSurface(this);

        //Clear Buffer
        auto pClearBuffer = new  Qt3DRender::QClearBuffers(m_pSurfaceSelectorFourViewPorts);
        auto PNoDraw = new Qt3DRender::QNoDraw(pClearBuffer);
        pClearBuffer->setBuffers(Qt3DRender::QClearBuffers::ColorDepthBuffer);
        pClearBuffer->setClearColor(QColor(95,105,115));//change the background color
        
        //View LeftUp
        auto pViewPortLeftUp = new Qt3DRender::QViewport(m_pSurfaceSelectorFourViewPorts);
        auto pCameraSelectorLeftUp = new Qt3DRender::QCameraSelector(pViewPortLeftUp);
        pViewPortLeftUp->setNormalizedRect(QRectF(0.0f,0.0f,0.5f,0.5f));
        pCameraSelectorLeftUp->setCamera(m_pCameraLeftUp);
        
        
        //View RightUp, front view 
        auto pViewPortRightUp = new Qt3DRender::QViewport(m_pSurfaceSelectorFourViewPorts);
        auto pCameraSelectorRightUp = new Qt3DRender::QCameraSelector(pViewPortRightUp);
        pViewPortRightUp->setNormalizedRect(QRectF(0.5f,0.0f,0.5f,0.5f));
        pCameraSelectorRightUp->setCamera(m_pCameraRightUp);
        
        
        	//View indicator viewport
            auto pViewPort_FourViewPorts_RightUpViewPort_ViewIndicator = new Qt3DRender::QViewport(m_pSurfaceSelectorFourViewPorts);
        	auto pCameraSelector_FourViewPorts_RightUpViewPort_ViewIndicator = new Qt3DRender::QCameraSelector(pViewPort_FourViewPorts_RightUpViewPort_ViewIndicator);
            **auto pLayerFilter_FourViewPorts_RightUpViewPort_ViewIndicator = new Qt3DRender::QLayerFilter(pCameraSelector_FourViewPorts_RightUpViewPort_ViewIndicator);**
            pViewPort_FourViewPorts_RightUpViewPort_ViewIndicator->setNormalizedRect(QRectF(0.0f, 0.0f, 0.1f, 0.1f));
        	**pCameraSelector_FourViewPorts_RightUpViewPort_ViewIndicator->setCamera(m_pCameraRightUp);
            pLayerFilter_FourViewPorts_RightUpViewPort_ViewIndicator->addLayer(pLayerRightView);**
        
        //View LeftBottom
        auto pViewPortLeftBottom = new Qt3DRender::QViewport(m_pSurfaceSelectorFourViewPorts);
        auto pCameraSelectorLeftBottom = new Qt3DRender::QCameraSelector(pViewPortLeftBottom);
        pViewPortLeftBottom->setNormalizedRect(QRectF(0.0f,0.5f,0.5f,0.5f));
        pCameraSelectorLeftBottom->setCamera(m_pCameraLeftBottom);
        
        //View RightBottom
        auto pViewPortRightBottom = new Qt3DRender::QViewport(m_pSurfaceSelectorFourViewPorts);
        auto pCameraSelectorRightBottom = new Qt3DRender::QCameraSelector(pViewPortRightBottom);
        pViewPortRightBottom->setNormalizedRect(QRectF(0.5f,0.5f,0.5f,0.5f));
        pCameraSelectorRightBottom->setCamera(m_pCameraRightBottom);
        

        If I comment the two lines in bold, there will be no problem.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wang_qt
          wrote on last edited by wang_qt
          #4

          Hi VRonin,
          My reply is considered as spam, so I put it in my google drive
          https://drive.google.com/file/d/1USmQWEV-vnSDOezq1aTuIKmApOZJfPja/view?usp=sharing

          Thanks for your help.

          If you need, I can give you my source code.

          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