[vtkusers] VTK6 + Java7 on Mac: offscreen rendering?

Sebastien Jourdain sebastien.jourdain at kitware.com
Mon Sep 9 08:45:41 EDT 2013


Hi Marco,

you won't be able to rely on offscreen rendering on Mac to properly handle
the issue you are trying to overcome.

Although, a couple of weeks ago, I've pushed a new set of classes that
works on Mac OS X and Java7 (and on the other of the platforms).
Those classes rely on JOGL to do the rendering. So if adding JOGL as a
dependency is not an issue, you can directly use those.

For that you will need to get VTK/master from git and when you build VTK,
you will have to turn ON that component. Moreover if you already download
JOGL/GLUGEN using maven, CMake should find the appropriate jars for you.
Otherwise you will need to specify their paths.

Here is the dependency for Maven.

+                <dependency>
+                    <groupId>org.jogamp.jogl</groupId>
+                    <artifactId>jogl-all-main</artifactId>
+                    <version>2.0.2</version>
+                </dependency>
+                <dependency>
+                    <groupId>org.jogamp.gluegen</groupId>
+                    <artifactId>gluegen-rt-main</artifactId>
+                    <version>2.0.2</version>
+                </dependency>

Hope that could help you,

Seb



On Mon, Sep 9, 2013 at 7:22 AM, Marco Sambin <m.sambin at gmail.com> wrote:

> Dear VTKers,
>
> I am developing a VTK 6-based Java application, and I am making some
> efforts to make it compatible with Mac OS X as well.
>
> I know that the jawt embedding currently supported by Java 7 on Mac (which
> is CALayer-based) does not work with VTK 6 (nor with previous VTK
> versions), but there are several portions of my application which do not
> use direct drawing by VTK classes to Java panels (i.e., do not use jawt),
> hence will work fine on Mac + Java 7 as well.
>
> Now, for the portions of my application where VTK classes need to actually
> "draw", my question is: will offscreen rendering work on Mac? The basic
> idea would be to grab the output of the offscreen rendering, convert it to
> a Java-compatible image, and draw it to a Java panel. I know this will be a
> significant performance penalty, but my requirements in this moment are not
> so strict or demanding under this point of view.
>
> In particular, I have a vtkCanvas-derived panel, where I display some
> planes in 3D (actually, they are vtkImagePlaneWidgets, but I am mainly
> interested in the "display" functionality, not in the interactivity of the
> widget with the user). Will it be sufficient to call
> myVtkCanvas.GetRenderWindow().SetOffScreenRendering(1) to obtain offscreen
> rendering on my Mac? Or it is more complicated than that?
>
> Currently, calling just
> myVtkCanvas.GetRenderWindow().SetOffScreenRendering(1), I am obtaining a
> crash in the OpenGL library when running my application on the Mac.
>
> Thanks in advance for your feedback.
>
> Best regards,
>
> Marco
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130909/2b22e123/attachment.htm>


More information about the vtkusers mailing list