[vtk-developers] vtkClipPlanesPainter

Moreland, Kenneth kmorel at sandia.gov
Tue Feb 6 15:31:28 EST 2007


> FYI. I just wanted to render into a FrameBufferObject with the clip
> planes set specially for an effect, then use the FrameBuffer as the
> input to another process. I had hoped to make use of the Painters to
> make life easier

A while ago I was trying to do what you described.  I had a simple
multi-pass rendering algorithm that rendered geometry to a frame buffer
and then performed a mathematical operation on the values in the buffer.
My initial design was to have a painter with two delegates.  It would
have one delegate that rendered to a frame buffer object, and then
render the other delegate using the FBO as an input texture.

The problem with the design was that it required switching a lot of the
state for each of the two delegates.  Each rendering pass required
different geometry and different shaders.  I got it working, but the
final code was unsatisfactory in that I had to make so many "hacks" to
get it working that it lost its reusability.

On a second pass, I tried encapsulating each pass in an actor.  Each
actor contained the geometry, shaders, and other rendering properties
needed for a single pass.  One actor had a special painter added to it
that rendered to an FBO, and the texture for that FBO was set as the
texture for another actor.  The actors were placed together in a
vtkPropAssembly in such a way that they would be rendered in the correct
order.  All the pieces were nice and general purpose, but the setup was
so complicated that I cringe at the thought of trying to explain it all.

In short, painters might help you implement a multi-pass algorithm, but
they probably won't get you all the way.  Surely there must be a better
mechanism for setting up multi-pass algorithms, but I have not thought
of one.

-Ken




More information about the vtk-developers mailing list