FreeOrion

Forums for the FreeOrion project
It is currently Fri Feb 23, 2018 12:57 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Jan 11, 2018 8:17 am 
Offline
Space Krill

Joined: Thu Jan 11, 2018 7:34 am
Posts: 3
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.


Attachments:
freeorion-background-cache.diff [11.22 KiB]
Downloaded 10 times
Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 8:28 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12132
Location: Munich
What is "the background" ?


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 9:49 am 
Offline
Space Krill

Joined: Thu Jan 11, 2018 7:34 am
Posts: 3
The galaxy map, with associated starlanes/molecular clouds/systems/visibility range circles.


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 9:59 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12132
Location: Munich
If there are major graphical artifacts are a result, the patch is probably not acceptable...


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 10:22 am 
Offline
Space Krill

Joined: Thu Jan 11, 2018 7:34 am
Posts: 3
Expected as much; the point of posting it was to see if it's worth taking the time to polish it up. (AFAICT fixing the glitches shouldn't bring back the performance hit, but figuring out how will take me a while.)


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 10:34 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12132
Location: Munich
If you can make it work mostly without glitches, then it could be useful.


Top
 Profile  
 
PostPosted: Sun Jan 14, 2018 10:49 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4364
Location: Sol III
@Iamnotalice, it would be preferable if you provide your patches as PRs on our github repo.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group