Re: SSAA and FXAA

Allie Vacanti via vtkusers <[email protected]> Wed, 6 Mar 2019 10:37:05 -0500
Newsgroups gmane.comp.lib.vtk.user
Message-ID <CA+=e1osomMiuJiNTetsFrq4v3EPTnqWG1Oy3Wni_qv1PCWg4=w@mail.gmail.com>
I'm not sure what's causing this, enabling FXAA should work out of the box
for all data rendered in the opaque/translucent passes. Have you tried with
the default options? They shouldn't need to be tweaked unless you're having
serious performance / quality issues.

For SSAA, I'm curious why you're setting the maximum number of peels to 0?
That effectively disables peeling and would result in the improper blending
that you're seeing.

HTH,
-Allie

On Tue, Mar 5, 2019 at 3:43 PM chung <[email protected]> wrote:

> 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<vtkRenderer> renderer =
> vtkSmartPointer<vtkOpenGLRenderer>::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 );
>
> <http://vtk.1045678.n5.nabble.com/file/t342714/fxaa.png>
>
>
> 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.
>
>
> http://vtk.1045678.n5.nabble.com/vtk-developers-QVTKOpenGLWidget-SSAA-pass-breaks-depth-peeling-td5746428.html
>
>
> vtkSmartPointer<vtkRenderer> renderer =
> vtkSmartPointer<vtkOpenGLRenderer>::New();
> renderer->SetBackground ( 0.615f, 0.639f, 0.666f );
>
> vtkNew<vtkRenderStepsPass> basicPasses;
> vtkNew<vtkSSAAPass> ssaa;
>
> vtkSmartPointer<vtkDepthPeelingPass> depthPeel = vtkSmartPointer <
>         vtkDepthPeelingPass > ::New();
> vtkSmartPointer<vtkTranslucentPass> translucent = vtkSmartPointer <
>         vtkTranslucentPass > ::New();
> depthPeel->SetMaximumNumberOfPeels ( 0 );
> depthPeel->SetTranslucentPass ( translucent );
> basicPasses->SetTranslucentPass ( depthPeel );
>
>
> ssaa->SetDelegatePass ( basicPasses );
> renderer->SetPass ( ssaa );
> renderer->SetUseDepthPeeling ( true );
> renderer->SetMaximumNumberOfPeels ( 0 );
>
> <http://vtk.1045678.n5.nabble.com/file/t342714/ssaa.png>
>
>
> I'm not sure what I'm missing and I would greatly appreciate if anyone can
> help me spot it.
>
> Thanks,
> 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
>

_______________________________________________
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