[vtkusers] Hardware offscreen rendering (and its possible use for the Java wrappers)

Luke Dodd luke.dodd at gmail.com
Wed Oct 19 10:53:40 EDT 2011


Hi,

It seems that hardware (NOT mesa) based offscreen rendering is not
supported in VTK. But the existence
vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow method, and my
personal experience with using OpenGL frame buffers make me think it
really shouldn't be so hard to achieve. Of course the aforementioned
methods are protected so I'm not sure how or if I'm supposed to go
about using them (inheriting from vtkOpenGLRenderWindow doesn't seem
like something I'm supposed to do). Also I think if it were actually
easy to achieve then it would have already been done.

The reason I'm thinking about this is that decent hardware offscreen
rendering I think it could be easy to implement a vtk panel in java
that uses offscreen rendering, and standard java 2D graphics API to
put that offscreen image onscreen. It sounds convoluted but it would
skip all the hassle with lightweight vs heavyweight components,
eliminate the need for the extra JNI code the vtkPanel currently uses,
and the vtkRenderWindow leaks that currently occur under Linux. I just
did a quick test, and it seems to me, that reading glReadPixels does
work fast enough for this to be possible unless one needs really high
frame rates.

So I'm asking: is this possible with standard VTK? Would this be
possible with a few tweaks? Am I missing some great complication when
I think it shouldn't be hard to implement? And finally anyone else
interested in this?

Best,
Luke Dodd



More information about the vtkusers mailing list