PGD Home

P-152: Virtual World Concept Update 122: Planet-sized Terrain

by on May.29, 2016, under Astral Realms, P-0, Software and Games, Spiritus Astrum

The next step with my spherical terrain is to scale it to the size of a realistic planet. Using Earth as an example, the terrain will need to have a diameter of 12,742 KM, or a radius of 6,371 KM.

This is one of the final end goals of this project, and should be quite a challenge.

Not only will I have to somehow render a huge object, I will also need to incorporate some kind of floating origin system, as I previously discussed, to prevent floating point precision issues.

The first thing that I needed to do was to remove the assumption in the code that the center of the terrain was at the origin. This is now done, and the terrain can now be moved while the player stays close to the origin.

P152_DEBUG 29/05/2016 , 02:54:37 AM Torque 3D MIT - P152

I had some issues with the textures, but these were solved.

The next thing I did was to scale the terrain to a realistic height, and place it such that the surface of the terrain passes close to the origin. These were the results:

P152_DEBUG 29/05/2016 , 03:29:59 AM Torque 3D MIT - P152

P152_DEBUG
29/05/2016 , 03:29:59 AM
Torque 3D MIT – P152

P152_DEBUG 29/05/2016 , 03:25:45 AM Torque 3D MIT - P152

P152_DEBUG
29/05/2016 , 03:25:45 AM
Torque 3D MIT – P152

The first image is of the terrain scaled to a realistic Earth size, the second one is of the terrain moved from the origin, but not scaled to Earth-size.

From these images it is clear that there is some kind of texture distortion going on. The terrain also looks smaller than it should. I suspect what is happening is that the very large numbers that I am using are causing issues with the exact placement and scale of the terrain. Even though the player is at the origin, the terrain isn’t.

I will probably have to find some way to handle the terrain which doesn’t use any very large numbers. What I want to do, ideally, is select only the points on the terrain that are within 10,000 meters, and render them. This should be relatively simple, but unfortunately this causes other problems.

Firstly, The player should be able to see much further than that if they are at high altitudes, or in space. Secondly, rendering only those points close to the player would still require me to store a very large number for the radius of the terrain.

If I was to treat each polygon or the terrain as a single “object” (as opposed to being part of a “terrain” object), this would get much easier, since I could just use the world space position of each poly to do a simple distance check. If the entire planet was outside the 10k range, I could simply render the planet at 10,000 units, but scale it so that it looks further away than it is.

However, even with this system, I would first need to place the polygons in the world, which would require large numbers to be used for their positions.

I will need to do further research on this topic. I have found an excellent paper on the subject HERE which is useful. I will probably use a solution similar to the chunked level of detail system that I am already using for the terrain, I should be able to modify it to work with very large distances as well.

Facebooktwitterredditpinterestlinkedinmail

Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!