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

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu Jun 24 08:01:32 EDT 2010


Hi Sebastian,

Depth peeling is taking care of the ordering, so if it's not working
properly, it might be related to the fact that you only have points
(+1 surface) and not only surfaces. But then I have no clue on the
reason of your issue. But if the issue is pretty clear you should
submit a bug with some code and picture that highlights it.

Seb

On Wed, Jun 23, 2010 at 3:35 AM, Barth, Sebastian
<sebastian.barth at iosb.fraunhofer.de> wrote:
> Hi Sebastian,
>
> I've tried with and without peeling. The result is similar but changed a bit:
> - The cluster of points (one Actor) seems to be darker than before
> - The points in front of the plane seem to be in front of the plane not behind
> - The points in front of the plane ignore the plane (not getting brighter)
> - The points in front of the plane still get rendered correctly with its alpha value only if the plane behind them is NOT translucent
>
> I've used this How-To:
> http://www.itk.org/Wiki/VTK/Depth_Peeling
>
> It really seems to be an ordering problem. Any idea?
>
> VTK makes me getting angry because of its bad documentation (even the books).
>
> Thanks for any help!
>
> Sebastian
>
> -----Ursprüngliche Nachricht-----
> Von: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com]
> Gesendet: Montag, 21. Juni 2010 15:55
> An: Barth, Sebastian
> Cc: David Gobbi; vtkusers at vtk.org
> Betreff: Re: [vtkusers] Scalar data interpreted as 4 component color does not interprete the alpha value correctly
>
> Hi Sebastian,
>
> Did you activate the Depth Peeling on the renderer ?
>
> Seb
>
> On Mon, Jun 21, 2010 at 9:17 AM, Barth, Sebastian
> <sebastian.barth at iosb.fraunhofer.de> wrote:
>> 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
>> _______________________________________________
>> 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