# Rough mesh lines in partially opaque 3D plots

If I plot a surface with mesh lines, they show up fine (of course). However, if the surface is even just a little transparent, they get quite rough. Compare this to setting the Opacity to 1:

  ParametricPlot3D[{4 + (3 + Cos[v]) Sin[u], 4 + (3 + Cos[v]) Cos[u],
4 + Sin[v]}, {u, 0, 2 Pi}, {v, 0, 2 Pi},
PlotStyle -> Opacity[.99],
MeshStyle -> Thickness[.005],
ImageSize -> 800,
Axes -> False, Boxed -> False]


Here are the results:

How can I get proper smooth lines and use Opacity at the same time?

UPDATE (Aug. 9, 2014): Wolfram tells me that "this is an issue with rendering transparent 3D objects on Linux systems using Intel graphics hardware." It has to do with "depth peeling".

• Works fine for me on Mathematica 9.0.1 on Mac. What's your version and platform? – user484 Jul 11 '14 at 6:38
• Works great from me also. V9 and V10. Win8.1 – Algohi Jul 11 '14 at 7:09
• This problem must be oddly system-dependent, because I can reproduce it with Mathematica 9.0.1 on a 2012 MacBook Air running OS X 10.9.3. – Stephen Luttrell Jul 11 '14 at 8:55
• I am using MMA 9.0.1.0 on Linux x86 (32-bit). – Russ Lyons Jul 11 '14 at 15:35
• I just downloaded MMA 10.0.0 (on Linux). It has the same problem (though the default colors have changed considerably). I will ask Wolfram about this bug. – Russ Lyons Jul 13 '14 at 5:20

This is not an answet, but an extended comment with graphics.

Running V9 on OS X, your code with PlotStyle -> Opacity[.8], gives me this:

I experience no noticeable performance hit. What's not to like about it? Well, I'd add Mesh -> Full to fill in the missing mesh circle at u = 0.

• Thanks for the tip on the missing mesh part! – Russ Lyons Jul 11 '14 at 15:36
• How does one get a Full Mesh while also using a non-default number of lines? Without Full, it will not give the lines at 0 (or 2Pi). I have posted this as a regular question at mathematica.stackexchange.com/questions/54744/… – Russ Lyons Jul 13 '14 at 19:51
• For completeness: The answer to that question is to use BoundaryStyle (see the answer to the above post). – Russ Lyons Jul 14 '14 at 4:47

Leave away PlotStyle->Opacity[.99]

Setting Opacity in 3D animations has a considerable impact on performance.

Use alternatives instead. MeshStyle -> Directive[AbsoluteThickness[2], GrayLevel[.4]]

Otherwise this doesn't work either

RevolutionPlot3D[{3 + Cos[t], Sin[t]}, {t, 0, 2 Pi}, PlotStyle -> Directive[Opacity@.5], MeshStyle -> Directive[AbsoluteThickness@1]]

Output

• What alternatives to Opacity do you have in mind? I will want Opacity[0.8] or so in the end; I used .99 just to demonstrate. – Russ Lyons Jul 11 '14 at 15:38