[vtkusers] Odd opacity issue

Gib Bogle g.bogle at auckland.ac.nz
Sat Aug 9 19:25:52 EDT 2014


Hi,
I'm using vtkRenderWindowInteractor (VTK 5.10) in Qt, rendering spheres.  I'm trying to implement a degree of transparency, like this:

actor->GetProperty()->SetOpacity(opacity);

applied to all the spheres.

If opacity is less than 1 the image immediately changes in unexpected ways.  See the two attached images, with opacity = 1.0 and 0.99.  It looks as if spheres have had their positions and sizes changed.  But when I rotate the scene it becomes apparent that something else is happening.  Some of the "foreground" spheres move from left to right (for example) while others apparently in the foreground are moving right to left.  It seems that the order of rendering of the spheres, which normally places the most remote first and the nearest last, has somehow been messed up, so that spheres at the back are being rendered last so that they appear to be the closest.  Maybe the order has been simply reversed, but the visual effect is made more confusing by parallax - my brain is interpreting the bigger spheres as closer.

Is this a well-known issue, and is there a simple way to fix it?

Thanks
Gib
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140809/c2cb2382/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opacity99.png
Type: image/png
Size: 97644 bytes
Desc: opacity99.png
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140809/c2cb2382/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opacity100.png
Type: image/png
Size: 90768 bytes
Desc: opacity100.png
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140809/c2cb2382/attachment-0003.png>


More information about the vtkusers mailing list