Mesh generation

This post is less about some specific information and more about something I've been cooking up over at

When working in 3D everything is made out of meshes. In their simplest form these are big lists of positions that get fed into the GPU for rendering. These lists can be generated or loaded from disk. Most games save a large amount of data in models that make up generic objects like rocks and trees. These typically are generated but then get baked into a game's download and can never change.

Instead, imagine if in an engine you only had to define the bounds of objects and their types, then the engine generated them when needed. I think this would make rouge likes and single player games look more interesting many playthroughs in because the repeating rooms could use differently generated base assets.

That is an end goal for what it's worth...

Right now, to start with something I've compiled an incomplete list of the generation algorithms that I've needed. This only consists of primitive shapes for now, but I think it will still prove useful because every time I need another shape I spend a long time searching on forms but only end up with bits and pieces. To try and help alleviate the pain of making these in the future, I've cleaned up some popular algorithms and added comments that clear up the oddities within them.

Let me know if you have any suggestions, there are more shapes that I want to add but I also want to open it up for people to add their own algorithms. Then expand into more complex meshes, like a rock generator or foliage generation.


2 replies


Thank you so much!! it’s a bless that you are here, I was really struggling with procedural mesh generation especially rounded one’s like capsule’s, I was wondering if you’ll do things like rounded boxes or rounded polygons?


Thanks! Sorry to take so long to reply, I’ve been bogged with the beginning of the semester. I’ve been meaning to loop back to this, but I’ve been sidetracked by this sand engine stuff and it doesn’t require any mesh work. When I get back to the next 3D project, I am going to use this to hopefully generate more complex procedural assets like foliage. I do want to expand the website!

Leave a Reply

Your email address will not be published.



Support with your eyes. I enjoy writing these posts and editing the videos that go along with them. It is very satisfying reading the comments and seeing people enjoying and hopefully learning something from what I make. Sign up to get an email notification for whenever I make a new post. It seems like my pace is around once a month, so don't worry about spam :)


Did you know I make video version of these posts? Check out the 5-10 minute condenced versions over on YouTube. I end up putting about the same amount of time into them as the posts themselves, so would appreciate a view!


Over on Twitter I post updates about videos while they're being made along with other random thoughts. If that sounds more your speed, I'd appreciate a follow :)