P-155: Phoenix Engine Update 9: Framerate issues and Optimising OpenGL programs: Part 2
I have solved most of my performance issues for now. It has turned out that I was passing the data for my object file as a variable, for each object, in every render pass. This was obviously causing a huge performance problem. A very simple addition of an ampersand (“&”) to force the code to send the data by reference, instead of by value, increased my framerate from 6 to 112.
I have also written a simple grid-based culling system. It is similiar to frustum culling, in that only the object in the players view direction are rendered. Using a grid, I have essentially removed any object from rendering which isn’t visible. So, for a game divided into a 10×10 grid, instead of rendering 100 sections, you would render, at most, 10 sections, since the player can only see one “row” at once, depending on which way they are facing.
I am also concerned about the speed of the freetype text rendering. I am using a textured quad for each letter, and when a substantial amount of text is on screen, the game seems to slow to a crawl. This will also need investigation.
I have improved performance significantly, but there is a lot more work to be done here.
