[vtkusers] Visual Studio CLR makes VTK really slow ...

Joseph Melnyk JMelnyk at pile.com
Thu Feb 24 07:40:22 EST 2011


I've done something similar: CLR (by way of C++/CLI) to interface with native C++ vtk, create a DLL from this and link it into a .NET windows form.  Within the DLL, I'm simply assigning the vtk RenderWindows to passed-in .NET PictureBox controls, however.  What is this vtkPanel that you mention?

I'm getting frame rates close to what you mention (80-100 fps), but this could simply be my application, machine, etc.  I've not tested these various other scenarios to see if it improves/degrades otherwise.


From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Frederic DANESI

We came accross something weird when using Visual Studio CLR.

We have created a very simple VTK pipeline (load a STL file => render => move the camera around while taking screen shots).
Those operation are integrated in a vtkPanel, build as a C++ DLL.

When using this DLL in a console application (with the VTK default RenderWindow), we get a framerate of 100 fps.
When using this DLL in a winform application (Visual Studio 6,MFC, no CLR), we get the same framerate.

When using this DLL in a .Net Windows Form (Visual Studio 10, CLR) we get a framerate of 26 fps, which is not acceptable.
(Obvisously, if we use directly the VTK classes inside the CLR project without building a library, the framerate is even worse : 6 fps).

Does anyone have knowledge about using VTK inside a CLR application without such a loss of performance ? Are we missing something ?

__Scanned by MessageLabs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110224/7f124a59/attachment.htm>


More information about the vtkusers mailing list