[vtkusers] Need help for Offscreen rendering

Cory Quammen cquammen at cs.unc.edu
Tue Sep 4 10:02:30 EDT 2007


Dov,

What version of VTK are you using? Support for hardware-accelerated
offscreen rendering was added within the last year. Your graphics
hardware must support framebuffer objects to use it, otherwise VTK
will revert to software offscreen rendering. What  graphics card are
you using?

Cheers,
Cory

On 9/4/07, Dov Mayzlish <dov.mayzlish at philips.com> wrote:
>
>
> 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);
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen



More information about the vtkusers mailing list