[vtkusers] Performance issues with large set of actors

Tarjei Knapstad tarjeik at chemcon.no
Mon Mar 31 11:21:59 EST 2003


On Mon, 2003-03-31 at 10:56, Jean M. Favre wrote:
> Tarjei Knapstad wrote:
> > 
> > I just tried visualizing about 5000 points as spheres, using a single
> > vtkSphereSource, a single vtkPolyDataMapper and creating and positioning
> > one vtkActor for each point.
> > 
> > Interaction was almost impossible,
> 
> Looks like you are doing some chemistry stuff. 

That's correct.

> I don't understand why
> you have "one actor per point". You did not mention a vtkGlyph3D? I do
> similar stuff and here is my pipeline:
> 
> vtkSphereSource   sphere
> vtkGlyph3D        glyph
> vtkPolyDataMapper mapper1
> vtkLODActor       actor1  // to display atoms
> 
Thanks, I wasn't aware of Glyph3D and LODActor until now. LOD makes
things a lot more bearable, but it still consumes huge amounts of memory
(see end).

I've also got a molecular editor though, and there I need one actor for
each atom/bond to be able to do picking and iteract properly with the
underlying molecular structure (a graph inherited from the Boost Graph
Library). I've currently solved this by inheriting from vtkActor (will
be changed to LODActor now) like this:

                              vtkBondActor
                             /
vtkActor <- vtkChemistryActor
                             \
                              vtkAtomActor

The Bond and Atom actor both keep a reference to the associated
atom/bond in the underlying graph, and the Atom actor also keeps
pointers to the connected Bond actors so that those can keep up when 
an Atom actor is moved. Maybe this is not the best solution, but as far
as I can see I need to create separate actors to be able to interact
through picking?

> vtkTubeFilter     tube
> vtkPolyDataMapper mapper2
> vtkLODActor       actor2  // to display chemical bonds
> 
> With only 2 LOD actors, I manage to interact in real-time and to do
> sub-second full-size rendering of molecular models of 16000 atoms and
> bonds on a GeForce4 card.
> 
Currently I'm working on older hardware with a GeForce2 Ti card, so a
hardware upgrade will certainly give huge increases in performance.

> I suggest you review if you really need one actor per point.
> 
I see now that I don't for the pure visualization part, but I still
think I need one actor per atom/bond for my editor? Or is there maybe
some more efficient way to do the picking/interaction part that I've
missed?

In any case, the memory consumption is still very large. Do you get
similar results, or am I possibly doing something wrong/suboptimal
still? I get about an 80MB increase in memory consumption when viewing a
molecule of roughly 6000 atoms and 6000 bonds (hemoglobin), compared to
a very small molecule like benzene.

Thanks again for the tips.

Regards,
--
Tarjei




More information about the vtkusers mailing list