{"id":3156,"date":"2016-06-25T01:28:53","date_gmt":"2016-06-25T00:28:53","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=3156"},"modified":"2016-06-25T01:28:53","modified_gmt":"2016-06-25T00:28:53","slug":"p-152-virtual-world-concept-update-128-planet-sized-terrain-part-7","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-128-planet-sized-terrain-part-7\/","title":{"rendered":"P-152: Virtual World Concept Update 128: Planet-sized Terrain: Part 7"},"content":{"rendered":"<p>I have looked at the spherical terrain using the wireframe viewer tool in the T3D editor, and, when scaled to realistic planetary sizes, it seems that the remaining issues that I am seeing are due to Z-fighting.<\/p>\n<p>I think that given the huge distances involved, some of the vertices from behind the terrain (the other side of the planet) are being rendered in front of it. What I have been doing over the last few days is experimenting with various scaling factors and coordinate systems in order to come up with a way to reliably cull nodes that are not relatively close to the player. I believe I have succeeded in doing this, and it involves first changing the players scale so that it matches the terrain (the player is in 32-bit space, typical for an object in T3D, the spherical terrains nodes are between -1 and +1). Then, I scale both to by the radius of the planet (6137000 for Earth). I can then get the distance between them.<\/p>\n<p>I am tentatively hoping that by removing all but the nearest nodes, the Z-fighting issues will disappear (since the distance from the nearest node to the furthest is much less, and there are no no nodes in front of each other). This won&#8217;t really <em>solve<\/em> the problem, but it should eliminate any noticeable rendering issues. I can implement a better solution later. Since the player is close to the origin always, there should be no jitter at all.<\/p>\n<p>If this doesn&#8217;t work, I will need to find some way of translating the node position from 64-bit into 32-bit space. This is not just a simple case of scaling them down, since a simple scale operation would change the radius of the sphere, which would in effect change the entire terrain&#8217;s structure. I will probably have to do something like this eventually anyway, to completely solve the issues causes by the huge view distances.<\/p>\n<p>Even if this idea does work, I will still need to implement the floating origin system which will actually allow the player to travel around the surface of the terrain, and then I will need to implement the distance scaling algorithm that will provide a seamless surface-to-space transition fro the terrain.<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_3137\" aria-describedby=\"caption-attachment-3137\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_10_24-PM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-3137\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_10_24-PM-300x194.jpg\" alt=\"P152_DEBUG 20\/06\/2016 , 07:10:24 PM Torque 3D MIT - P152\" width=\"300\" height=\"194\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_10_24-PM-300x194.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_10_24-PM-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_10_24-PM-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_10_24-PM.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-3137\" class=\"wp-caption-text\">P152_DEBUG<br \/>20\/06\/2016 , 07:10:24 PM<br \/>Torque 3D MIT &#8211; P152<\/figcaption><\/figure>\n<figure id=\"attachment_3136\" aria-describedby=\"caption-attachment-3136\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_09_59-PM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-3136\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_09_59-PM-300x194.jpg\" alt=\"P152_DEBUG 20\/06\/2016 , 07:09:59 PM Torque 3D MIT - P152\" width=\"300\" height=\"194\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_09_59-PM-300x194.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_09_59-PM-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_09_59-PM-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_09_59-PM.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-3136\" class=\"wp-caption-text\">P152_DEBUG<br \/>20\/06\/2016 , 07:09:59 PM<br \/>Torque 3D MIT &#8211; P152<\/figcaption><\/figure>\n<figure id=\"attachment_3133\" aria-describedby=\"caption-attachment-3133\" style=\"width: 300px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_03_12-PM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-3133\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_03_12-PM-300x194.jpg\" alt=\"P152_DEBUG 20\/06\/2016 , 07:03:12 PM Torque 3D MIT - P152\" width=\"300\" height=\"194\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_03_12-PM-300x194.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_03_12-PM-768x498.jpg 768w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_03_12-PM-1024x664.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2016\/06\/PhoenixGameDevelopment-20_06_2016-07_03_12-PM.jpg 1922w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-3133\" class=\"wp-caption-text\">P152_DEBUG<br \/>20\/06\/2016 , 07:03:12 PM<br \/>Torque 3D MIT &#8211; P152<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I have looked at the spherical terrain using the wireframe viewer tool in the T3D editor, and, when scaled to realistic planetary sizes, it seems that the remaining issues that I am seeing are due to Z-fighting. I think that given the huge distances involved, some of the vertices from behind the terrain (the other [&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-3156","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\/3156"}],"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=3156"}],"version-history":[{"count":3,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/3156\/revisions"}],"predecessor-version":[{"id":3162,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/3156\/revisions\/3162"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=3156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=3156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=3156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}