[vtkusers] Scalar data interpreted as 4 component color does not interprete the alpha value correctly

Barth, Sebastian sebastian.barth at iosb.fraunhofer.de
Mon Jun 21 09:17:14 EDT 2010


Hi again, David,

I just noticed that I was wrong: With this work-around vtk does render cloud points only correctly if the white wall of my example I wrote in my first mail is not translucent! If it is, the points will be rendered behind the wall! I'm confused!

Any idea?

Sebastian

-----Ursprüngliche Nachricht-----
Von: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] Im Auftrag von Barth, Sebastian
Gesendet: Montag, 21. Juni 2010 14:40
An: David Gobbi
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Scalar data interpreted as 4 component color does not interprete the alpha value correctly

Hi David,

thanks a lot! That solved my problem.

Does this mean, it's a bug?

I set the opacity of the actor to 0.9999 and it's working now perfectly with the set alpha value in the scalar data. Is this a work around or the common style?

Thanks,

Sebastian

-----Ursprüngliche Nachricht-----
Von: David Gobbi [mailto:david.gobbi at gmail.com] 
Gesendet: Montag, 21. Juni 2010 13:36
An: Barth, Sebastian
Cc: vtkusers at vtk.org
Betreff: Re: [vtkusers] Scalar data interpreted as 4 component color does not interprete the alpha value correctly

Hi Sebastian,

Could it be a sorting issue?  Translucent actors must be sorted
back-to-front for alpha compositing to work properly.  Opaque actors
do not have to be sorted, they are always rendered before any
translucent actors are rendered.

VTK will assume that any object with 4 color components is a
translucent object, and it will assume that any object with an Opacity
less than 1.0 is translucent.  Likewise, objects with 3 color
components and with an Opacity of 1.0 are assumed to be opaque.

   David


On Mon, Jun 21, 2010 at 4:51 AM, Barth, Sebastian
<sebastian.barth at iosb.fraunhofer.de> wrote:
> Hello vtkusers,
>
>
>
> I display a cluster of points stored in a vtkPolyData with one vtkActor.
> There is also scalar data for every point of the polydata. It's stored in a
> vtkUnsignedCharArray which contains 4 components (r, g, b and alpha color
> values) per point that are interpreted as color
> (mapper->SetColorModeToDefault()).
>
>
>
> The problem is that the alpha value is intpreted only in respect to the
> background color. Any other object is ignored!
>
> For example: You have a point cloud with only red points that have a alpha
> value of 128 (the scalar range is 255), represented by the components {255,
> 0, 0, 128}. The background color is black but between the background and the
> point cloud is a while plane which hides the background. Normally this wall
> and the alpha value 128 should color the points in front of the plane more
> in a brighter red. The opposite happens: The points are getting darker
> because of the black background behind the plane!
>
>
>
> Is this a bug or did I forget anything?
>
>
>
> Thanks a lot,
>
>
>
> Sebastian
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/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

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list