Procedural Planet Mesh Generator (GPGPU)

TL;DR: https://procedural-planets.vercel.app/

Hello, I want to share my recent personal project, a procedural planet mesh generator. Unlike the other implementation, mine uses compute shaders to calculate vertex positions based on the parameters. So, the generated planet can be exported to .obj.

CPU Implementation

In the beginning I naively tried to create the mesh on the CPU which is pretty laggy especially if the resolution is high (waited around 12 secs at resolution 360). At this point, I encountered with compute shaders which is what I was looking for. However, since WebGPU is not widely supported, I decided not to use it.

Fake Compute Shaders

At this point, I noticed my fragment shaders are already doing highly parallel computations. So, I mapped the pixel value to vertex height in my mesh. This immediately sped thing up and my project is usable now.

Github: GitHub - XenoverseUp/procedural-planets: A procedural planet generation tool written in WebGL, ThreeJS. It uses multiple layered Simplex noise to generate terrain.
Live Demo: https://procedural-planets.vercel.app/

Let me know if you have a feedback or noticed an improvement.

Thanks for reading.

6 Likes

Looks awesomme!!
The generation is nice and fast! Could totally see this in a game.
Very cool.

1 Like

Thank you for lovely comments!

1 Like

Awesome work, I’d like more zoom control in the preview and sliders on the UI configuration panels, but as it is, it is very cool. If I remember correctly Sebastian League implemented per-latitude colouring and in advanced demos even erosion.

1 Like

Thanks for the lovely comment!

Actually, there was a zoom option in the panel and trackpad gestures. But eventually I decided to remove it as I had to tackle with the animation and responsiveness, which was not the main focus of the project. You can still find that version on GitHub commit history, tho.

And yes. Sebastian Lague’s version included biomes and a bunch of other things. I am planning to improve my current iteration in the future with those and some custom extras.

1 Like