Hi,

I'm using vtkKWEVertexBufferObject, vtkKWEVBOTStripsPainter and
vtkKWERenderingFactory to render a mesh using VBO.
It works great, but when i set the opacity to something different than
1 (let's say 0.5), the rendering becomes slow.
a call to vtkTimerLog::GetElapsedTime gives 0.015 with opacity=1 and
0.4 with opacity=0.5
what is strange is that if i run the app in debug, or attach gDebugger
to the release exe, the rendering is as fast with 1 than 0.5 !

any idea of what is going wrong?

configuration:
Windows7 64bits
Visual Studio 8 32bits
nVidia Quadro 4800 with latest driver
VTK 5.6.1

the mesh is about 500 000 points.

Code:

#define MY_SP(class, variable) vtkSmartPointer<class> variable =
vtkSmartPointer<class>::New();

MY_SP(vtkRenderer, ren1);
ren1->SetBackground(0.22, 0.22, 0.22);

MY_SP(vtkRenderWindow, renWin);
renWin->AddRenderer(ren1);
renWin->SetSize(1024,768);

MY_SP(vtkRenderWindowInteractor, iren);
iren->SetRenderWindow(renWin);
MY_SP(vtkInteractorStyleTrackballCamera, vtk_style);
vtkRenderWindowInteractor* rwi = renWin->GetInteractor();
rwi->SetInteractorStyle(vtk_style);

vtkKWERenderingFactory::RegisterFactory();

MY_SP(vtkXMLPolyDataReader, reader);
reader->SetFileName(filename);
reader->Update();

MY_SP(vtkStripper, stripper);
stripper->SetInputConnection(reader->GetOutputPort());

MY_SP(vtkPolyDataMapper, map1);
map1->SetInputConnection(stripper->GetOutputPort());
map1->ImmediateModeRenderingOn();

MY_SP(vtkActor, act1);
act1->SetMapper(map1);
act1->GetProperty()->SetOpacity(0.5);
ren1->AddActor(act1);

ren1->ResetCamera();
ren1->ResetCameraClippingRange();
iren->Initialize();
renWin->Render();

vtkTimerLog* log = vtkTimerLog::New();
double sum=0.0;
for (int cc=0; cc < 20; cc++)
{
log->StartTimer();

ren1->GetActiveCamera()->Azimuth(9);
renWin->Render();

log->StopTimer();

sum += log->GetElapsedTime();
}

log->Delete();

cout << "Avg Time: " << sum/20.0 << endl;

iren->Start();
_______________________________________________
VtkEdge mailing list
[email protected]
http://public.kitware.com/cgi-bin/mailman/listinfo/vtkedge

Reply via email to