[vtkusers] Rendering a large number of actors
Ragnarok
mat930121 at hotmail.com
Thu May 7 13:06:58 EDT 2015
Simple example of the problem.
// Code to create the actors
vtkSmartPointer<vtkActor> actorArray[10];
vtkSmartPointer<vtkConeSource> coneSource =
vtkSmartPointer<vtkConeSource>::New();
coneSource ->Update();
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(arrowSource->GetOutputPort());
vtkSmartPointer<vtkPropAssembly> propAssembly =
vtkSmartPointer<vtkPropAssembly>::New();
for (int i = 0; i < 1000; i++)
{
vtkSmartPointer<vtkActor>coneActor =
vtkSmartPointer<vtkActor>::New();
coneActor ->SetMapper(mapper);
actorArray[i] = coneActor ;
propAssembly->AddPart(coneActor);
}
// rendering stuff
...
//if I do this, I get 5 fps
renderer->AddViewProp(propAssembly);
//if I do this, I get 30 fps
for (int i = 0; i < 1000; i++)
{
renderer->AddActor(actorArray[i])
}
// If I do this, I get 5 fps
for (int i = 0; i < 1000; i++)
{
renderer->AddViewProp(actorArray[i])
}
How is it that the Addviewprop(propAssembly) is way slower than indivually
adding all the actors in my renderer? I thought the purpose of the
VtkpropAssembly was to group all elements to make the rendring speed way
faster.
Is there any other better way to gain speed?
--
View this message in context: http://vtk.1045678.n5.nabble.com/Rendering-a-large-number-of-actors-tp5731814p5731817.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list