[vtkusers] vtkDepthSortPolyData: Sorting polygons for transparency...
jnorris at uiuc.edu
jnorris at uiuc.edu
Tue Sep 12 14:58:31 EDT 2000
Once upon a time, Will Schroeder wrote:
<snip description of vtkDepthSortPolyData>
> It's not the final answer for fixing transparency since it only sorts
> within a single dataset, and it sorts based on a single position within
> the primitive (first point), i.e., polygon splitting is not performed and
> polygons will occasionally be rendered in the wrong order.
I've been thinking of another approach that addresses some of these problems.
How about if vtkOpenGLPolyDataMapper and vtkMesaPolyDataMapper added vertices,
lines, polygons, and strips to a list of primitives instead of actually
drawing them. Once the vtkOpenGLRenderer has called the Render method of all
the mappers, it uses an instance of a helper class (vtkCellSorter, or
something like that) to sort the primitives. Then it does the rendering.
There could be several classes derived from vtkCellSorter, such as
vtkCellSorterNone and vtkCellSorterDepthSort. New sorting classes could be
added that could split polygons or strips, use different sorting criteria,
etc.
So, is this idea even feasible? I'd be willing to try my hand at this, but it
would be a few months before I could start, and I don't know how long it would
take me. To be frank, I was a little intimidated when I looked at the code
for vtkOpenGLPolyDataMapper.
> Thanks to Scott Hill (a student at RPI) who originally implemented this class.
Thanks Scott! This class is a great help.
John
--
John Norris
Center for Simulation of Advanced Rockets
jnorris at uiuc.edu
http://www.uiuc.edu/ph/www/jnorris
More information about the vtkusers
mailing list