Possible bug with surfaces opacity in threejs

40 views
Skip to first unread message

Emmanuel Charpentier

unread,
Oct 14, 2017, 7:56:01 PM10/14/17
to sage-support
I think that I have found a problem with the rendering of semi-opaque surfaces in threejs : some portions of semi-opaque surfaces that should be rendered as if seen "through" other semi-opaque surfaces  "snap" in and out of existence when the graph is rotated or rescaled.

This is much more easily shown than explained. Run the attached Jupyter notebook worksheet (after scannig it with your favorite anti-virus software...) : it allows to compare the behaviour of jmol (sjow and not-so-clean, but correct) and threejs (faster, smoother, but scarce in details and sometimes just plain wrong).

This is *not* reported on Trac (at least, none of the 28 tickets (4 open) retrieved by a search on "threejs" treat it).

Is it ticket-worthy ?
ThreeJS opacity problem..ipynb

Andrey Novoseltsev

unread,
Oct 16, 2017, 1:30:21 PM10/16/17
to sage-support
It is known - I have complained several times over the years, but my understanding is that solving this is difficult. It has to do with the algorithm that throws away triangles as invisible, and when the surface is simple like a plain and contains few triangles, you see this behaviour. It can be solved in each particular case by subdividing surfaces, but something generic and automatic will be trickier. Paul Masson who wrote the current implementation may say more perhaps.

Emmanuel Charpentier

unread,
Oct 18, 2017, 8:45:47 AM10/18/17
to sage-support
Is that related to the fact (empirical constatation) that a triangle with at least a non-numeric vertex (e. g. "NaN" float as the z coordinate) is eliminated from rendition in jmol and cython ?

--
Emmanuel Charpentier
Message has been deleted

Andrey Novoseltsev

unread,
Oct 20, 2017, 12:00:50 AM10/20/17
to sage-support
No, rather in threejs only one of overlapping triangles is shown and it is the one whose center is closer or something like this. And show/not show is binary without taking transparency into account. I think this is where Paul was explaining some details: https://trac.sagemath.org/ticket/22123#comment:9
Reply all
Reply to author
Forward
0 new messages