Dawnglass #2: Putting every chip in my MacBook to work

I wanted to play WoW from my MacBook on my TV, over Wi-Fi. I had to mod Sunshine for it, but it worked. Then came the next question: how good can I make it look, if I use everything my MacBook has to offer?

I started in WoW’s graphics settings. The goal: the best-looking game that still runs at about 60 fps. I turned things up until it didn’t, and ended at about 58 fps.

Then I looked at what my laptop was doing. The graphics chip was almost completely used: 85 to 90 percent. The processor was about half idle, because WoW only uses two or three of its ten cores. But my laptop also has a Neural Engine, Apple’s separate chip for AI. It was doing nothing at all.

So I started to look at which part of the chip we should use for what. My belief: the best-looking game comes from using all the hardware you have, with every part doing what it’s best at. The graphics chip draws the world: objects, grass, view distance. The light is where the Neural Engine comes in, and light is exactly what WoW’s settings make expensive. Water reflections cost me 14 fps, fog and light rays 16, shadows and ambient occlusion another 8. The processor’s spare cores do the bookkeeping around it. WoW provides the world, Dawnglass provides the light.

Our first attempt was a separate app that made an extra copy of the screen and showed the improved version on top of the game. That quickly turned out to be too costly: the extra copy alone cost 7 fps on a graphics chip that was already full. Then we realised Sunshine already handles every frame on its way to the TV. Sunshine has no plugin system, so we wrote Dawnglass as a hook inside it. It gets each frame between capturing the screen and encoding the stream, at 0.58 ms of GPU time per 4K frame.

At 60 fps every frame gets 16.7 milliseconds. Every step Dawnglass adds gets at most 4 of them. A first lighting model on the Neural Engine took under 1 ms. That leaves about 12 ms of Neural Engine time per frame unused.

Next part: the easiest win so far didn’t need any AI. My TV can do HDR. WoW on the Mac can’t. Or so I thought.