[vtkusers] Slow Performance with 2K actors (*.obj file)

Sonya Blade sonyablade2010 at hotmail.com
Tue Jun 17 02:13:08 EDT 2014


Hi All,Instructions given for how to efficiently handle large dataset at the official wiki page doesn't contribute much to the speed improvement in my case, thatmeans that it's somehow boils down to the fact that I shouldn't create many actors. 
Instead group the object which may fit into a specific actor( I shapes, S shapes, U shapes etc..),the best method that comes in mind is that. But I don't know exactly how to insert each individual polydata into the very same actor, all the examples use the seperate mapper, actors for this.
There is not an example for inserting many polydata into a single actor, 
I'll appreciate your help,
Regards,From: sonyablade2010 at hotmail.com
To: vtk at calculoandamios.com; dlrdave at aol.com; vtkusers at vtk.org
Date: Mon, 16 Jun 2014 13:01:52 +0100
Subject: Re: [vtkusers] Slow Performance with 2K actors (*.obj file)




I can not guarantee that all the actors will have the same geometry, the loaded shape was just for the testing purposes, in any case it'll completely depend on end-user input. AFAIK there are even better techniques if geometry is identical such as impostor, proxy object in OpenGL. 
I'm trying to follow the instructions given here http://www.cmake.org/Wiki/index.php?title=VTK/FAQ&redirect=no#VTK_is_slow.2C_what_is_wrong.3F (FAQ/How to handle large data sets in VTK, )
It mentions that "By default VTK keeps a copy of all intermediate results between filters in a pipeline" which is quite unnecessary for my case. In order to switch it off I should have vtkPolyDataReader so later on I can apply the following statement in order to test the performance.
// C++ vtkPolyDataReader *reader = vtkPolyDataReader::New(); reader->GetOutput()->ReleaseDataFlagOn();
The glitch here is: I do have ObjReader instead of vtkPolyReader, vtkPOlyReader doesn't load the *.obj file,in order to eliminate that do I have to load the obj file with ObjReader and copy it to the PolyReader ? If so how can I do it?
Regards,
From: VTK at calculoandamios.com
To: sonyablade2010 at hotmail.com; dlrdave at aol.com; vtkusers at vtk.org
Subject: RE: [vtkusers] Slow Performance with 2K actors (*.obj file)
Date: Mon, 16 Jun 2014 13:25:02 +0200

If all the actors have the same geometry, then you can use Shallowcopies (actor.ShallowCopy ) in a way similar to:   // Visualize  vtkSmartPointer<vtkPolyDataMapper> mapper =    vtkSmartPointer<vtkPolyDataMapper>::New();  mapper->SetInputConnection(reader->GetOutputPort());   vtkSmartPointer<vtkActor> actor =    vtkSmartPointer<vtkActor>::New();  actor->SetMapper(mapper);   renderer->AddActor(actor); for (int i=0;i<2000;i++){  vtkSmartPointer<vtkActor> actor2 =    vtkSmartPointer<vtkActor>::New();   actor2->ShallowCopy(actor);   renderer->AddActor(actor2);}  This will reduce both the time of loading as the polydata and the mapper are created only once and also it will improve the interaction experience.There are only some parameters that can be change, like position or orientation but not the geometry in the new actors.   Regards, Carlos De: vtkusers [mailto:vtkusers-bounces at vtk.org] En nombre de Sonya Blade
Enviado el: lunes, 16 de junio de 2014 8:09
Para: David Cole; vtkusers at vtk.org
Asunto: Re: [vtkusers] Slow Performance with 2K actors (*.obj file) Ok thanks David for entry point, Probably construing the scene from many actors was not a good idea if you look at it from VTK side,but due to the design architecture I should have each object as a seperate entity which might have the the supplied *.obj shape or any other arbitrary shape provided by end-user and those shapes should be interactable, modifiable, etc  If it wasn't AddActor() proc then what other methods I can use for that ? Regards,
> To: sonyablade2010 at hotmail.com; vtkusers at vtk.org
> Subject: Re: [vtkusers] Slow Performance with 2K actors (*.obj file)
> From: dlrdave at aol.com
> Date: Sun, 15 Jun 2014 08:01:59 -0400
> 
> You should probably only have 10s or 100s of actors in any given 
> renderer. 1000s or more *actor* objects are known to be slow.
> 
> Unless somebody else chimes in and contradicts me, with a speed up 
> hint, it's probably best to restructure your code to use fewer actors.
> 
> 
> HTH,
> David C.
>  		 	   		  

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140617/16698437/attachment.html>


More information about the vtkusers mailing list