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

Mattijs Janssens m.janssens at opencfd.co.uk
Tue Sep 20 10:33:47 EDT 2005


 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

-- 

Mattijs Janssens

OpenCFD Ltd.
The Mews, Picketts Lodge,
Picketts Lane, Salfords,
Surrey RH1 5RG.
Tel: +44 (0)1293 821272
Email: M.Janssens at OpenCFD.co.uk
URL: http://www.OpenCFD.co.uk


More information about the ParaView mailing list