vtkDualDepthPeelingPass example

Hi,
I came across this article about dual depth peeling. It provides the code for fragment shader, but it can’t simply used.(I need to create the depth into texture and other stuff.) I then found that the feature is already implemented into a class vtkDualDepthPeelingPass. The vtkDualDepthPeelingPass.h can be found here on github.
It seems like there are only a few public functions to call. I have no idea how to use this class by just looking at the source code.
Is there any example on how to use this class?

Thanks.

Hi,

Calling renderer->UseDepthPeelingOn() should be enough. Some potentially outdated steps to follow are available here: VTK/Depth Peeling - KitwarePublic

Hello,

That is low level API. Normally you call front end API and VTK innards decide which class specialization to use. Why do you need to especifically use that class? Are you experiencing issues with your rendering?

best,

PC

Thank you for the link. That solved my problem.

Hi Paulo,
Thanks for your kind reply. My problem was that when I checked whether depth peeling was enabled or not using

    int depthPeelingWasUsed = renderer->GetLastRenderingUsedDepthPeeling();

it always prints “0” indicating false. I later found that it’s because I didn’t set the opacity of the actor. Depth peeling only takes effect on traslucent geometry.