[vtk-developers] VTK and transparency problems
Clinton Stimpson
clinton at elemtech.com
Fri Sep 30 17:36:22 EDT 2005
Lisa Avila wrote:
>
> Two things to consider for whoever is implementing this:
>
> First, the vtkCuller already sort props based on some criteria - we
> should make sure these two don't work against each other. That is - if
> you are sorting front to back for some other reason and you change one
> of your actors to have non 1 opacity then some things start rendering
> back to front but the user won't know why. My recommendation would be
> to use the vtkFrustumCoverageCuller to do the sorting - turn sorting
> on even though it isn't on whenever you encounter more than one
> translucent prop. By default, sorting is off so this will work fine.
> If sorting is on and isn't back-to-front, or a different culler is in
> use (don't know of another one in existence) then there is a problem -
> but this is something to user should then be able to find since you
> can describe this conflict in the documentation for vtkCuller and
> vtkRenderer. I assume the sorting you need is back to front, which is
> also what volume rendering needs so this change would also make
> multiple (non-overlapping) volumes render correctly too. If you do
> this change (and what I say below), you would then be able to
> correctly render a volume inside a translucent box although why you
> would want to do that I don't know.... :-)
>
> Second, keep in mind that UpdateGeometry renders props, not actors. So
> - if you render a prop that is actually a vtkVolume twice, it will
> show up twice since the settings of glCullFace do not matter. You'll
> need to determine if the prop is a volume and not render it in either
> of your two passes, but render it between these two passes. So you
> wind up with three passes - one for non-volumes with front faces
> culled, then all volumes, then again for all non-volumes with back
> faces culled. Thinking about it - I am not sure it is the same sorting
> you need for the first and last pass - right? If you have nested
> spheres, A inside of B, and B inside of C, then you want to draw C, B,
> A (any volumes) A, B, C - right? You generally need to reverse the
> order for the second geometry pass....
It is actually the same sorting (back to front) for both passes of
non-volume actors.
Clint
More information about the vtk-developers
mailing list