FYP Part 3 – Subdivision!

Jacob Keane Blog, Uncategorized

One of the aims of my project was for the planet to look convincing from far away in space, all the way down to the surface. This means that I needed to create some Level of Detail system. Since I’m using a Sphere-Cube system, I can split each face recursively, into a QuadTree! This means each face will be split up into four quarters, which can then further be split up, etc.

An Example showing the top face being recursively split up.

This was fairly easy to get working!

 

However, the system needs to be dynamic! At this moment, this is just manually triggered by pressing a “Subdivide” button. It needs to dynamically subdivide (and combine/cleanup!).

To do this, I added a second component that looks at the camera, compares it to the current segment, and decides if it needs to go up / down a level of detail.

This is currently based off the distance the camera is away, and how many subdivisions the current segment is deep. However, I shall probably adjust it in the future, likely taking into account the direction the camera is facing, it’s current velocity, and more factors.

Now, with the subdivision happening dynamically, it’s apparently there’s issues with the generation speed. At the moment, it all runs on the main thread, which causes Unity to lock up whenever the mesh or texture is being generated. This obviously is not acceptable, and will be the next thing ┬áthat I work on!