[vtkusers] [vtk-developers] QVTKOpenGLWidget + SSAA pass breaks depth peeling

Allie Vacanti allison.vacanti at kitware.com
Fri Feb 16 16:39:29 EST 2018


Hi Simon,

This is intended behavior. Setting a pass on the renderer bypasses the
renderer's internal settings, and only the specified pass will be rendered.
This means that the call to l_renderer->SetUseDepthPeeling(true); has no
effect; only the l_ssaa render pass will be executed.

Your l_ssaa pass delegates to an instance of vtkRenderPassStepsPass, which
by default uses vtkTranslucentPass for rendering the translucent geometry
-- this only does basic alpha blending, not depth peeling.

What you want to do is replace the translucent pass with one that performs
depth peeling. Something like this should work:

    ...

    // setup SSAA pass
    vtkSmartPointer<vtkRenderStepsPass> l_basic_passes =
vtkSmartPointer<vtkRenderStepsPass>::New();
    vtkSmartPointer<vtkSSAAPass> l_ssaa =
vtkSmartPointer<vtkSSAAPass>::New();
    l_ssaa->SetDelegatePass( l_basic_passes );
    l_renderer->SetPass( l_ssaa );

    // Enable depth peeling. This pass is defined in the
vtkRenderingOpenGL2 module.
    vtkSmartPointer<vtkDualDepthPeelingPass> l_peel =
vtkSmartPointer<vtkDualDepthPeelingPass>::New();
    l_basic_passes->SetTranslucentPass(l_peel);

    ...

If you have issues with the dual depth peeling pass, try the older
vtkDepthPeelingPass. It's a bit slower, but still works.

HTH,
Allie

On Tue, Feb 13, 2018 at 3:54 AM, Simon Esneault <simon.esneault at gmail.com>
wrote:

> Hello VTK community
>
> Is seems adding an SSAA rendering pass breaks the depth peeling process.
> Attached is an example that highlight the problem. When commenting out the
> line 64 (l_renderer->SetPass( l_ssaa ); the translucent geometry is
> rendered correctly, but the result is not anti-aliased.
>
> With SSAA pass -> Depth Peeling broken : https://cdn.pbrd.co/images/
> H7qnZxC.png
> Without SSAA pass -> Depth Peeling ok : https://cdn.pbrd.co/images/
> H7qnvE9.png
>
> Shall I fill a bug for this ?
>
> Thanks
>
> --
> ------------------------------------------------------------------
> Simon Esneault
> Rennes, France
> ------------------------------------------------------------------
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180216/ca1075b6/attachment.html>


More information about the vtkusers mailing list