[vtkusers] Need help for Offscreen rendering

Dov Mayzlish dov.mayzlish at philips.com
Tue Sep 4 07:31:35 EDT 2007



Hi,

I'm using vtk to render a scene into a buffer, which is then processed and
viewed interactively (i.e. zoom/pan/rotate) by my application.

While onscreen rendering is fast enough for my scene, when I set the
OffScreenRendering to 'On', rendering process is slow. I believe that
Offscreen rendering doesn't use graphics hardware acceleration, and cpu is
obviously slower.

Apparenty, when I use onscreen rendering, the WindowToImageFilter does
generate the image to the buffer (provided the vtk viewport is fully on the
screen). In this situation the rendering is fast and I get the image to my
buffer fast, but I am stuck with additional window (vtk viewport) on my
screen.

Is there a possibility to define Off-Screen rendering to use hardware
acceleration instead of cpu?
A sample of the code is attached at the bottom of the messege.

Thanks,
Dov

------------------------------------------------------
      this->renWin = vtkRenderWindow::New();
      this->renWin->OffScreenRenderingOn();
      this->renWin->AddRenderer(this->ren);
      this->ren = vtkRenderer::New();
      this->w2if = vtkWindowToImageFilter::New();
      this->w2if->SetInput(renWin);


      ......
      this->renWin->Render();
      this->w2if->Modified();
      this->w2if->Update();

      unsigned char *data = (unsigned char*)
w2if->GetOutput()->GetScalarPointer(0,0,0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070904/5db1816e/attachment.htm>


More information about the vtkusers mailing list