PCG Forests
Unity, C#Repo Link
This project was a part of my masters degree. The aim of the project was to research techniques that can be used to procedurally generate foliage and forests that could be used in video games to simplify the process of designing and creating forests.
The three main components of this were L-Systems, Poisson disc sampling and Perlin noise. L-Systems are a string rewriting system which can be used to describe the behaviour of plant cells and model their growth. By using each character from the string provided by an L-System as an instruction for a turtle, a simple diagram of a plant can be produced. By then generating a mesh around these points, a 3D model for the resulting plant can be created. Additional randomness can be added to this system to produce plants that are very similar but have slight differences when using the same L-System.
Poisson disc sampling and Perlin noise were used to place generated trees in an area. Poisson disc sampling is a space filling algorithm that can be used to place a large number of objects randomly in an area without it appearing uniform. By itself, this can create a nice looking forest, however, when using a noise function to create a density map for the area, you can create forests that have areas where the trees a placed more tightly with other areas having a lot less trees.
Overall, this was probably my favourite project from my masters degree as I feel like accomplished the most in it, however, there are a number of improvements that I feel could be made. For example, I didn’t create my own L-Systems so I needed to use those available online making it difficult to find 3D systems which resulted in me adding additional rotations at certain points making the systems look worse in some situations. Additionally, the mesh generation for the L-System wasn’t very good which resulted in trees with weird looking branches.