Patch to cache rendered backgrounds for better FPS.
Posted: Thu Jan 11, 2018 8:17 am
This patch adds an option to render the background to a texture so it doesn't need to be rerendered every frame. On my system it brings a massive improvement in FPS - I have a 1600-star universe that is ~4FPS on my machine using normal settings, ~12FPS with my patch.
Bugs in my patch:
- It currently only updates the background after you resize the window or move the galaxy map coordinates, not after turn advance.
- There is some entertaining visual glitching when dragging the galaxy map around (and the framerate drops back down).
- There is also visual glitching when the game is defocused.
- The preference to toggle background caching doesn't have a proper label.
- Visibility circles are a bit of a mess - the OpenGL docs say the framebuffer objects don't have a stencil buffer or something?
Other weaknesses:
- I don't know OpenGL or C++, so my code may not be very good.
- I haven't tested it on anything but Debian.
Bugs in my patch:
- It currently only updates the background after you resize the window or move the galaxy map coordinates, not after turn advance.
- There is some entertaining visual glitching when dragging the galaxy map around (and the framerate drops back down).
- There is also visual glitching when the game is defocused.
- The preference to toggle background caching doesn't have a proper label.
- Visibility circles are a bit of a mess - the OpenGL docs say the framebuffer objects don't have a stencil buffer or something?
Other weaknesses:
- I don't know OpenGL or C++, so my code may not be very good.
- I haven't tested it on anything but Debian.