{"id":2677,"date":"2016-04-14T16:41:22","date_gmt":"2016-04-14T15:41:22","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=2677"},"modified":"2016-04-14T16:41:22","modified_gmt":"2016-04-14T15:41:22","slug":"p-152-virtual-world-concept-update-109-frustum-culling","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-109-frustum-culling\/","title":{"rendered":"P-152: Virtual World Concept Update 109: Frustum Culling"},"content":{"rendered":"<p>I have implemented frustum culling, or at least, a form of frustum culling, in this project.<\/p>\n<p>I am simply getting the angle between the center of each node and the players view direction. If this angle is within the specified arc of sight, the node is subdivided, other wise, it is not.<\/p>\n<p>The images below were taken with a field of view of 40, and with all nodes outside the field of view not rendering at all.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2681\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_57-PM-copy-300x195.jpg\" alt=\"PhoenixGameDevelopment - 13_04_2016 , 08_17_57 PM copy\" width=\"300\" height=\"195\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_57-PM-copy-300x195.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_57-PM-copy-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_57-PM-copy-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_57-PM-copy.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> \u00a0<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2678\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-03_58_33-AM-copy-300x195.jpg\" alt=\"PhoenixGameDevelopment - 13_04_2016 , 03_58_33 AM copy\" width=\"300\" height=\"195\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-03_58_33-AM-copy-300x195.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-03_58_33-AM-copy-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-03_58_33-AM-copy-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-03_58_33-AM-copy.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2676\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-04_25_57-AM-copy-300x195.jpg\" alt=\"PhoenixGameDevelopment - 13_04_2016 , 04_25_57 AM copy\" width=\"300\" height=\"195\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-04_25_57-AM-copy-300x195.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-04_25_57-AM-copy-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-04_25_57-AM-copy-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-04_25_57-AM-copy.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2675\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_52-PM-copy-300x195.jpg\" alt=\"PhoenixGameDevelopment - 13_04_2016 , 08_17_52 PM copy\" width=\"300\" height=\"195\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_52-PM-copy-300x195.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_52-PM-copy-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_52-PM-copy-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_17_52-PM-copy.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>However, the system is actually a little more complex than this. I wanted to deal with situations where the player may turn around suddenly, or where a large node (a low detail node) may be partially within the field of view. I could just increase the field of view to handle this, but I thought that a more efficient way would be to subdivide all nodes within the arc of sight, and within a certain minimum distance of the player. This means that the nodes close to them always get subdivided. Then, all other nodes will be rendered, but at the lowest detail level, so that if the player turns suddenly, the terrain will not suddenly appear. The worst case scenario is that the player would see the terrain changing detail levels for a fraction of a second.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2679\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_20_07-PM-copy-300x195.jpg\" alt=\"PhoenixGameDevelopment - 13_04_2016 , 08_20_07 PM copy\" width=\"300\" height=\"195\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_20_07-PM-copy-300x195.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_20_07-PM-copy-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_20_07-PM-copy-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/04\/PhoenixGameDevelopment-13_04_2016-08_20_07-PM-copy.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>This system seems to work quite well, although I did notice that there still quite a few problems with seams in the terrain, which could be a difficult problem to fix.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have implemented frustum culling, or at least, a form of frustum culling, in this project. I am simply getting the angle between the center of each node and the players view direction. If this angle is within the specified arc of sight, the node is subdivided, other wise, it is not. The images below [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,17,10,11],"tags":[],"class_list":["post-2677","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-p-0","category-software-and-games","category-spiritus-astrum","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\/2677"}],"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=2677"}],"version-history":[{"count":3,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2677\/revisions"}],"predecessor-version":[{"id":2689,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/2677\/revisions\/2689"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=2677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=2677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=2677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}