Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing 3D Viewer window can throw an exception #15

Open
ctrueden opened this issue Dec 4, 2015 · 16 comments
Open

Resizing 3D Viewer window can throw an exception #15

ctrueden opened this issue Dec 4, 2015 · 16 comments
Labels

Comments

@ctrueden
Copy link
Member

ctrueden commented Dec 4, 2015

When using the Java-8 update site, resizing the 3D Viewer window leads to:

com.jogamp.opengl.GLException: detachAllImpl failed: FBO implementation fault, FBO[name r/w 1/1, init true, bound true, size 814x830, samples 0/8, modified true/true, depth RenderAttachment[type DEPTH, format 0x81a5, samples 0, 814x830, name 0xffffffff, obj 0x631efb05], stencil null, colorbuffer attachments: 1/8, with 1 textures: [TextureAttachment[type COLOR_TEXTURE, target GL_TEXTURE_2D, level 0, format 0x8051, 814x830, border 0, dataFormat 0x1907, dataType 0x1401; min/mag 0x2600/0x2600, wrap S/T 0x812f/0x812f; name 0xffffffff, obj 0xd24d2a0], null, null, null, null, null, null, null], msaa[null, hasSink false, dirty true], state FBO implementation fault, obj 0x48049414]
    at com.jogamp.opengl.FBObject.detachAllImpl(FBObject.java:2198)
    at com.jogamp.opengl.FBObject.reset(FBObject.java:1139)
    at org.scijava.java3d.JoglPipeline.resizeOffscreenLayer(JoglPipeline.java:6290)
    at org.scijava.java3d.Canvas3D.setViewport(Canvas3D.java:4864)
    at org.scijava.java3d.Renderer.doWork(Renderer.java:993)
    at org.scijava.java3d.J3dThread.run(J3dThread.java:271)

At least, I am able to reproduce consistently on my system using the T1 Head sample:

OS X 10.11.1 El Capitan
Model Name: MacBook Pro
Model Identifier: MacBookPro11,5
Processor Name: Intel Core i7
Processor Speed: 2.5 GHz

Both Java versions 1.7.0_80 and 1.8.0_66 exhibit the issue. So it is probably a bug in Java 3D 1.6 and/or JOGL.

I tried to create an MCVE based on the "Test Java3D" plugin from VIB, but was unable to reproduce the issue with a simple scene.

See also this thread on the ImageJ mailing list.

@ctrueden
Copy link
Member Author

ctrueden commented Jan 4, 2016

@gouessej FYI. I will try to track down more details and file a formal bug report and/or patch once I do so. But it probably will not be until February or March, unfortunately.

@ghost
Copy link

ghost commented Jan 4, 2016

Thanks. There is no hurry.

@rogersher
Copy link

I am having the same trouble. When I use Fiji 3D viewer I can rotate the image and zoom in with the mouse wheel, but as soon as I try to resize the 3D viewer window or change the background color, the program freezes. I can still click between open FIJI windows but none of them respond to anything. I need to force quit the application everytime.

@hinerm
Copy link
Member

hinerm commented Apr 1, 2016

see also

@tinevez
Copy link
Member

tinevez commented Apr 2, 2016

This issue is specific to MacOSX. I cannot reproduce it with Windows.

@ctrueden
Copy link
Member Author

On Linux, resizing the window crashed Java. 👎

@mani-mota
Copy link

Can confirm this behavior on OSX 10.11.5, Java 8, GTX950

Any progress on this? Does anyone have a workaround?

@ctrueden
Copy link
Member Author

ctrueden commented Aug 3, 2016

@mani-mota Sorry, I know of no workaround.

You could, however, try ClearVolume and/or the new ThreeDViewer prototype. These are certainly the directions 3D viz in ImageJ is going.

@richardwcole
Copy link

I am now getting the following error

version = 1.5
Exception occurred in RenderingErrorListener:
java.lang.RuntimeException
at ij3d.ImageWindow3D$ErrorListener.errorOccurred(ImageWindow3D.java:330)
at javax.media.j3d.VirtualUniverse.notifyRenderingErrorListeners(VirtualUniverse.java:1329)
at javax.media.j3d.NotificationThread.processNotifications(NotificationThread.java:90)
at javax.media.j3d.NotificationThread.run(NotificationThread.java:107)
nFrames = 1

Same test data set that has worked in the past

@ctrueden
Copy link
Member Author

ctrueden commented Aug 29, 2016

@richardwcole That error means you are using Java 3D 1.5 (i.e., the old Java 3D), but running Java 8. On many systems, these two technologies cannot be combined.

For details, see this page:

In short, you can either: A) use Java 3D 1.5 + Java 6; or B) use the new Java 3D 1.6 + Java 8.

@tinevez
Copy link
Member

tinevez commented Aug 29, 2016

Groumph I checked and indeed it does not work from a Fiji.app application.

I thought it worked fine at least on windows because I can get it to work from Eclipse, where I develope:
screenshot

@ctrueden
Copy link
Member Author

ctrueden commented May 2, 2018

I can no longer reproduce this on my macOS 10.13.4 machine with Java 1.8.0_172. Could those affected (@rogersher @mani-mota et. al) please download a fresh Fiji and test again and report back on whether the issue is resolved for you?

@Stephy43
Copy link

@ctrueden did you ever find a solution for the resizing on linux? I'm using a VNC to connect to our analytical machine (linux) and if I resize the VNC window when Fiji has an image open, it crashes Fiji :(
Any tips?

@ctrueden
Copy link
Member Author

@Stephy43 I'm sorry, I don't have a real solution. And I was wrong about not being able to reproduce on macOS—it does happen still, I think it's a race condition triggering when two resizes occur in rapid succession.

I discovered that on macOS, the following Groovy script can be used to resize the window without it crashing:

viewers = java.awt.Window.getWindows().findAll{w -> w.getTitle().contains("3D Viewer")}
viewers.each{w -> w.setSize(new java.awt.Dimension((int) w.getWidth(), (int) (w.getHeight() - 1)))}

(The w.getWidth() and w.getHeight() - 1 could be anything you want.)

You could give this a try in your Linux VNC session and see if it helps.

@ctrueden
Copy link
Member Author

ctrueden commented May 24, 2018

One thing I just noticed: @philjord, the current maintainer of the JOGL Java 3D fork, fixed a bunch of things ~1 year after I packaged up the java3d code for ImageJ. I have not tested those changes yet, and will not have time to do so before mid-June. In the meantime, you could clone https://github.com/philjord/java3d-core and build the dev1.7.0 branch (mvn package) and see if the new artifact makes any difference.

@ghost
Copy link

ghost commented Jun 5, 2018

@ctrueden I remind you that I'm going to leave Github soon because of its acquisition by Microsoft. I'll update the user's guide. Rather use directly Phil's source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants