I was wondering if anyone knew how to switch to the Metal renderer on Mac. OpenGL works, but I'd really appreciate any extra battery life that Metal could provide.
a little exploration game about hiking up a mountain · By
So in the terminal at this directory, "/Applications/AShortHike.app/Contents/MacOS", using the command "./AShortHike -force-metal" should do the trick?
Is there anyway to check in game what rendering engine is currently running? Also is it definitely "-force-metal" and not "-force-gfx-metal" or "--force-metal"?
Thanks!
Edit: nm, it seems to be working.
So I appear to have it working. I get about 30% better performance with Metal vs default OpenGL. The performance difference is actually more complicated than this. See the chart in my below post.
If anyone else is trying to do this, paste this:
do shell script "open -a '/Applications/AShortHike.app' --args -force-metal"
into the Script Editor and save it as an application.
Resolution: 2560x1600 | GPU: Iris Plus 655 | Settings: Maxed | OpenGL (fps) | Metal (fps) |
On Fishing Ship + No Pixelation + vsync | ~35 | ~52 |
On Fishing Ship + No Pixelation + no vsync | ~50 | ~52* |
On Fishing Ship + Default Pixelation + no vsync | ~180 | ~100* |
Clump of Trees near Debt Guy + No Pixelation + vsync | 40-49 | ~53 |
Clump of Trees near Debt Guy + No Pixelation + no vsync | 50 | ~54* |
Clump of Trees near Debt Guy + Default Pixelation + no vsync | ~130 | ~120 |
*There was some really weird judder for these Metal results, it felt like it was running slower than real time
Really weird results actually. I only did the first test earlier, which lead me to believe Metal was strictly superior, however OpenGL performs pretty well in some situations, which is odd given how poorly supported it is on macOS. In particular, without vsync on, the Metal implementation was practically unplayable. Additionally, OpenGL seemed to benefit significantly more from pixelation.
Also, after doing some testing with the Intel Power Gadget, there is no appreciable difference in power consumption for the two runtimes. One actual difference is the color management (or lack thereof in OpenGL's case). The Metal version of the game targets sRGB, but the OpenGL version just outputs to the Mac's native gamut.
OpenGL outputs to the native gamut
Metal outputs to sRGB
These images may appear the same if viewed on a noncolormanaged OS or on a sRGB monitor. Basically the OpenGL version is much more saturated than the Metal version, and perhaps not the best representation of your artistic intent?
I've updated the results after the recent update, and the numbers are now very different. Metal now performs significantly better*, with up to 30% higher framerates. Additionally, the Metal version no longer had judder issues at 60fps, though it did have some issues at 30fps.
Unfortunately, OpenGL seems to have regressed. Framerates slightly below 60 are completely unplayable. If the framerate is at 58, for example, it's necessary to lock fps to 30 for the game to stay responsive.
*Sometimes the Metal version gets stuck in a weird state where it can't get above 80fps. This can be solved by going into the settings and toggling between different pixelation options.
Resolution: 2560x1600 | GPU: Iris Plus 655 | Settings: Perfect | OpenGL (fps) | Metal (fps) |
On Fishing Ship + No Pixelation + vsync | ~57 | 60 |
On Fishing Ship + No Pixelation + no vsync | 57 | ~65 |
On Fishing Ship + Default Pixelation + no vsync | ~230 | ~300 |
Clump of Trees near Debt Guy + No Pixelation + vsync | ~57 | 60 |
Clump of Trees near Debt Guy + No Pixelation + no vsync | 57 | ~60 |
Clump of Trees near Debt Guy + Default Pixelation + no vsync | ~200 | ~250 |
Well I played with pixelation on for the most part anyways. I just thought it would be an interesting data point. ~50 fps on a laptop iGPU isn’t even that bad a result.
The most annoying part was just the weird judder the Metal version had without vsync enabled, but I played with vsync on, so it didn’t effect me.
Anyways, thank you for the amazing game!