[vtkusers] Improving rendering speed

N Smethurst nick.smethurst at free.fr
Sat Jun 14 18:44:58 EDT 2003


Hi there..

It's not a solution but merely an sympathy observation: I had and still 
have a similar problem with my surface plots. By missing out various 
stages of the pipeline, I found that the main cause of my slow down was 
the normals calculation. Howeverm I didn't get the kind of slowdown that 
you have experienced (22801 points takes 2 seconds, 160801 points takes 30 
seconds on an Athlon1400). You are using other filters, so they may be 
slowing your first render down more. I have no idea whether this is an 
issue with VTK or whether these calculations are just computationally 
intensive.

It's interesting to note that the 160801 point calculation has 
160801/22801=7.05 time as many points but takes 30/2=15 times longer to 
execute. It's similar with your figures: 76000/8000=9.5 times as many 
points, but 240/15=16 times as much time.

Le Samedi 14 Juin 2003 15:38, Ajit Rajwadé a écrit :
> Hello,
>
> I need some tips for improving rendering speed. I am rendering a 3D
> surface (from 8000 points) and it takes 15 seconds for the Render
> routine. Is this merely a hardware problem?
>
> Here is what I am doing:
>
> (ren is the vtkRenderer and renWin is the vtkRenderWindow - the call
> "renWin->Render" takes ages. I am using the triangle strips as well, as
> somebody had suggested. I have another model which consists of 76000
> points and the whole thing takes 4 minutes to render. I am fully
> optimizing my code.)
>
> // Create a data set. Load the starting points
> vtkPolyData *inputDataSet = vtkPolyData::New();
> inputDataSet->SetPoints(meanPoints);
>
> 	// Construct the surface
>    vtkSurfaceReconstructionFilter *surf =
> vtkSurfaceReconstructionFilter::New();
> surf->SetInput(inputDataSet);
>
>
>    // Create isosurface
> vtkContourFilter *cf = vtkContourFilter::New();
>   cf->SetInput(surf->GetOutput());
>   cf->SetValue(0,0.0);
>   cout << "Isosurface construction done..." << endl;
>
> vtkPolyDataNormals *bNormals = vtkPolyDataNormals::New();
>   bNormals->SetInput(cf ->GetOutput());
>     bNormals->SetFeatureAngle(60.0);
>
>   vtkStripper *bStripper = vtkStripper::New();
>     bStripper->SetInput(bNormals->GetOutput());
>
> vtkPolyDataMapper *map = vtkPolyDataMapper::New();
> map->SetInput(bStripper->GetOutput());
> map->ScalarVisibilityOff();
>
> vtkActor *surfaceActor = vtkActor::New();
>    surfaceActor->SetMapper( map );
>
> ren->AddActor(surfaceActor);
>    ren->SetBackground(1,1,1);
>
>
> printf ("\nBefore the Rendering");
> renWin->Render();
>   printf ("\nRendering done...");
>




More information about the vtkusers mailing list