The left window is a QVTKOpenGLNativeWidget renderwindow, the right is vtkRenderWindow.
The gree cube is a vtkCubeSource → vtkGlyph3DMapper. You can see the cube in right window is smoother than left.
I have write the following code, but it didn’t work.
vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples(16);
QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());
// vtkwidget is a instance of QVTKOpenGLNativeWidget
ui->vtkwidget->GetRenderWindow()->SetMultiSamples(16);
Hi Paulo, I have done this as you did, but the problem still exist. (I think the problem is caused by other reason, may not anti-alias)
Please see the image blow
cube 1 is vtkCubeSource->vtkPolyDataMapper->vtkActor. Cube1’s opacity = 1
cube 2~6 are vtkCubeSource->vtkGlyph3DMapper->vtkActor ( In vtkGlyph3DMapper, I have set difference scale and orientation for each cube), cube 2~6 's opcaity = 0.5
Can you try FXAA? FXAA is post-rendering, thus it can mitigate certain aliasing caused by some shaders MSAA is unable to handle. Maybe such shaders are involved in the case of the cubes 2-6. Either this or change the pink rectangles pipeline to that of the green one. BTW, why do you need vtkGlyph3DMapper instead of a common polydata mapper?
Hi, I have tried FXAA, the result is not so good I think. The reason why I use vtkGlyph3DMapper is because I need to render thousands of cubes / arrow / sphere / or other source at 30fps. And those object s are changing all the time (color / size / pos / orientation).