Skip to content

Optimize render via FastObjects

Latest

Choose a tag to compare

@egraich egraich released this 22 Aug 19:13

What's new

The rendering layer now runs on the GPU via FastObjects (#1) instead of per-cell pygame.draw.rect calls.

  • The whole grid lives in a single ShapeBatch: one vectorized NumPy write + one instanced draw call per frame
  • ~740 FPS uncapped in 1920x1080 fullscreen (32,400 cells) — the simulation is now the bottleneck, not rendering
  • Smaller cells are finally practical: CELL_SIZE=4 means 130k+ cells without lag

Notes for running from source

  • Python 3.11+ is now required (FastObjects dependency)
  • pip install -r requirements.txt pulls the new fastobjects package
  • PyInstaller builds need --collect-all glfw