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:

rough lines smooth lines

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".

  • $\begingroup$ Works fine for me on Mathematica 9.0.1 on Mac. What's your version and platform? $\endgroup$ – user484 Jul 11 '14 at 6:38
  • $\begingroup$ Works great from me also. V9 and V10. Win8.1 $\endgroup$ – Algohi Jul 11 '14 at 7:09
  • 1
    $\begingroup$ 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. $\endgroup$ – Stephen Luttrell Jul 11 '14 at 8:55
  • $\begingroup$ I am using MMA on Linux x86 (32-bit). $\endgroup$ – Russ Lyons Jul 11 '14 at 15:35
  • $\begingroup$ 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. $\endgroup$ – 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.

|improve this answer|||||
  • $\begingroup$ Thanks for the tip on the missing mesh part! $\endgroup$ – Russ Lyons Jul 11 '14 at 15:36
  • $\begingroup$ 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/… $\endgroup$ – Russ Lyons Jul 13 '14 at 19:51
  • $\begingroup$ For completeness: The answer to that question is to use BoundaryStyle (see the answer to the above post). $\endgroup$ – 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]]



|improve this answer|||||
  • $\begingroup$ 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. $\endgroup$ – Russ Lyons Jul 11 '14 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.