Shadow Generator + Shadows cause massive FPS drop on MacOS

I’ve tested my game on 3 devices;

  • Windows PC, on which my game runs very smoothly at 150 FPS
  • MacBook Pro (16 inch, 2019) - Graphics card: Intel UHD Graphics 630 1536 MB
  • iMac21,2 with Apple M1 chip (which acts as both a CPU and GPU, from what I’ve read?)

Problem:

My game runs smoothly with no issues on my Windows PC, and my MacBook Pro laptop. Consistent 60 FPS on both, no problem.

However, when trying to run it on the iMac, it was getting 6-8 FPS only. After playing around a bit, I discovered that if I didn’t add any of the meshes as shadow casters to my BABYLON.ShadowGenerator, the FPS rose to ~40. And finally, if I didn’t instantiate a BABYLON.ShadowGenerator at all, the FPS hit a solid 60. So it seems like the mere presence of a ShadowGenerator in the scene, even if there are zero meshes casting shadows, would cause a massive 20 FPS drop.

This occurred in all browsers on the iMac, and I checked chrome settings and hardware acceleration was definitely enabled.

Any ideas as to what’s happening here? Has anyone else encountered similar issues with Macs with the M1 chip?


I don’t think there’s anything special about the way I’m using the ShadowGenerator, I’m doing everything in basically the same way as the BabylonJS tutorials specified. (for details about my code, I went into more detail in this other thread, about a separate issue with shadows that I’m experiencing: Shadow quality low with moving / "quivering" edges)

adding @Cedric

@sairens could you provide a quick repro in the Playground ?

@sebavan
On any apple device with M1 chip, using different shadow filter makes the fps from 120 to 30 (Chrome Browser)
https://www.babylonjs-playground.com/#11OYNB#12 (get 120 fps)
https://www.babylonjs-playground.com/#11OYNB#16 (get 30 fps)

So the second one is using PCSS which can be pretty expensive for mobile GPUs. I would tend to disable it on mobiles. I am wondering what GPU is offered on M1 devices ?

The FPS drops only appear on Macbook pro 2021 with M1 pro chip and the latest chrome browser. Safari gets 60 FPS.

We don’t have ipad 5th with M1 chip to test PCSS.

Using PCSS gets 60 FPS on Macbook pro 2017 (Safari, Chrome), ipad pro 4th (Safari, Chrome), iphone 8+ (Safari, Chrome)

I wonder if it might be a Chrome issue and the metal driver, you should try ping them on the chromium issue tracker as Safari is working ?

Hi @Hugo just checking in, have you managed to talk to the Chromium people? :slight_smile:

@carolhmj Hi, I have reported this issue to chrome people today.

1 Like