4
$\begingroup$

In Mathematica 12.1 if I try use Opacity less than 1, it does not work.

Graphics3D[{Opacity[0.1],Sphere[]}]

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PlotStyle -> Opacity[0.8]]

Even if I try to execute Opacity-related example from the documentation it does not work. I am using Mathematica 12.1 in Linux by the way.

screenshot

$\endgroup$
  • 3
    $\begingroup$ Maybe provide some code of what you are trying to do, what you expect, an what you are seeing. Simply saying "it doesn't work", doesn't give anyone much to work off! $\endgroup$ – Q.P. May 10 at 17:50
  • $\begingroup$ Sorry. Its actually opacity under Plot3D or Graphics3D not working. Say, Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PlotStyle -> Opacity[0.8]] this code , it returns a blank box , but changing opacity to 1 it shows the sphere $\endgroup$ – puppet22 May 10 at 17:52
  • 1
    $\begingroup$ This looks like one of those times where a screenshot, as well as the code you are evaluating (in copyable form) should be supplied. $\endgroup$ – J. M.'s technical difficulties May 10 at 17:54
  • 2
    $\begingroup$ When I said copyable code, this is like the code from your comment that I added to your question. Next time, please do this yourself. $\endgroup$ – J. M.'s technical difficulties May 10 at 18:00
  • 1
    $\begingroup$ You should contact Wolfram with this. $\endgroup$ – Szabolcs May 10 at 18:28
4
$\begingroup$

Your code works fine on version 12.1 with my Mac, using OS Catalina 10.15.3:

Graphics3D[{Opacity[0.1], Sphere[]}]

enter image description here

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PlotStyle -> Opacity[0.8]]

picture

| improve this answer | |
$\endgroup$
  • $\begingroup$ I am using Linux (Manjaro 20.0). Here the opacity is not working! $\endgroup$ – puppet22 May 10 at 18:23
  • 7
    $\begingroup$ Sounds like you should inform Wolfram Research. $\endgroup$ – DavidC May 10 at 19:11
  • 1
    $\begingroup$ Or change the Linux distribution. This works all fine on Mathematica 12.1 on CentOS and Ubuntu. $\endgroup$ – Rolf Mertig May 12 at 13:37
  • $\begingroup$ @RolfMertig what Linux kernel version are you using ? $\endgroup$ – puppet22 May 13 at 21:30
  • $\begingroup$ @puppe22: 2.6 and 5.0. I doubt it has anything to do with the kernel version. Maybe your you windows manager or your graphics card matters? XFCE or what do you use? $\endgroup$ – Rolf Mertig May 13 at 22:10
3
$\begingroup$

I was able to fix the Opacity issue in Manjaro KDE (Kernel: 5.4.40-1) going to the Option Inspector to modify the settings for:

Graphics Options > RenderingOptions > "Graphics3DRenderingEngine"

to change from > "Automatic" to > "Mesa". The other option available: "OpenGL" doesn't work and I do not really know whether it should or what does it mean. Also a font rendering issue for the labels in Plot3D was fixed in this way.

Additional comments related to this issue are more than welcome.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ There's also the old solution of starting Mathematica as mathematica -mesa from e.g. the command line. $\endgroup$ – J. M.'s technical difficulties May 22 at 1:51
  • $\begingroup$ For me the -mesa solution did work as well but the rendering was quite underwhelming. If you have a dedicated Nvidia GPU like I do, you can make use of bumblebee (uses dGPU only on demand to save power). Just start the binary via command line with primusrun mathematica &. $\endgroup$ – PandaScience Jun 21 at 19:59

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.