Re: SSAA and FXAA

chung <[email protected]> Fri, 8 Mar 2019 12:20:50 -0700 (MST)
Newsgroups gmane.comp.lib.vtk.user
Message-ID <[email protected]>
Ah I figured out why MSAA didn't work for me. I needed to call
SetGlobalMaximumNumberOfMultiSamples before setting the QSurfaceFormat since
QVTKOpenGLWidget::defaultFormat() is dependent on that global max multiple
sample value.


//-----------------------------------------------------------------------------
QSurfaceFormat QVTKOpenGLWidget::defaultFormat()
{
  QSurfaceFormat fmt;
  fmt.setRenderableType(QSurfaceFormat::OpenGL);
  fmt.setVersion(3, 2);
  fmt.setProfile(QSurfaceFormat::CoreProfile);
  fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
  fmt.setRedBufferSize(1);
  fmt.setGreenBufferSize(1);
  fmt.setBlueBufferSize(1);
  fmt.setDepthBufferSize(1);
  fmt.setStencilBufferSize(0);
  fmt.setAlphaBufferSize(1);
  fmt.setStereo(false);
* 
fmt.setSamples(vtkOpenGLRenderWindow::GetGlobalMaximumNumberOfMultiSamples());*
#ifdef DEBUG_QVTKOPENGL_WIDGET
  fmt.setOption(QSurfaceFormat::DebugContext);
#endif
  return fmt;
}




// MSAA is fixed by adding these two lines before creating any
QVTKOpenGLWidget
vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples ( 8 );
QSurfaceFormat::setDefaultFormat ( QVTKOpenGLWidget::defaultFormat() );

Thanks Allie,
Chuan



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers