[vtkusers] Transparency

David E. Jones jonesde at rainbow.es.dupont.com
Tue Jan 9 18:11:47 EST 2001


Ben Held wrote:

> I am trying to control transparency on individual elements by using alpha
> values in a lookup table.  I get transparency, but elements that should have
> the same transparency are not shown the same.  See the attached image.  Any
> thoughts?
>
> Ben
>
> Ben L. Held
> Simulation Technology & Applied Research, Inc.
> 11520 N. Port Washington Rd.
> Suite 101B
> Mequon, WI  53092
> Phone: (262) 240-0291 x101
> FAX: (262) 240-0294
> e-mail: ben.held at staarinc.com
> web: http://www.staarinc.com
>
>   ------------------------------------------------------------------------
>
>                  Name: vtk.jpg
>    vtk.jpg       Type: JPEG Image (image/jpeg)
>              Encoding: base64

 Ben,

 I think that the problem is that the surface polygons aren't being rendered
 in back to front order.  The result of alpha blending two or more polygons is
 order dependent.   One thing that would help the appearance is to remove the
 backfaces using the BackfaceCullingOn method of vtkProperty. If you had
 just one convex polyhedron that would remove the artifacts.  However you
 appear to have at least 2 polyhedrons and at least 1 of them isn't convex.

  There  is a new class in recent releases of vtk which is probably what you
  will want to use.  It is reportedly very good even though its sorting method
  is approximate.  Its called vtkDepthSortPolyData and it  sorts poly data
  along the camera view direction.   There is an example in the contrib
directory.

   [The formula for blending the colors of two polygons is  a*A + (1 - a)*B
     where A is the front polygon and a is its opacity (i.e. a = 1 for an
opaque
     polygon and a = 0 for a transparent polygon.  This is  clearly not the
same
     as  b*B + (1 - b) * A which shows that the result is order dependent. ]

  Dave

--
David E Jones
Du Pont Central Research
Experimental Station, Bldg 320
Wilmington, DE 19880-0320


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010109/67bf2225/attachment.htm>


More information about the vtkusers mailing list