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
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