The rendering performance of VTK is lower than that of QOpenGLWidget. How can I improve VTK's display performance?

If I’m understanding your OpenGL code correctly, you’ve effectively disabled lighting in your rendering pipeline. The pointLight function in your vertex shader is defined but never called, so no lighting calculations are performed. Instead, your fragment shader simply sets every fragment to a constant orange color. For a fair comparison with VTK, you would need to similarly disable lighting calculations in VTK.

Additionally, your OpenGL code renders the data as points (GL_POINTS), which is computationally inexpensive and very fast. In contrast, the VTK code processes and renders the data as vtkPolyData, which involves additional steps like triangulation and potentially more complex rendering. To make the comparison more equivalent, I might recommend setting the actor’s representation to points.

1 Like