{"id":1275,"date":"2015-02-19T21:06:45","date_gmt":"2015-02-19T21:06:45","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1275"},"modified":"2015-02-19T21:06:45","modified_gmt":"2015-02-19T21:06:45","slug":"p-155-phoenix-engine-update-9-framerate-issues-and-optimising-opengl-programs-part-2","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-155-phoenix-engine-update-9-framerate-issues-and-optimising-opengl-programs-part-2\/","title":{"rendered":"P-155: Phoenix Engine Update 9: Framerate issues and Optimising OpenGL programs: Part 2"},"content":{"rendered":"<p>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 (&#8220;&amp;&#8221;) to force the code to send the data by reference, instead of by value, increased my framerate from 6 to 112.<\/p>\n<p>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&#8217;t visible. So, for a game divided into a 10&#215;10 grid, instead of rendering 100 sections, you would render, at most, 10 sections, since the player can only see one &#8220;row&#8221; at once, depending on which way they are facing.<\/p>\n<p>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.<\/p>\n<p>I have improved performance significantly, but there is a lot more work to be done here.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 (&#8220;&amp;&#8221;) to force the code to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,16],"tags":[],"class_list":["post-1275","post","type-post","status-publish","format-standard","hentry","category-software-and-games","category-software-engines","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"builder_content":"","_links":{"self":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1275"}],"collection":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/comments?post=1275"}],"version-history":[{"count":1,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1275\/revisions"}],"predecessor-version":[{"id":1276,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1275\/revisions\/1276"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}