Login  Register

Re: Java3D in batch mode

Posted by ThomasR on Feb 24, 2019; 6:42pm
URL: https://forum.jogamp.org/Java3D-in-batch-mode-tp4039415p4039558.html

philjord wrote
Tom,

Sorry for misunderstanding I thought you were able to create the Canvas3D and were just discussing the off screen options.

I see now that you have a GPU card but the OS is not letting the windowed elements instantiate for some reason.

I presume you've knocked together a test app and run it and got some sort of exception thrown, can you provide that?

Is it that anything that extends java.awt.Component will not run at all? You can't even instantiate and get doNotify() called on a trivial JPanel?

Or are you getting something like a headless exception from Java3D; which (if the AWT part works) might just be an overly enthusiastic sanity test in Java3D we can disable.
Our system can run interactive or w/o instantiating any AWT windows/component. My guess is that Java3D just can't work w/o a physical display plugged into a port on the machine. Maybe this is a AWT limitation? I modified your code to only try to create an offscreen Canvas3D:

Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation
which requires it.
     at
sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:77)
     at MyOffScreen.createOffScreenCanvas(MyOffScreen.java:51)
     at MyOffScreen.<init>(MyOffScreen.java:77)
     at MyOffScreen.main(MyOffScreen.java:118)

philjord wrote
If it is the case that you can't get anything in java.awt.* to run at all then we could look at my extension. In order for it to be a viable option you'd need to confirm that GLWindow.create(new GLCapabilities(null)) from Jogl 2.3.2 will return a working GLWindow, if so we could discuss my extension further.

Depending on how you are using Java3D you may or may not be familiar with the underlying Jogl system, if you aren't I can point you to some simple test to confirm it's status on your machine.
Can you provide this test code? I will try to create a GLWindow as you suggest above when I'm back in the office.

philjord wrote
And finally no worries about the code snippet, it actually took only a few moments to write. It took me a long time to answer your post as I went down a rabbit hole trying to understand how an on-screen and off-screen Canvas3D can interoperate together with a Raster in a manner that gets the raster updated without any race conditions (I can report that it is complex).
Phil.
Kudos finding your way out! If memory serves we invoke renderOffscreenBuffer and grab the image in Canvas3D.postSwap.

Tom