{"id":1811,"date":"2015-11-01T23:57:27","date_gmt":"2015-11-01T23:57:27","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1811"},"modified":"2015-11-02T04:35:41","modified_gmt":"2015-11-02T04:35:41","slug":"p-152-virtual-world-concept-update-61-chunked-levels-of-detail-using-quad-trees-part-29-2","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-61-chunked-levels-of-detail-using-quad-trees-part-29-2\/","title":{"rendered":"P-152: Virtual World Concept Update 62: Chunked Levels of Detail Using Quad Trees Part 30"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>I have made a lot more progress in investigating the problems I have been having with the spherical terrain.<\/p>\n<p>Firstly, I now believe that these problems are actually preexisting. Below are some screenshots that I took with the old codebase, which I believed was working correctly (using triangle based rendering).<br \/>\nHowever, there are some missing polygons, and some visible graphical distortion occuring at the edges of the quad spheres faces. \u00a0I hadn&#8217;t paid much attention to these before, I assumed they were simply minor bugs that could be corrected later, but I now believe that these are actually more serious issues with the underlying algorithms.<\/p>\n<p>I have, after much effort, managed to get the points to be generated in groups of four. What was happening is that the loop I was using to generate the points was incrementing and decrementing in the conventional way, like this:<\/p>\n<blockquote><p>for(int i = 0;i&lt;maxvalue;i++)<\/p>\n<p>{<\/p>\n<p>for(int j= 0;j&lt;maxvalue;j++)<\/p>\n<p>{<\/p>\n<p>}<\/p>\n<p>}<\/p><\/blockquote>\n<p>This produced the correct number of points, but, each group of 4 points was arranged in a line, not a quad, (since it was being incremented by 1 at a time).<\/p>\n<p>I have now modified this algorithm to produce points in contiguous groups of 4. This is significant progress, however, I have still not completed the quad rendering. I have had to completely re-evaluate and modify the existing spherical terrain system, including the rendering. I am confident that I will solve this issue, and I feel that I could be relatively close, but I am not quite there yet.<\/p>\n<p>I have put a lot more work into this project that I have had time to post here, these are just snippets of what I have actually done. I feel that, even though this has taken a lot of time, I have a much greater understanding of how this whole system fits together now. So much so that I have been able to make complex optimisations to the code as I am working through it, removing older code that I had added when I clearly didn&#8217;t fully understand the workings of the system. I have even removed an entire loop from the codebase, which was used to rearrange the order of the vertices so that they rendered correctly. I have now incorporated this into the first loop, which generates the vertices.<\/p>\n<p>I have also completely refactored most of the other code in the spherical terrain generation functions, improving and optimising it. I had quite a bit of redundant code in there that has now been removed, and other code that worked in some cases, but failed for others. This would no doubt have resulted in irritating bugs at some point, if I hadn&#8217;t dealt with it now.<\/p>\n<p>Since the terrain system needs to be fast and reliable, this time has certainly been well spent.<\/p>\n<p><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment181-Oct.-28-20.41.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1785\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment181-Oct.-28-20.41-300x233.jpg\" alt=\"PhoenixGameDevelopment181 Oct. 28 20.41\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment181-Oct.-28-20.41-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment181-Oct.-28-20.41-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment181-Oct.-28-20.41.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment180-Oct.-28-20.40.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1786\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment180-Oct.-28-20.40-300x233.jpg\" alt=\"PhoenixGameDevelopment180 Oct. 28 20.40\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment180-Oct.-28-20.40-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment180-Oct.-28-20.40-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment180-Oct.-28-20.40.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment179-Oct.-28-20.40.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1787\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment179-Oct.-28-20.40-300x233.jpg\" alt=\"PhoenixGameDevelopment179 Oct. 28 20.40\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment179-Oct.-28-20.40-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment179-Oct.-28-20.40-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment179-Oct.-28-20.40.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment175-Oct.-27-23.37.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1788\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment175-Oct.-27-23.37-274x300.jpg\" alt=\"PhoenixGameDevelopment175 Oct. 27 23.37\" width=\"274\" height=\"300\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment175-Oct.-27-23.37-274x300.jpg 274w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment175-Oct.-27-23.37-937x1024.jpg 937w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment175-Oct.-27-23.37.jpg 966w\" sizes=\"(max-width: 274px) 100vw, 274px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment187-Oct.-29-00.26.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1789\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment187-Oct.-29-00.26-300x233.jpg\" alt=\"PhoenixGameDevelopment187 Oct. 29 00.26\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment187-Oct.-29-00.26-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment187-Oct.-29-00.26-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment187-Oct.-29-00.26.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment186-Oct.-29-00.01.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1790\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment186-Oct.-29-00.01-300x233.jpg\" alt=\"PhoenixGameDevelopment186 Oct. 29 00.01\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment186-Oct.-29-00.01-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment186-Oct.-29-00.01-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment186-Oct.-29-00.01.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment203-Oct.-29-01.16.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1791\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment203-Oct.-29-01.16-300x233.jpg\" alt=\"PhoenixGameDevelopment203 Oct. 29 01.16\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment203-Oct.-29-01.16-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment203-Oct.-29-01.16-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment203-Oct.-29-01.16.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment201-Oct.-29-01.13.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1792\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment201-Oct.-29-01.13-300x233.jpg\" alt=\"PhoenixGameDevelopment201 Oct. 29 01.13\" width=\"300\" height=\"233\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment201-Oct.-29-01.13-300x233.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment201-Oct.-29-01.13-1024x794.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment201-Oct.-29-01.13.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment213-Oct.-30-20.54.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1793\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment213-Oct.-30-20.54-300x158.jpg\" alt=\"PhoenixGameDevelopment213 Oct. 30 20.54\" width=\"300\" height=\"158\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment213-Oct.-30-20.54-300x158.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment213-Oct.-30-20.54-1024x540.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment213-Oct.-30-20.54.jpg 1440w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment217-Oct.-30-23.22.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1794\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment217-Oct.-30-23.22-300x188.jpg\" alt=\"PhoenixGameDevelopment217 Oct. 30 23.22\" width=\"300\" height=\"188\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment217-Oct.-30-23.22-300x188.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment217-Oct.-30-23.22-1024x640.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment217-Oct.-30-23.22.jpg 1512w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment220-Oct.-31-00.09.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1795\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment220-Oct.-31-00.09-300x191.jpg\" alt=\"PhoenixGameDevelopment220 Oct. 31 00.09\" width=\"300\" height=\"191\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment220-Oct.-31-00.09-300x191.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment220-Oct.-31-00.09-1024x654.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2015\/10\/PhoenixGameDevelopment220-Oct.-31-00.09.jpg 1440w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; I have made a lot more progress in investigating the problems I have been having with the spherical terrain. Firstly, I now believe that these problems are actually preexisting. Below are some screenshots that I took with the old codebase, which I believed was working correctly (using triangle based rendering). However, there are some [&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,10,11],"tags":[],"class_list":["post-1811","post","type-post","status-publish","format-standard","hentry","category-astral-realms","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\/1811"}],"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=1811"}],"version-history":[{"count":6,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1811\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1811\/revisions\/1823"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}