How to enable the stencil buffer?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to enable the stencil buffer?

pnt1614
I can do a clipping and fill a hole using the stencil buffer in OpenGL, so is
there anyway to enable and use the stencil buffer in VTK? I have checked
some examples about vtkImageStencil but how to enable stencil tests when
rendering objects?

Is there anybody experienced this problem? Please, help me.



--
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://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to enable the stencil buffer?

Allie Vacanti
Stencil masks aren't used often in VTK, though the LabeledContourMapper will use them, see:

https://gitlab.kitware.com/vtk/vtk/blob/master/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.cxx#L130

Using them requires enabling stencil buffers via the RenderWindow API and writing a new OpenGL mapper or renderpass to setup the GL state. There is not an existing general way to render arbitrary actors into a stencil buffer that I am aware of.

On Tue, Sep 4, 2018 at 9:03 PM, pnt1614 <[hidden email]> wrote:
I can do a clipping and fill a hole using the stencil buffer in OpenGL, so is
there anyway to enable and use the stencil buffer in VTK? I have checked
some examples about vtkImageStencil but how to enable stencil tests when
rendering objects?

Is there anybody experienced this problem? Please, help me.



--
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://public.kitware.com/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://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How to enable the stencil buffer?

pnt1614
Thank for the reply, I try it.



--
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://public.kitware.com/mailman/listinfo/vtkusers