[vtk-developers] Are mappers Update()'d before actors are rendered ?

David Gobbi david.gobbi at gmail.com
Tue Aug 2 14:05:01 EDT 2016


Hi Julien,

The comment in the code is currently just wishful thinking.
HasTranslucentPolygonalGeometry() is called before vtkImageSlice::Render(),
which is where the mapper gets updated.

It's possible that before the VTK 6 pipeline changes, there was an
UpdateInformation call that updated the info that
HasTranslucentPolygonalGeometry() needs.  But I'm not 100% sure.  IHMO the
"Translucency" flag is something that should be set by the app developer,
rather than something that VTK tries to figure out on its own.
Translucency of vtkImageActor has been problematic in one way or another
ever since the class was introduced.

If you submit a bug report and assign it to me, then I'll look into this
and see if there is a reasonable fix that maintains backwards compatibility.

For now, one way to avoid this issue is to use vtkImageSliceMapper and
vtkImageSlice, instead of using vtkImageActor.  The
vtkImageSlice::HasTranslucentPolygonalGeometry() method doesn't try to
access the image data.

 - David


On Tue, Aug 2, 2016 at 2:55 AM, Julien Finet <julien.finet at kitware.com>
wrote:

> Hi David and all,
>
> According to your comment in
> vtkImageActor::HasTranslucentPolygonalGeometry(),
> mappers are updated before their actors are rendered.
>
> It does not seem to be the case in my workflow. Where is this Update()
> supposed to happen ?
>
> My problem is that when vtkImageSlice::RenderOpaqueGeometry() is called
> the first time, the mapper has never been updated, the image data has no
> scalars array, and vtkImageSlice::Render() is called within
> vtkImageSlice::RenderOpaqueGeometry(). It updates the mapper, so next time
> RenderTranslucentPolygonalGeometry() is called, Render() is called a second
> time (because this time I have a scalars array).
>
> Did I miss something ? Please note that I'm using a custom vtkFollower
> with my image actor.
>
> Thanks,
> Julien.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160802/01a32981/attachment.html>


More information about the vtk-developers mailing list