# Simple Procedural Planets - BP only

**URL:** <https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675>\
**Category:** Game Development\
**Tags:** unreal-engine\
**Created:** [July 22, 2016, 9:56pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675 "2016-07-22T21:56:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 22, 2016, 9:56pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/1 "2016-07-22T21:56:24Z")

</div>

\*\*UPDATE - not BP only - includes Custom C++ Blueprint Function Library \*\*

Allright. As I can see there’s a different project doing exactly the same with BP. No reason to continue working on this kind of thing I guess. You can get a BP procedural planets free there, so I’m out with this one.

…

I mean, I done with BP only approach. Started to work with C++ this week so I can use different noise functions, and run generation process on different CPU thread.

What I have done so far:  
Full C++ grid generation and Noise implementation for Fractal Value, Gradient, Cellular, Simplex.  
Custom made (still WIP) normal calculation which is much faster than the one from Procedural Mesh.

Next step is moving all the functions to different CPU thread so there is absolutely no FPS drop during planet generation.

Basically, a segment of 256x256 poly is generated in about 800 ms.

Screenies:

 ![Planet0.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/0/6026c0b277baac09e7243a6657926580ebf9a7af.jpeg)

 ![Planet1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/1/c146e234311f39e1d3b5297ca571aa088f4462c6.jpeg)

 ![Planet2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/a/8/a8b7ca3e8003b9bcafe1165d453876b4e98a6339.jpeg)

Yep.

# =========================================================================== Old version.

Well, not really BP only as I’m using a plugin, but about that - later.

So many people and games are using procedural generation now, specially space games, Dual Universe, Star Citizen, No Man’s Sky, so on, so forth.

And I though, if they can do it, so can I! (ofc “do it” not that complicated as the titles above “do it”).

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/2/9/9291b38a1ec7f5fbc635a8c039d11ea660e977a3.jpeg "Procedural Planet Test 2 - Unreal Engine 4") ](https://www.youtube.com/watch?v=o5KJGbID1nU)

So, started from a grid of points, and then moved it, copied it per side (6 sides, as a cube) and normalized it. Then added Simplex Noise combinations (HUGE thanks to \*\*DevDad \*\*for that plugin [Simplex Noise](https://forums.unrealengine.com/showthread.php?94847-Plugin-Simplex-Noise-1D-2D-3D-4D-Fast-Perlin-Noise-Version)

Every noise layer also creates a vertex color, 3 layers for 3 colors so far. It takes more less 3 seconds to create a 128x128 quad, there are like 96 quads per planet (values can be changed) biggest I did was 256x256 polys per quad and 8x8 quads per planet’s side.  
So, that’s roughly… 256x256x64x6 = 25 165 824 polygons. Performence was, well, not bad. But it took ages to generate. So, I decided I’d SAVE that planet to a game save. Worked. Now after a first run the planet is saved and I can load it inside the editor or on the beginning of a game. Works pretty nice. Problem is a saved planet that size is 720 MB. The one you see in the video is 320 MB. No LOD yet, but the performance is amazingly good here.

Still, it would be AWESOME to have that load or generate on a different thread. Or something.

Anyways, This is how I’m killing time waiting for No Man’s Sky here. Might even consider putting that Blueprint to Marketplace later, when I finish the atmosphere shader and some other things, like rocks placement, forests and water… And such… And LOD… And gotta ask DevDad for a permission to include his plugin… Or something.

God, how I love Unreal!

What do you think?

---

<div class="post-metadata">

**Author:** ![Higuy8000](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Higuy8000](https://forums.unrealengine.com/u/Higuy8000)\
**Post date:** [July 22, 2016, 10:06pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/2 "2016-07-22T22:06:05Z")

</div>

Wow, looks awesome! Great results! I cant wait to see what else you do with it.

---

<div class="post-metadata">

**Author:** ![ioFlow\_Studios](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ioflow_studios/32/1194555_2.png) [@ioFlow\_Studios](https://forums.unrealengine.com/u/ioFlow_Studios)\
**Post date:** [July 22, 2016, 11:12pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/3 "2016-07-22T23:12:52Z")

</div>

Well done, looks real nice 🙂

---

<div class="post-metadata">

**Author:** ![Mr\_SquarePeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr\_SquarePeg](https://forums.unrealengine.com/u/Mr_SquarePeg)\
**Post date:** [July 22, 2016, 11:26pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/4 "2016-07-22T23:26:18Z")

</div>

This looks really nice.

I have some questions though.

1. How big is this planet?
2. Would it be possible to show a Wireframe of the Quads? I am curious to how dense the meshes are.
3. Look into using the [Run time Mesh Component](https://forums.unrealengine.com/showthread.php?113432-Runtime-Mesh-Component-Rendering-high-performance-runtime-generated-meshes!) It should load your Quads Faster.
4. What are your plans for this? Do you plan on open sourcing it or selling it?
5. Is this compatible with the BP to C++ toolset? If so you should get a performance boost from that.

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 23, 2016, 12:03am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/5 "2016-07-23T00:03:22Z")

</div>

> [@HeadClot;569344](#):
>
> This looks really nice.
> 
> I have some questions though.
> 
> 1. How big is this planet?
> 2. Would it be possible to show a Wireframe of the Quads? I am curious to how dense the meshes are.
> 3. Look into using the [Run time Mesh Component](https://forums.unrealengine.com/showthread.php?113432-Runtime-Mesh-Component-Rendering-high-performance-runtime-generated-meshes!) It should load your Quads Faster.
> 4. What are your plans for this? Do you plan on open sourcing it or selling it?
> 5. Is this compatible with the BP to C++ toolset? If so you should get a performance boost from that.

1: You can scale it freely any way you want, there’s also a radius variable which defines the… Radius.  
2: Sure. The density is actually a matter of setup, you can make it as dense as you want really. For safety measures (as first generation process is quite heavy and slow) I set the MAX amount of quads to 8x8 per side (6 sides total) and max quad squares to 256x256. But that’s a limit that can be easily changed.

![49d68eefcba664befbff6c8e9b36b160aa397a48.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

- simple mesh, on the right you can see how many quads (squared) it generates and how many faces (squared) per quad.

![8629a189329ec687748264528329de8092b562c6.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

- the planet from the video - 4x4 quads per side, 128x128 polys per quad. (6 sides x 4x4 x 128x128 = amount of faces \* 2 = amount of triangles)

![3404a4d6a7341d6ad46c9fb9911798f3e8e552da.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

- biggest I saved so far - 8x8 quads and each 96x96 faces. 720 MB save.

![9a056027b311c0dabb458d615de93c4718d3a8e4.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

- this is a single quad I made it possible to build - 8x8 quads, 256x256 faces. Tried to generate once a planet like that, well, can’t remember the save size but was way too big.

3: Sure will do! Thanks a bunch mate!

4: Well, probably will try creating a simple game for Android with this, like, a space exploration, mining and trading game, maybe something bigger for PC as well but that - meh, dreams XD  
Sourcing / selling. That depends how this goes. If the script ends up really good I might consider just giving it free. Or through the Marketplace. Bit gotta speed things up and optimize it a lot.

5: If I’m able to do the basic math (vector grid generation) through C++ (which I can’t for now) then this might be something worthwhile.  
It IS BP wise only. But uses a plugin made by DevDad, I have no idea how C++ conversion from BP to C++ with that toolset works.  
Heaviest here is calculating Tangents and Normals for quads in the Generation pass…

Okay, how that works: First you gotta generate a planet - that is amount of quads and faces, set up everything in the noise, and such.  
Then you checkbox SaveToFile box.  
When you hit PlayInEditor the game generates quads. It’s about 3 seconds for a 128x128 polygon quad to 20 seconds for 256x256 quad. So, if you have 64 quads 256 size, it’s 21 minutes per planet’s side. And there are 6 planet sides. 2 hours straight for full res planet.  
But!  
When the first generation pass is over it saves the result to a file. A simple SaveGame file. The load process is fast and easy, but the files are big. You can also load the planet in the editor through Construct Script.

Anyways, gonna check this Run Time Mesh Component, see how that goes. Thanks a bunch!

---

<div class="post-metadata">

**Author:** ![BrUnO\_XaVIeR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bruno_xavier/32/1110230_2.png) [@BrUnO\_XaVIeR](https://forums.unrealengine.com/u/BrUnO_XaVIeR)\
**Post date:** [July 23, 2016, 12:08am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/6 "2016-07-23T00:08:11Z")

</div>

This looks promising, very cool.

---

<div class="post-metadata">

**Author:** ![Mr\_SquarePeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr\_SquarePeg](https://forums.unrealengine.com/u/Mr_SquarePeg)\
**Post date:** [July 23, 2016, 12:47am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/7 "2016-07-23T00:47:47Z")

</div>

Hey @Z-enzyme,

This may also be of interest to you - It was posted in the [runtime mesh component thread](https://forums.unrealengine.com/showthread.php?113432-Runtime-Mesh-Component-Rendering-high-performance-runtime-generated-meshes!/page2). The Runtime Mesh Component is also free if I recall correctly.

> [@Koderz;569241](#):
>
> As a heads up to everyone currently using the RMC or thinking about using it!
> 
> First, the RMC is now on the Marketplace, and is now also downloading correctly for those of you who attempted to download it when it first went up and were unable to. The marketplace version is the same as the current released version on github (not the master branch source).
> 
> Version 2 should be out in about 2-3 weeks if all goes to plan, with some of the following either already in github, or showing up incrementally over the next couple weeks. Version 2 will, hopefully, bring the remaining tools from the PMC over including normal/tangent calculation, RMC \<-\> StaticMeshComponent conversions, and hopefully tessellation support. There’s also a decent chance that it will have the initial round of improvements for collision cooking. Unfortunately though as those have taken multiple engine changes, it will require a source build of the engine at least until Epic hopefully merges part/all of it back into mainline UE. So far the collision cooker can be operated in its current game thread only mode but allow for some control over the quality of the cook cycle. There’s a trade off between quality and speed of cooking, with lower quality cooked meshes being a little slower in the actual collision detection but this alone allows it to run up to ~6x faster. It should also support nearly full multithreaded cooking to move most of the work off the game thread.

That should help you out allot 🙂

More Questions -

1. Are there any Plans for a Solar System Generator with this included?
2. Are you doing collisions at all with BP procedural planets?

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 23, 2016, 1:02am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/8 "2016-07-23T01:02:55Z")

</div>

Already downloaded the RMC, tried it, the mesh generation speed isn’t noticeably faster. Most time takes the calculation of tangents and normals (and that RMC will have in it’s next release) so I will wait patiently for that.

Also, tessellation? That should help a lot! Thanks @HeadClot.

As for questions:

1: Nope, the generation is way too slow, well, maybe, for not very detailed planets that can work. Actually, not a bad idea. Yea. I think that at some point I’ll try…

2: Yep. Each quad is separate procedural mesh with collision. No idea how that really works but never flew “inside” the planet. So, guess it works.

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 24, 2016, 4:41pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/10 "2016-07-24T16:41:54Z")

</div>

A little update.

Created a crater system, it’s slow but works, seed driven. Here’s a screenie of 2 planets with a single crater, but big.

![71fe19f10d8618249be6aa1d8dfe90c2a579dadb.jpeg](https://d1ap1mz92jnks1.cloudfront.net/images/transparent.png)

---

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [July 24, 2016, 6:29pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/11 "2016-07-24T18:29:11Z")

</div>

Looks great! keep it up, I’m always interested seeing what people can do with procedural geometry.

Have you looked into quad trees? that could work pretty well for this.

[![]( " - YouTube") ](https://www.youtube.com/watch?v=wCB45GQlaDE)

I have a quad tree implementation in the works, meant for an infinite ocean plane but the same logic can be applied for dynamic terrain and pretty much everything of that nature, it’s pretty cool.

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 24, 2016, 6:52pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/12 "2016-07-24T18:52:41Z")

</div>

@TK-Master Wow, oh my. I’d totally would love to use that. Problem is I’m using procedural mesh component. I’m making my own grid of vectors, spherify them and offset them though simplex noise. No idea how to implement this kind of thing there. I’d have to take the high res grid I’ve got made with vectors and make lower res quads with that info to keep the noise persistent.

I’m doing everything in Blueprints so it’s kind’a slow.

---

<div class="post-metadata">

**Author:** ![TK-Master](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TK-Master](https://forums.unrealengine.com/u/TK-Master)\
**Post date:** [July 24, 2016, 7:42pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/13 "2016-07-24T19:42:11Z")

</div>

It might not be that fast if implemented via blueprints but I can’t think of a reason why it would not be possible.

You can find multiple articles and guides about quadtrees in google if you want to research this further.

I would start by creating 6 quadtree grids, spherify them, offset them via noise etc. It’s the same thing as you are currently doing really, it’s just how you generate the initial grids that’s the tricky part.  
The nice thing with quadtrees is that you can skip generating any grids outside the camera frustum and “subdivide” the grids based on pixel coverage so the vertex wastage is pretty much as little as possible, it’s very efficient.

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 26, 2016, 1:54am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/14 "2016-07-26T01:54:34Z")

</div>

A little update.  
Got the proper atmosphere working! Material is pretty hard to set up right with different planet sizes but I guess it works. I need to do some testing.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/0/bf0493a455e962f00dfad89f5dfa0c9e449b43e0.jpeg "Atmosphere for procedural planets - Unreal Engine 4") ](https://www.youtube.com/watch?v=yFhXcU3wzeA)

---

<div class="post-metadata">

**Author:** ![Mr\_SquarePeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr\_SquarePeg](https://forums.unrealengine.com/u/Mr_SquarePeg)\
**Post date:** [July 26, 2016, 4:22am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/16 "2016-07-26T04:22:38Z")

</div>

Ok, that atmosphere material is really cool 🙂

---

<div class="post-metadata">

**Author:** ![zeOrb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zeOrb](https://forums.unrealengine.com/u/zeOrb)\
**Post date:** [July 26, 2016, 8:24am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/17 "2016-07-26T08:24:56Z")

</div>

Heh, moment of transition from outer space into atmosphere is fantastic!

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 26, 2016, 9:36am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/19 "2016-07-26T09:36:58Z")

</div>

> [@franktech;570775](#):
>
> WTF??? … The talent level on the UE4 forums is mind blowing!

O \*\*\*\*! I totally forgot about it! I am a game designer already, quit teaching half a year ago 😛

> [@zeOrb;570760](#):
>
> Heh, moment of transition from outer space into atmosphere is fantastic!

You won’t believe but it’s a single lerp from distance to the planet that just changes power and multiply of the shader 😛

---

<div class="post-metadata">

**Author:** ![Ali\_Akbar](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ali_akbar/32/1008648_2.png) [@Ali\_Akbar](https://forums.unrealengine.com/u/Ali_Akbar)\
**Post date:** [July 26, 2016, 11:03am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/21 "2016-07-26T11:03:33Z")

</div>

@Z-enzyme Awesome work! I love the crater system and atmosphere

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 26, 2016, 12:10pm UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/22 "2016-07-26T12:10:31Z")

</div>

> [@franktech;570804](#):
>
> Well kudos, it looks great so far. Feel like saying any more?  
> Are you at a Triple-A studio or starting your own shop etc???

Long story xD and no, I’m not in a triple A studio, just starting in an small indie studio with a little sponsoring.

Long story short.

Started coding with the first Unreal script back in 2000. But I do graphics mostly, animations and shades for Unreal. Been teaching English for 10 years cause that was the only thing I could do pretty well. Failed my maths and physics maturity test lol so couldn’t study computer technology or programming.

Well, yeah.

---

<div class="post-metadata">

**Author:** ![Z-enzyme](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z-enzyme](https://forums.unrealengine.com/u/Z-enzyme)\
**Post date:** [July 29, 2016, 12:00am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/24 "2016-07-29T00:00:59Z")

</div>

Ha, a little update. Now, after a planet is generated you can save it in your map in PlanetData variables, it’s not a mesh but only mesh data which is regenerated in just few seconds after the game starts. So, I can stream it now! No need for savegames to store planet data!

---

<div class="post-metadata">

**Author:** ![Mr\_SquarePeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr\_SquarePeg](https://forums.unrealengine.com/u/Mr_SquarePeg)\
**Post date:** [July 29, 2016, 1:07am UTC](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675/25 "2016-07-29T01:07:28Z")

</div>

> [@Z-enzyme;572477](#):
>
> Ha, a little update. Now, after a planet is generated you can save it in your map in PlanetData variables, it’s not a mesh but only mesh data which is regenerated in just few seconds after the game starts. So, I can stream it now! No need for savegames to store planet data!

Got to admit this is a super cool update 🙂

[Next page](https://forums.unrealengine.com/t/simple-procedural-planets-bp-only/69675.md?page=2)
