
This was a project done for a shaders and rendering class in college. Back before I had a good grasp on things like “scope” and “deadlines”, my goal was to create a Unity editor tool that would procedurally generate ivy along 3D environment surfaces. What I ended up with is essentially a runtime dead bush generator.
Even though I didn’t have time to implement leaves and collision logic, this was one of my very first attempts at generating 3D meshes in Unity and was a very important milestone for me when it comes to procedurally generated content.
-The generation algorithm starts with a ‘seed’ position. This seed is added to the ‘ends’ list- as in the ‘ends’ of each branch.
-With every pass, each end grows slightly, taking into account things like maximum branch length and rotation/direction. All of these new positions are stored in a segments list, seen here as red dots.
-An end also has a chance to split into multiple branches. When a split happens, the current end is removed from the ‘ends’ list and two or more new ends are added at that position with a reduced diameter.
-Once the branch data is generated, the 3D mesh is created by giving each position 4 vertices, which connect to the 4 vertices of the neighboring segments.