Hi experts,
I’m using vtk 8.1 and am having a little bit of a trouble getting
anti-aliasing working.
When using the FXAA approach, the graphic remains the same regardless of the
FXAA options I pass to the renderer.
vtkSmartPointer renderer =
vtkSmartPointer::New();
renderer->SetUseFXAA ( true );
auto options = renderer->GetFXAAOptions();
options->SetSubpixelBlendLimit ( 0.75 );
options->SetHardContrastThreshold ( 0.045 );
options->SetRelativeContrastThreshold ( 0.125 );
options->SetEndpointSearchIterations ( 12 );
options->SetSubpixelContrastThreshold ( 0.25 );
options->SetUseHighQualityEndpoints ( true );
When using the SSAA render pass approach I have depth buffer issue where the
surfaces of a primitive cube get rendered in an incorrect order. I came
across this depth peeling fix but it didn’t work for me unfortunately.
vtkSmartPointer renderer = vtkSmartPointer::New();
renderer->SetBackground ( 0.615f, 0.639f, 0.666f );
vtkNew basicPasses;
vtkNew ssaa;
vtkSmartPointer depthPeel = vtkSmartPointer ::New();
vtkSmartPointer translucent = vtkSmartPointer ::New();
depthPeel->SetMaximumNumberOfPeels ( 0 );
depthPeel->SetTranslucentPass ( translucent );
basicPasses->SetTranslucentPass ( depthPeel );
ssaa->SetDelegatePass ( basicPasses );
renderer->SetPass ( ssaa );
renderer->SetUseDepthPeeling ( true );
renderer->SetMaximumNumberOfPeels ( 0 );
I’m not sure what I’m missing and I would greatly appreciate if anyone can
help me spot it.
Thanks,
Chuan