2
$\begingroup$

As you can see from the image below, when I plot 3D surfaces, regions, etc, they render as though there was no light source (left is Mathematica's help documentation, right is how it renders for me):

RegionPlot3D[x^2 + y^3 - z^2 > 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

comparison of documentation vs. evaluated

This is just an example - but it happens every time.

Weirdly, when I rotate the image, the rendering temporarily renders normally - but only while I'm rotating; the moment I release the mouse, it goes back to being light-less.

Any idea what's wrong, and how to fix it?

I'm not aware of having made any preference changes - wouldn't know how to...

I use Mathematica 12.1.00 for MacOs X (64-bit). And I should add that the problem has been going on for months - restarts make no difference, global clearing makes no difference.

UPDATE:

In answer to @Edmund's question below, the Lighting setting makes no difference. Here is an example with Lighting->"Standard":

enter image description here

And if I click to rotate the same graphic, it suddenly looks like this - but only while I am rotating it:

enter image description here

$\endgroup$
  • 1
    $\begingroup$ For reference, what version and OS are you using? $\endgroup$ – J. M.'s technical difficulties Jun 3 at 14:29
  • 2
    $\begingroup$ Does this persist if you quit Mathematica and restart? $\endgroup$ – Bob Hanlon Jun 3 at 14:31
  • $\begingroup$ I use Mathematica 12.1.0.0 for MacOs X (64-bit). And, yes, the problem persists - I'll add these two items to the question, thank you. $\endgroup$ – Richard Burke-Ward Jun 3 at 16:17
  • $\begingroup$ What does Options[RegionPlot3D, Lighting] return when evaluated? $\endgroup$ – Edmund Jun 4 at 12:22
  • $\begingroup$ Hi @Edmund. It returns *{Lighting -> Automatic}*. However, I have now tried adjusting the Lighting setting to "Standard" and "Directional" and the problem remains... $\endgroup$ – Richard Burke-Ward Jun 4 at 12:30
4
$\begingroup$

I'm turning my recommendations in the comments into an answer for anyone experiencing the same issue:

There is a bug in the Metal renderer on macOS. See here: https://community.wolfram.com/groups/-/m/t/1905659

Execute the following to see which rendering engine works best.

Style[Graphics3D[Sphere[]], RenderingOptions -> {"3DRenderingEngine" -> #}]&/@{"Metal","OpenGL","Mesa"}

You can set the option once for all plots like this:

SetOptions[$FrontEnd, RenderingOptions -> {"3DRenderingEngine" -> "OpenGL"}]

... or you can add this to global options or init.m.

| improve this answer | |
$\endgroup$

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.