title: Qt3d: Artifacts of displaying when applied Qt3DRender::QLayerFilter
body: <p>I am trying to use layer filtering as shown in <a href="https://stackoverflow.com/a/55033342/12177714">this answer</a>. For this I wrote a simple test (see below). This is a continuation of the <a href="https://stackoverflow.com/questions/59437118/qt3d-using-qt3drenderqlayerfilter">question</a>.</p>
  
  <p>At a certain position of the red sphere, an artifact appears, which looks like display from the another camera in coordinates (0.0, 0.0, 0.0).</p>
  
  <p>See screen:
  <a href="https://i.stack.imgur.com/q8xYa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q8xYa.png" alt="enter image description here"></a></p>
  
  <p>In my example, the red sphere can be moved with the WSAD buttons.
  See (-7, 0, -14) red sphere position. How to remove these artifacts?
  The full test project can be viewed <a href="https://github.com/avttrue/qt3dTestLayerFilter" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>main.cpp</strong></p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QGuiApplication application(argc, argv);
          My3DWindow window;
  
          auto sphere1 = new Qt3DCore::QEntity(window.Scene());
          auto sphere2 = new Qt3DCore::QEntity(window.Scene());
  
          // material, transform, mesh initialisation
  
          sphere1-&gt;addComponent(material1);
          sphere1-&gt;addComponent(spheremesh1);
          sphere1-&gt;addComponent(transform1);
          sphere1-&gt;addComponent(window.OpaqueLayer());
  
          sphere2-&gt;addComponent(material2);
          sphere2-&gt;addComponent(spheremesh2);
          sphere2-&gt;addComponent(transform2);
          sphere2-&gt;addComponent(window.TransparentLayer());
  
          window.show();
          return application.exec();
      }
  </code></pre>
  
  <p><strong>My3DWindow class:</strong></p>
  
  <pre><code>My3DWindow::My3DWindow(QScreen *screen):
      Qt3DExtras::Qt3DWindow(screen)
  {
      m_Scene = new Qt3DCore::QEntity;
      setRootEntity(m_Scene);
  
      auto renderSurfaceSelector = new Qt3DRender::QRenderSurfaceSelector(m_Scene);
      renderSurfaceSelector-&gt;setSurface(this);
      auto clearBuffers = new Qt3DRender::QClearBuffers(renderSurfaceSelector);
      clearBuffers-&gt;setBuffers(Qt3DRender::QClearBuffers::AllBuffers);
      clearBuffers-&gt;setClearColor(Qt::gray);
  
      auto viewport = new Qt3DRender::QViewport(renderSurfaceSelector);
      auto cameraSelector = new Qt3DRender::QCameraSelector(viewport);
  
      m_Camera = new Qt3DRender::QCamera(cameraSelector);
      m_Camera-&gt;lens()-&gt;setPerspectiveProjection(45.0f, 16.0f/9.0f, 0.1f, 1000.0f);
      m_Camera-&gt;setPosition(QVector3D(0.0f, 0.0f, 100.0f));
      m_Camera-&gt;setViewCenter(QVector3D(0.0f, 0.0f, 0.0f));
  
      cameraSelector-&gt;setCamera(m_Camera);
  
      auto cameraController = new Qt3DExtras::QFirstPersonCameraController(m_Scene);
      cameraController-&gt;setCamera(m_Camera);
  
      m_OpaqueLayer = new Qt3DRender::QLayer;
      auto opaqueFilter = new Qt3DRender::QLayerFilter(m_Camera);
      opaqueFilter-&gt;addLayer(m_OpaqueLayer);
  
      m_TransparentLayer = new Qt3DRender::QLayer;
      auto transparentFilter = new Qt3DRender::QLayerFilter(m_Camera);
      transparentFilter-&gt;addLayer(m_TransparentLayer);
  
      setActiveFrameGraph(renderSurfaceSelector);
  }
  </code></pre>
  
  <hr>