[vtkusers] off-screen rendering in java

Kevin H. Hobbs kevin.hobbs.1 at ohiou.edu
Tue May 16 08:23:57 EDT 2006


On Mon, 2006-05-15 at 18:22 +0200, N. Yang wrote:
> Dear all,
> 
> it is said that vtk supports off-screen rendering by using Mesa
> library(e.g. vtkMesaRenderWindow). 

It does.

> is this possible in Java? i mean, if
> vtk is compiled to support Mesa, will there be wrapper classes like
> vtkMesaRenderWindow for java? 

There should be, I've heard that some classes are not wrapped to every
language, but the easiest way to find out is to try.

> it not, what is the solution of off-screen
> rendering in java?
> thank you.
> 
> regards
> 
> Jerry

I was just helped to an understanding of how the offscreen classes are
supposed to work. You must use mangled mesa. You must tell the graphics
and imaging factories, that you intend to use offscreen rendering. To do
this in C++ you just need to include vtkGraphicsFactory.h and
vtkImagingFactory.h. Then at the top of your code :

	// Graphics Factory
	vtkGraphicsFactory * graphics_factory 
		= vtkGraphicsFactory::New();
	graphics_factory->SetOffScreenOnlyMode( 1 );
	graphics_factory->SetUseMesaClasses( 1 );

	// Imaging Factory
	vtkImagingFactory * imaging_factory 
		= vtkImagingFactory::New();
	imaging_factory->SetUseMesaClasses( 1 );

Do not use vtkXMesaRenderWindow and friends directly use
vtkRenderWindow and friends. The factories take care of the OpenGL/Mesa
backend. I also do SetOffScreenRendering( 1 ); on all of my render
windows. I don't know if it's necessary, but I seem to have it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060516/2bd0d798/attachment.pgp>


More information about the vtkusers mailing list