[vtkusers] VTK 8.0.0 OpenGL2 Invisible surfaces

Ken Martin ken.martin at kitware.com
Mon Jul 24 09:11:06 EDT 2017


Rendering transparent surfaces is tricky because the order they are
composited impacts the final color. There are a few techniques to address
this issue one of which is depth peeling. When you have depth peeling on,
then even if VTK thinks your surface is transparent, it will render it
correctly.
Without depth peeling, transparent surfaces are rendered by blending the
transparent surfaces all together in whatever order they happen to get
rendered.

To make sure they *all* get blended together VTK turns off writing to the z
buffer for transparent surfaces. So everything in front of the opaque
actors gets rendered and blended together based on their opacity. This is
called alpha blending and if you sort your polygons from back to front it
gives correct results. But sorting is computationally expensive and we do
not do it. Depth peeling is better in that case.

In your case all, or most, of your pixels on the surface are opaque even
though they get rendered in the translucent pass. So the blending operation
ends up being the last thing rendered wins (because they are opaque and z
writing is off).  So if you have a sphere made up of lots of small
triangles what you will see is the last half of the triangles rendered.
Depending on camera direction sometimes that will be the front side of the
sphere and it will look correct, from other directions those triangles will
be the back side and it will look incorrect. Either way you are just seeing
the last half of the triangles rendered (because as in most closed surfaces
there in a front and a back, so you see half). If the triangles were
randomly ordered you would always see a mishmash of front and back.

Hopefully that makes sense. All the faces are being rendered, it is just
that the last face rendered (regardless of front or back) wins.

The Opaque/Translucent setting controls when an actor renders (opaque pass
versus translucent pass) and whether it will write to the zbuffer. Opaque
writes to the zbuffer blocking anything else below it from rendering,
translucent does not write to the zbuffer allowing later polygons
underneath it to be rendered.







On Mon, Jul 24, 2017 at 2:11 AM, Taron <taron2000 at gmx.de> wrote:

> Hi Ken,
>
> indeed ForcingOpaque on the actors renders all surfaces. And the actors
> have
> a LUT witch contains opacity values < 1. In fact the border pixels have
> opacity = 0. Even when I use FroceOpaque these transculent borders are
> correctly invisible. What I still do not understand is, why vtk thinks that
> one face has to be completely transparent, when ForceOpaque is off and why
> it works when Depthpeeling is enabled?
> I hope you can shed some light into this.
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.
> com/VTK-8-0-0-OpenGL2-Invisible-surfaces-tp5744093p5744133.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
28 Corporate Drive
Clifton Park NY 12065

This communication, including all attachments, contains confidential and
legally privileged information, and it is intended only for the use of the
addressee.  Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited and may be unlawful. If you
received this communication in error please notify us immediately and
destroy the original message.  Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170724/bfb2c2e6/attachment.html>


More information about the vtkusers mailing list