AO not supported on Apple M1?

Greetings,

I upgraded to Panda3D 1.10.9 using pip and tried to enable ambient occlusion on an Apple M1 Mac.

I am still a bit of a newbie. The example works fine but no AO. I am wondering whether this is simply because it is not (yet) supported due to the Cg issue or whether I am just not doing it right?

Best
Andreas

Yes, this is due to that issue. You should run under x86_64 emulation, use a GLSL shader, or use the experimental shaderpipeline branch of Panda3D.

Thank you. Using a GLSL shader would entail writing it myself I take it?

Yes, I’m afraid so.

I found this thread while looking for help as I am also working on M1 and having issues with Ambient Occlusion.
Previously, @rdb wrote that the solution might be to “run under x86_64 emulation”.
Well, I just “run under x86_64 emulation”:

Python 3.10.7 (v3.10.7:6cc6b13308, Sep  5 2022, 14:02:52) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.machine()
'x86_64'
>>> 

Despite this, trying to enable Ambient Occlusion ends up with:

Known pipe types:
  CocoaGraphicsPipe
(all display modules loaded.)

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Here is the minimalist piece of code I tested it on:

from direct.filter.CommonFilters import CommonFilters
from direct.showbase.ShowBase import ShowBase
base = ShowBase()
panda = base.loader.loadModel('panda')
panda.reparentTo(base.render)
filters = CommonFilters(base.win, base.cam)
filters.setAmbientOcclusion()
base.run()

Interestingly, there is no crash when I comment out the line:

# panda.reparentTo(base.render)

But it’s a bit difficult to use Ambient Occlusion without objects. :wink:
Do you have any ideas?

Do you have any more information? Usually, on macOS, a window pops up allowing you to get a detailed crash report.

It could be a bug in Apple’s emulated driver.

If it’s a bug in Apple’s emulated driver, then I understand that I have to wait for the new shaderpipeline of Panda3D 1.11 (just a question, when will it appear)? Well, unless I write my own GLSL shader, but I don’t think I’m up to it yet.
As for the log from the macOS window, it actually appeared, but I did not paste it here, because this log does not tell me much. Maybe it can tell you something? I paste the link to it below:

So, it is an abort() call somewhere in Apple’s Metal-based OpenGL driver. Usually an abort() call is because some invalid state is detected, but that should accompany an error message. I don’t see any error message apart from the cryptic “VM - pmap_enter retried due to resource shortage” - you didn’t just happen to run out of memory, did you?

I can’t make any promises about when Panda3D 1.11 will appear. I suggest going the GLSL shader route. :slight_smile:

I will add that I did the test after restarting the computer, with most of the applications running in the background OFF, with about 6 GB of free RAM (and zero swap usage). Unfortunately, the effect is exactly the same. :frowning: