Core Animation renderer #16

Open
opened 2025-10-14 18:03:02 -06:00 by navan · 0 comments
Owner

Originally created by @nicklockwood on 7/17/2019

This PR demonstrates how to implement GPU-accelerated rendering using Core Animation. This allows the game to be rendered at full display resolution, and with much better performance.

The renderer uses a CALayer pool as a simple optimization to avoid churning the view hierarchy each frame. There are opportunities for further optimizations however, for example:

  • The map never changes, so the layers for walls and floor could just be generated once.
  • Currently, layers are generated for every wall and floor/ceiling tile in the map, but we could use raycasting to determine the visible set of tiles and only render those.

I haven't bothered to implement fizzlefade currently. It's not clear what the most efficient way to draw a fizzle effect would be in Core Animation, but if all else fails you could just use Core Graphics.

I also haven't implemented font color tinting, since there's no simple way to implement this with UIImages either (at least, not in real-time).

*Originally created by @nicklockwood on 7/17/2019* This PR demonstrates how to implement GPU-accelerated rendering using Core Animation. This allows the game to be rendered at full display resolution, and with much better performance. The renderer uses a CALayer pool as a simple optimization to avoid churning the view hierarchy each frame. There are opportunities for further optimizations however, for example: * The map never changes, so the layers for walls and floor could just be generated once. * Currently, layers are generated for every wall and floor/ceiling tile in the map, but we could use raycasting to determine the visible set of tiles and only render those. I haven't bothered to implement fizzlefade currently. It's not clear what the most efficient way to draw a fizzle effect would be in Core Animation, but if all else fails you could just use Core Graphics. I also haven't implemented font color tinting, since there's no simple way to implement this with UIImages either (at least, not in real-time).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/RetroRampage#16
No description provided.