[vtkusers] Re: Scalar color / LookupTable / Interpolation problem...

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Tue May 4 19:20:14 EDT 2004


Hi Ingo,

> All I do is:
> - SetPixelFormat to PFD_TYPE_COLORINDEX
> - Generate a palette for the DC
> - use glIndex
> I am not so deep into VTK... But the changes cannot be that much ?
> I don't know the reaction with other features, like blending and other
> stuff...
The changes are conceptually simple but will be quite major in practice,
for example vtkOpenGLPolyDataMapper is ~3000 lines of code with calls to
glColor all through it. The connections between a scalar value, a
vtkLookupTable, a palette and a glIndex will need some thought. Ideally the
changes would be platform independant (even non-OpenGL?). It probably needs
some careful testing to see how it interacts with other OpenGL and vtk
features (textures etc) before deciding it is a good solution.

> > It seems that VTK uses its LookupTables only for determining the colors
of the
> > cell corners, but does not share this information with OpenGL, and
therefore
> > the interior of the cells is rendered by interpolation the RGBA values
of the
> > corners.
> This fakes the shown results and is not acceptable in my opinion...
> Like, I have a value in my color table which is by coincident the same
color
> as the rgba interpolation between two edges, but has some complete
different
> value...
Yes this is a fundamental issue, vtk uses colour to convey information in
serious applications. Use of glIndex seems to be the right way to solve the
problem. To avoid breaking lots of existing tests and applications it might
have to be done as an optional change from the current behaviour which
would remain the default? I propose you make an official 'feature request'
in the vtk bug tracking system.

  regards
   Dave P





More information about the vtkusers mailing list