[vtkusers] Need help for Offscreen rendering

Francois Bertel francois.bertel at kitware.com
Tue Sep 4 10:30:44 EDT 2007


Hi Dov,


The current CVS version has this feature and it is used automatically if the GPU can do it. The algorithm uses the following OpenGL extensions:

1. GL_EXT_framebuffer_object
2a. GL_ARB_texture_non_power_of_two or OpenGL>=2.0
2b. GL_ARB_texture_rectangle


* Extension 1 is required.
* 2a or 2b is required.
* At runtime, even if extension 2a is present, your card may not support non power of two textures in a framebuffer object. In this failing case, the algorithm try to use a rectangle texture if extension 2b exists.
If extension 2b does not exist, regular slow offscreen rendering is used.

To check the available extensions on your system:

* Under Linux, check the list of extensions with command line
* Under MacOSX, with Xcode installed, Macintosh HD->Developer->Applications->Graphic Tools->OpenGL Driver Monitor.app->Monitors->Renderer Info-><name of the OpenGL driver>->OpenGL Extensions
* Under Windows, you can download and use GLview http://www.realtech-vr.com/glview


Dov Mayzlish 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


-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list