Procedural Trees a C++ Production Tool for Realistic Tree Generation
For the final project for Brown's Graphics course, I teamed up with Brad Guesman and Eddie Jiao to explore procedural generation for realistic branching and leaf structures. Focusing on input parameters and stochastic systems, we sought to give users versatile and flexible control to generate unique trees.
Our main branching structures were based in L-Systems, a mathematical representation of fractals through different levels of recursion. This allowed us to generate different types of tree structures based on specific rule-sets similar to varying tree species.
Since a standard L-System generates a string representation of branching structure, we implemented a pipeline that parsed the string into intermediate data structures containing object data for each respective branch unit. This was a key factor for not just building the initial structure from the L-System, but allowing for different parameters to affect the structure as well, such as length, orientation stochasticity, and even our gravity simulation.
To create even more photorealism, we added Linear and Exponential Branch-Tapering. While Linear Tapering took into account the entire tree depth and linearly interpolated branch radii accordingly, Exponential Tapering recursively affected each branch from the root by applying a radial decay factor raised to a power of each structures's respective branch depth.
We even added leaves, which was made a lot easier by our underlying data structures, allowing us to treat them like the other branches. However, instead of rendering a cylindrical branch, we would render a 2D hexagonal plane. These leaves are then controlled by a Leaf Density factor that would add more leaves based on the parameter and branch depth.
Finally, aiming to make our application a full-fledged production tool, we implemented the ability to export the entire tree mesh as .obj files to be used in industry-standard 3D software such as Maya and Cinema4D. We chose to export the branch and leaf structures as separated .obj files to allow for easier UV-ing and shading.
Here are some of our renders using the Arnold Renderer and Maya!
** I cannot publicly share the repo of the code for academic code purposes - Contact me for access! **