title: Qt3d transparency texture will be covered. How to slove that?
body: <p>I add a plane to the 3D world and it should be in torus's center.</p>
  <p>But if I add the plane first and the tour second, the plane will be tour covered (plane's coordinate is in tour center):</p>
  <p><a href="https://i.stack.imgur.com/3lnTz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3lnTz.png" alt="enter image description here" /></a></p>
  <p>I think it is about paint order. The plane should be drawn in last order.</p>
  <p>Changing plane and torus adding order will be correct:</p>
  <p><a href="https://i.stack.imgur.com/A6dGV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A6dGV.png" alt="enter image description here" /></a></p>
  <p>Can <code>QDepthTest</code> help me? Or any other way?</p>
  <p>Can show me some examples? Thanks!</p>
  <p>code (without the sphere):</p>
  <pre><code>class FlippedTextureImage : public Qt3DRender::QPaintedTextureImage
  {
  public:
      FlippedTextureImage(Qt3DCore::QNode *parent = Q_NULLPTR):Qt3DRender::QPaintedTextureImage(parent) {}
      void paint(QPainter *painter) override {
          // qDebug() &lt;&lt; backgroundImage.isNull();
          qDebug() &lt;&lt; qApp-&gt;applicationDirPath() + &quot;/gift.svg&quot;;
                  QSvgRenderer renderer(QString(qApp-&gt;applicationDirPath() + &quot;/gift.svg&quot;));
          QImage image(3000, 3000, QImage::Format_RGBA8888);  // 512x512 RGBA
          image.fill(0x00ffffff);                           // white background
          QPainter painter2(&amp;image);
          renderer.render(&amp;painter2);
          painter-&gt;setCompositionMode(QPainter::CompositionMode::CompositionMode_Source);
          painter-&gt;drawImage(0, 0, image);
      }
  };
  </code></pre>
  <pre><code>Qt3DCore::QEntity *createScene()
  {
      // Root entity
      Qt3DCore::QEntity *rootEntity = new Qt3DCore::QEntity;
  
      // Material
      Qt3DRender::QMaterial *material = new Qt3DExtras::QPhongMaterial(rootEntity);
  
      // Plane 
          Qt3DCore::QEntity *planeEntity = new Qt3DCore::QEntity(rootEntity);
          Qt3DExtras::QPlaneMesh *planeMesh = new Qt3DExtras::QPlaneMesh(planeEntity);
          planeMesh-&gt;setHeight(2);
          planeMesh-&gt;setWidth(2);
  
          planeMaterial = new Qt3DExtras::QTextureMaterial(planeEntity);
          Qt3DRender::QTexture2D *planeTexture = new Qt3DRender::QTexture2D(planeMaterial);
  
          FlippedTextureImage *planeTextureImage = new FlippedTextureImage(planeTexture);
          planeTextureImage-&gt;setSize(QSize(3000, 3000));
          planeTexture-&gt;addTextureImage(planeTextureImage);
          planeMaterial-&gt;setTexture(planeTexture);
          planeMaterial-&gt;setAlphaBlendingEnabled(true);
          planeTransformClass *planeTransform = new planeTransformClass(planeEntity);
          //planeTransform-&gt;setRotationX(90);
          planeTransform-&gt;setTranslation(QVector3D(2, 0, 0));
  
          planeEntity-&gt;addComponent(planeMesh);
          planeEntity-&gt;addComponent(planeMaterial);
          planeEntity-&gt;addComponent(planeTransform);
  
      // Torus
      Qt3DCore::QEntity *torusEntity = new Qt3DCore::QEntity(rootEntity);
      Qt3DExtras::QTorusMesh *torusMesh = new Qt3DExtras::QTorusMesh;
      torusMesh-&gt;setRadius(5);
      torusMesh-&gt;setMinorRadius(1);
      torusMesh-&gt;setRings(100);
      torusMesh-&gt;setSlices(20);
  
      Qt3DCore::QTransform *torusTransform = new Qt3DCore::QTransform;
      torusTransform-&gt;setScale3D(QVector3D(1.5, 1, 0.5));
      torusTransform-&gt;setRotation(QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), 90.0f));
  
      torusEntity-&gt;addComponent(torusMesh);
      torusEntity-&gt;addComponent(torusTransform);
      torusEntity-&gt;addComponent(material);
  
      return rootEntity;
  }
  
  int main(int argc, char* argv[])
  {
      QGuiApplication app(argc, argv);
      Qt3DExtras::Qt3DWindow view;
  
      Qt3DCore::QEntity *scene = createScene();
  
      // Camera
      camera = view.camera();
      camera-&gt;lens()-&gt;setPerspectiveProjection(45.0f, 16.0f/9.0f, 0.1f, 1000.0f);
      camera-&gt;setPosition(QVector3D(0, 0, 40.0f));
      camera-&gt;setViewCenter(QVector3D(0, 0, 0));
  
      // For camera controls
      Qt3DExtras::QOrbitCameraController *camController = new Qt3DExtras::QOrbitCameraController(scene);
      camController-&gt;setLinearSpeed( 50.0f );
      camController-&gt;setLookSpeed( 180.0f );
      camController-&gt;setCamera(camera);
  
      view.setRootEntity(scene);
      view.show();
  
      return app.exec();
  }
  </code></pre>
  <p>This is the SVG I use:</p>
  <p><a href="https://web.archive.org/web/20210507012742/https://image.flaticon.com/icons/svg/3154/3154348.svg" rel="nofollow noreferrer"><img src="https://web.archive.org/web/20210507012742/https://image.flaticon.com/icons/svg/3154/3154348.svg" alt="enter image description here" /></a></p>