1

I am using Qt3D to draw lines and I use the QPerVertexColorMaterial approach for more efficiency (see here for code example : How to optimize point cloud rendering in Qt3D).

I defined a size of 4 vertex for the color attribute (rgba) since I would like to modify transparency on specific lines. But modifying the alpha value seems to have no effect on display.

Is it possible to do this with the QPerVertexColorMaterial implementation in Qt3D ?

llebocq
  • 33
  • 2

1 Answers1

1

Although you can provide color attributes with proper alpha values for the vertices the QPerVertexColorMaterial itself does not implement alpha blending. Have a look at QPhongAlphaMaterial under qt/qt3d/src/extras/defaults/qphongalphamaterial.cpp to see what's needed to handle transparency.

vre
  • 6,041
  • 1
  • 25
  • 39
  • So you confirm it is not possible to handle transparency with QPerVertexColorMaterial and I need to create a specific material to do this ? – llebocq Apr 19 '21 at 07:17
  • Exactly, that's what I mean. – vre Apr 19 '21 at 07:18
  • 1
    Thank you for your help. I am amazed to find so little information on this need. I feel like this is a pretty basic feature and wonder how Qt3d users usually resolve it. Of course, we can manage the transparency entity by entity but by doing this, I noticed a big slowdown in the display. – llebocq Apr 19 '21 at 12:08