[WIP] Procedural fractal mesh generation

Hi everyone!

Like a few other people here I have been learning how to generate meshes using code (C++), and my goal is to use fractals to aid in generation of various assets.

I’m building these as part of a toolbox I need to work on a hobby VR project, which relies heavily on procedurally generated landscape and world assets.

I recently moved my code over to using the ProceduralMeshComponent that ships as part of Unreal 4.8, and managed to get a nice speed improvement from that.

I still have a fair way to go but already got some nice results so I wanted to start a thread to show my progress as I go through this.

I have made a few simple generators, like the Sierpinski triangle and one version of the pyramid.

Recently I tried setting up a branching generator that can be use to generate tree-like meshes, and will use the basis of that for my landscape generation as well (nothing to show there yet).

I haven’t finished the stitching logic that connects the different sections together, so you can see visible gaps in the thicker tree example below.

Here are a few pictures to start off with, I hope you like it and it would be great to hear if anyone here is doing similar things :slight_smile:

Some of the tasks I’m working on next:

  • Stitching logic for branching generator
  • Different UV mapping options
  • Figure out a better way to not save the generated mesh with the maps (data gets HUGE!). Only way I’ve found so far is mark parts of the ProceduralMeshComponent as Transient.
  • Figure out a way to snapshot these into static mesh assets (going to be useful for instanced mesh rendering)
  • Fast way to animate these, stream vertexes to the GPU
  • Consider GPU-based generation
  • Landscape generation, using branching generator as basis for subdivision of a skeletal structure
  • L-System parser and generator
  • And more types of fractals

Sierpinski Pyramid built with lines (will do a filled version soon)

One of the first tests of my branching generator

And a few example “trees” and coral-like structures

Example settings for the branching generator. It’s fast enough on my computer that it’s pretty much realtime in the editor when changing values. I’ll try to update a gif example of this later on :slight_smile:

That is neat.


wow, this is really pretty amazing.

wow nice :cool:

This looks awesome!

I look forward to the day when we can generate/manipulate fractals in-game, in real time, sort of like Fractal Lab

Looking forward to more :wink:

This looks great!

Hi SiggiG


Do not forget a way to generate foliage, vines (leaves) and interactive deformation using deformation tools like bend, twirl, twist, taper, scale and bones for trunks, branches, and physics (wind and gravity influence). And you will be at the cutting edge!


dude this ***** insane lol imagine the particle effects you could make with this

i know C++ but i dont have a compiler nor VS2015 lol so i cant really work on something like this unless i do it in blue prints

Could we have a download for this?

This is something I am really interested in, more for an abstract exploration type game than for generating assets. I’m a model maker mostly so I’m not interested in fractals for generating assets, I’m content to make them by hand however the potential for fractals is to be able to generate real-time, as they are needed, allowing for infinite levels or levels that morph real time! Anyone here done anything with fractals they wish to share or want to work together towards this goal?

How do you do this! I want it

+1 to MarketPlace !!

Hi all,

I’m back to working on my personal projects again. Rewriting this + examples on how to make procedural meshes as a plugin. Planning to publish it for free on Github.

I’ll give you an update soon once I have something to share… planning on doing a simple release and keep adding more stuff to it. Could even accept other contributions if more people are interested.

you are a saint :slight_smile:

I’ve posted the code as a plugin for free here: Procedural Mesh Examples - free! - Community Content, Tools and Tutorials - Unreal Engine Forums!

Amazing thing, for sure.
I am working on procedural mesh generation for some time now. So far I am trying to use libnoise to produce a landscape that is stored in a mysql table to be loaded as hightmap during runtime. It’s a little ineffective, but for a big deal it is about landscape being able to change during the game (eg: Dig into the ground, erosion with time …). At the same time it’s a reason for me to learn my way around unreal engine and c++ programming (I’m pretty familiar with blueprints by now, but c++ is yet another thing). Fractals are something that really could add to the look and feel of a procedurally generated world. That is how I found this threat.
Some months ago I had a few tries using splines to have trees growing at runtime, but could not find a way to have them grow in a performant way. I see fractals could also be a possibility there.
I am definately looking forward trying out your code and see where it gets me.
Seeing it’s been a while since the last post in this threat: Any updates on the work with fractals in UE?

I will be posting most of my updates in the other thread (linked above), where I’ve released my code on Github.

I’m about to push out an update to my examples that uses Koderz’s excellent Runtime Mesh Component that runs a lot faster. I should get that finished around end of this week.

I’m also working on some new examples that uses noise and branching functions to generate a landscape and planning to add that to my example project too.