[Paraview] Performance using ImmediateModeRenderingOff in pure vtk vs. Paraview

Max Schoebinger m.schoebinger at dkfz-heidelberg.de
Tue Sep 20 11:28:30 EDT 2005


Hallo,

thanks for your quick reply. Your comment is right, but what i observed 
implies, that there must be some implementation/parameterization issue 
influencing performance besides immediate mode rendering.

If I disable immediate mode rendering in paraview it behaves 10 times 
faster as my pure vtk example where immediate mode rendering is also 
off. So there must be an additional switch or trick which improves 
rendering preformance in paraview when immediate mode rendering is 
disabled...

Thanks,

Max


Mattijs Janssens wrote:
>  From what I remember from 3D graphics:
> 
> immediate mode rendering:render the primitives straight from the main 
> memory.
> non-immediate mode rendering: build a display list (kept in the graphics 
> card memory). Is faster except when the list does not fit in the 
> graphics memory. Also has to be rebuilt if any of the (properties of 
> the) primitives changes.
> 
> So depending on your graphics card memory and also whether it natively 
> supports opacity there might be big differences in performance between 
> the two modes and between graphics cards.
> 
> Max Schoebinger wrote:
> 
>> Hello,
>>
>> In our lab we have a home grown vtk/itk based application framework 
>> for medical applications. I discovered a performance problem while 
>> working with Triangular meshes loaded from STL-Files. If the 
>> vtkProperties change (e.g. opacity), each rendering update takes 
>> extremely long (>10s). Using paraview, updates are possible at 
>> interactive speed (<0.5s). I tracked down the problem to a minimal 
>> example only using pure vtk (see attachment) and discovered, that in 
>> the function vtkOpenGLPolyDataMapper::RenderPiece(...) new display 
>> lists are generated each time the properties of the actor have been 
>> modified. This is not the case, if ImmediateModeRendering is on. So my 
>> situation is: if ImmideateModeRendering is on, everything works as 
>> fast as expected, if ImmediateModeRendering is off, rendering updates 
>> are is really slow.
>>
>> Now my question: how is rendering in paraview organized (optimized)? 
>> The render updates at opacity changes are always fast, no matter if 
>> ImmediateModeRendering is on or off.
>>
>> Some Notes:
>>
>> I am working on a laptop (2Ghz Pentium M, 2Gb RAM) under windows xp 
>> service pack 2.
>> My Compiler is Visual Studio .NET 2002
>> My graphics card is an ATI Mobility Radeon X600 with 128 MB RAM.
>> I am using the latest driver for the graphics adapter.
>> The STL-File I am working with has 30947 points and 61818 cells.
>> The problem does not appear on NVidia graphics adapters.
>>
>> Thanks for any hints,
>>
>> Max
>>
>>
>> ------------------------------------------------------------------------
>>
>> #include "vtkSTLReader.h"
>> #include "vtkPolyDataMapper.h"
>> #include "vtkRenderWindow.h"
>> #include "vtkCamera.h"
>> #include "vtkActor.h"
>> #include "vtkRenderer.h"
>> #include "vtkProperty.h"
>> #include "vtkMapper.h"
>>
>> int main( int argc, char *argv[] )
>> {
>>   vtkSTLReader* reader = vtkSTLReader::New();
>>   reader->SetFileName("model.stl");
>>   reader->Update();
>>
>>   vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
>>   mapper->SetInput( reader->GetOutput() );
>>
>>   vtkActor* actor = vtkActor::New();
>>   actor->SetMapper(mapper);
>>
>>   vtkRenderer* renderer= vtkRenderer::New();
>>   renderer->AddActor( actor );
>>
>>   vtkRenderWindow* renderWindow = vtkRenderWindow::New();
>>   renderWindow->AddRenderer( renderer );
>>   renderWindow->SetSize( 300, 300 );
>>
>>   //
>>   // if immediate mode rendering is off evereything is very slow
>>   //
>>   //vtkMapper::GlobalImmediateModeRenderingOn();
>>
>>   for (double opacity = 1.0; opacity >= 0.0; opacity-=0.1)
>>   {
>>     actor->GetProperty()->SetOpacity(opacity);
>>     renderWindow->Render();
>>   }
>>   return 0;
>> }
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
> 
> 
> Kind regards,
> 
> Mattijs
> 


-- 
Dipl.-Inform. Med. Max Schöbinger
Deutsches Krebsforschungszentrum       (German Cancer Research Center)
Div. Medical & Biological Informatics          Tel: (+49) 6221-42 2370
Im Neuenheimer Feld 280                        Fax: (+49) 6221-42 2345
D-69120 Heidelberg                       E-Mail: M.Schoebinger at dkfz.de


More information about the ParaView mailing list