Creating Procedural Planets in Unity
Events
Subscribe:  iCal  |  Google Calendar
London GB   21, Jan — 23, Jan
Taipei TW   24, Jan — 29, Jan
Zürich CH   31, Jan — 4, Feb
Leamington Spa GB   31, Jan — 3, Feb
Bradford GB   6, Feb — 11, Feb
Latest comments
by Krzysztof Czerwinski
48 min ago

I bought it, it's really nice and intuitive:) Now i'm waiting for next build with new features:)

I love it!

by wongjoseph272@gmail.com
7 hours ago

Nice Post My name is Joseph Wong and thanks for sharing this information. Get the best Finance Assignment Help in Australia. Thanks.

Creating Procedural Planets in Unity
20 September, 2017
News

A little over a year ago Peter Winslow started procedurally generating low poly planets as a part of his Poly Universe project. The project is a now a full-fledged civilization building game set in a universe of tiny worlds. The developer decided to share some of the lessons he learned from the development process. The tricks here are about writing the code for Unity, using C#, but you could also use the techniques for other engines.

Here is a piece of the first part to get you interested:

Step 1 — Generating a sphere.

The first step in procedurally generating a planet will be to create a round ball that we can mold into the shape of a planet. There are (at least) two good ways of going about doing this, and each one has its own advantage:

Creating a round ball, either by subdividing an icosahedron, or a square.

In the picture above, I’ve taken an icosahedron (that’s it in the upper left corner — you might recognize it as a twenty sided die), and I’ve broken each triangle into four smaller triangles. Then I did that again for each smaller triangle, until I ended up with a nice round sphere.

Below that I’ve done the same process, but starting with a square. Each face is broken into four smaller squares, the vertices are pushed and pulled until they are all equally distant from the center. That process is repeated until I again have something that looks like a sphere.

So which way is better? If you’re looking to use this in your own game, here is where you need to make a choice about aesthetics. If you start with a square, you end up with a sphere that is extremely easy to cover with a tiling texture. The sides of the cube have been pushed outward to make it look like a sphere, but it’s still possible to paint a tiling texture onto each original ‘face’ and have a seamlessly textured planet.

The downside of this method is that the geometry is ‘pinched’ around where the cube’s original faces met, and some of the polygons on the sphere are noticeably bigger than others. Since I’m pursuing a textureless style for my own project, I was able to avoid these problems by starting with an icosahedron, which generates a sphere with nearly uniform polygons (albeit one that would be more difficult to texture seamlessly).

Peter Winslow

Make sure to read the full guide here

Source: medium.com

Leave a Reply

Be the First to Comment!

avatar
wpDiscuz