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

Setting transparency for surfaces does not work #4

Closed
ctrueden opened this issue Jun 16, 2014 · 10 comments
Closed

Setting transparency for surfaces does not work #4

ctrueden opened this issue Jun 16, 2014 · 10 comments

Comments

@ctrueden
Copy link
Member

From @tpietzsch:

When I set the transparency for a surface it has no effect. Surfaces are always rendered fully opaque.

Migrated-From: http://fiji.sc/bugzilla/show_bug.cgi?id=400

@ctrueden
Copy link
Member Author

I tested today with the MRI Stack sample using "Display as: Surface" with a resampling factor of 1. Then "Change transparency" from the Edit menu (Cmd+T), and indeed it seems to have no effect.

@arosh
Copy link

arosh commented Feb 11, 2015

I tried to use "Edit" -> "Change transparency" for WaveFront obj files (using "File" -> "Import surfaces" -> "WaveFront") with 3D_Viewer-3.0.1.jar.
However, it seems to have no effects.

In 06.07.2011 ImageJ_3D_Viewer.jar (http://132.187.25.13/ij3d/?page=Download&category=Download), I could change transparency of WaveFront obj files.

@ctrueden
Copy link
Member Author

@arosh Unfortunately, the author of 3D_Viewer does not actively maintain the plugin anymore. Perhaps you could look through the project's Git history (maybe limiting to src/main/java) and attempt to isolate when the problem was introduced? A great tool for this is git bisect.

@acardona
Copy link
Member

I have seen this issue in the past and it was always related to graphics card drivers. Updating the driver addressed the error every time.

@arosh
Copy link

arosh commented Feb 12, 2015

@ctrueden Thanks to your advice, I found the last good commit e606bf9 and the first bad commit 83f034a.
My git bisect log is shown below.

# bad: [c2b85629d029495e1e496086c9cf5b10c79aa03e] Bump parent pom
# good: [e8931af162ed22f2f62e5e4ae7c9d9abdb2ab8e7] Move the 3D Viewer into its own package
git bisect start 'HEAD' 'e8931af162ed22f2f62e5e4ae7c9d9abdb2ab8e7'
# good: [19cf313db7a091e580315c775fae4a03f1bb1e78] 3D Viewer: Let Alt+Click remove landmarks instead of Shift+Click
git bisect good 19cf313db7a091e580315c775fae4a03f1bb1e78
# bad: [009ddf2c9570bdcf67d91c1e4c72cc44825ac79f] 3D Viewer: Implement shortcuts.
git bisect bad 009ddf2c9570bdcf67d91c1e4c72cc44825ac79f
# good: [7f0394e825eb2837a20a65c5e9b1eb10d14c0d4a] 3D Viewer: Fix slow drawing of 2D ROI.
git bisect good 7f0394e825eb2837a20a65c5e9b1eb10d14c0d4a
# good: [24617e378649a5b96bbdce8fe062ba1d1912b8dd] 3D Viewer (SurfacePlot): show color images in correct color
git bisect good 24617e378649a5b96bbdce8fe062ba1d1912b8dd
# good: [4ffd9016899f81d5e8d70905edce1e04c99b5091] 3D Viewer: some code formatting.
git bisect good 4ffd9016899f81d5e8d70905edce1e04c99b5091
# good: [59b93598c5471aaf8d76ec6a824e30c2644d3df3] 3D_Viewer: Designed a nice dialog for transforming objects.
git bisect good 59b93598c5471aaf8d76ec6a824e30c2644d3df3
# good: [e606bf91e717d1f01495627d605aeaf4966be237] 3D Viewer: Display text along with landmark points.
git bisect good e606bf91e717d1f01495627d605aeaf4966be237
# bad: [456aec52fee2f910c2eac45ef18ba395e14a5a02] 3D_Viewer: Some eclipse-suggested code style editing.
git bisect bad 456aec52fee2f910c2eac45ef18ba395e14a5a02
# bad: [83f034ab3c527cea34b1c4fc0915481e74e63c56] 3D Viewer: Make sure the annotation text of landmark points is on top of the content.
git bisect bad 83f034ab3c527cea34b1c4fc0915481e74e63c56
# first bad commit: [83f034ab3c527cea34b1c4fc0915481e74e63c56] 3D Viewer: Make sure the annotation text of landmark points is on top of the content.
# good: [e606bf91e717d1f01495627d605aeaf4966be237] 3D Viewer: Display text along with landmark points.
git bisect good e606bf91e717d1f01495627d605aeaf4966be237
# first bad commit: [83f034ab3c527cea34b1c4fc0915481e74e63c56] 3D Viewer: Make sure the annotation text of landmark points is on top of the content.

@iarganda
Copy link
Contributor

I'm having a look at this problem because it is happening as well on my new machine with the latest drivers of my graphic card. Setting the transparency mode of the meshes to TransparencyAttributes.SCREEN_DOOR makes the transparency work, but it is not the idea solution.

@ctrueden
Copy link
Member Author

@iarganda Are you testing with Java 3D 1.6?

Also, did you have a look at @arosh's helpful bisect info?

@iarganda
Copy link
Contributor

@ctrueden No, I haven't tested yet with Java 3D 1.6. I tried using your branch (https://github.com/fiji/3D_Viewer/tree/jogl-java3d) but it seems I need to configure something else to use Java 1.7. I'll figure it out. Thanks!

@iarganda
Copy link
Contributor

@ctrueden I just made a tiny modification that fixes the issue (601809d). For some reason that I'm still trying to figure out, initializing a mesh transparency mode to TransparencyAttributes.NONE prevents the mesh to change its transparency later even if the mode is updated to any other mode except TransparencyAttributes.SCREEN_DOOR (which is not ideal). So I simply initialize all meshes with TransparencyAttributes.FASTEST transparency mode, even if the transparency value is 0, and it works as expected.

@ctrueden
Copy link
Member Author

Awesome, thanks @iarganda. I cherry-picked it to master: 42cdbe4

@tpietzsch @arosh Please test (you can download the binary from our Maven repository if you like) and let us know if there are any problems.

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

No branches or pull requests

4 participants