I am building a set of 3D figures for online display (as supplementary material for a physics paper), and I am having some issues getting the transparency features to work.
Specifically, I have a set of surfaces built using the <IndexedFaceSet>
primitive, prefaced with a <Material>
element inside an <Appearance>
tag, which contains the transparency element:
<Shape>
<Appearance>
<Material diffuseColor='1. 0.5 0.'
specularColor='1. 1. 1.'
shininess='0.9'
transparency='0.5' />
</Appearance>
<IndexedFaceSet colorPerVertex='false'
normalPerVertex='true'
solid='false'
coordIndex='0 1 2 -1 3 4 5 -1 ...'
/>
However, when displayed within x3dom, the figure shows a jagged appearance with patchy behaviour:
From what I can tell, only some of the polygons in the <IndexedFaceSet>
are getting rendered in a way that accounts for the polygons behind them, but I can't be sure.
The plot is available to view here, and the x3d file was produced in Mathematica as described in this Mathematica Stack Exchange Q&A, with the transparency added in by hand. I don't know whether the issue is intrinsic to x3dom or to the x3d format -- I get the same in freeWRL and in view3dscene but the renderers there don't fill me with confidence either.
So:
- What is the name of this effect? I imagine this is quite a common thing to see in 3D graphics, but I don't know what to call it and I get the feeling that this is making it harder to find relevant solutions.
- Is this a bug in x3dom? a sign of an imperfect renderer? In other words, is the x3dom engine restricted to displaying these graphics in this way, and I need to either accept that or drop the transparency? or
- is there a way to fix the model or the scene or the settings or the rendering, to stop this patchy appearance from occurring?
I'm kinda lost as to how to approach this (I'm just a humble physicist trying to innovate in graphics formatting) and would be grateful for any pointers about how to approach this.