Making realistic 3D trees 19.12.2024 Santeri Valkama Lapland UAS Blog Publisher keywords Forestry Simulations The Northern Factors – Professionals Blog Publisher: Lapland University of Applied Sciences Ltd, Jokiväylä 11, 96300 Rovaniemi, Finland ISSN: 2954-145XPublications are licensed under CC BY 4.0 Contacts: viestinta@lapinamk.fi Santeri Valkama is a Specialist in 3D-modeling and 2D-graphics Frostbit software laboratory in Lapland University of Applied Sciences. The FrostBit Software Lab at Lapland University of Applied Sciences is developing a simulator platform from the ground up to advance the development, training, and validation of autonomous driving and safety systems for forestry usage. The development work is enabled and resourced by the AGRARSENSE project which includes several use cases for agriculture and forestry. Lapland University of Applied Sciences is part of forestry use case which is led by Komatsu Forest AB. Creating realistic 3D trees for the AGRARSENSE project required a blend of artistic vision and technical expertise. In this article, I’ll go through how I used Blender—a free open-source 3D modeling software renowned for its comprehensive toolset, including modeling, sculpting, and add-ons. — To do the models of the trees. And how I used Adobe’s Substance Painter, Substance Designer, and Substance Sampler—that are industry-standard tools for texturing. — To create lifelike and realistic textures for the 3D models I made in Blender. Why Blender? While crafting realistic 3D trees, we explored alternative tools and workflows that might make the process easier. One such option was SpeedTree, a powerful software specifically designed for creating high-quality trees for games, films, and simulations. SpeedTree offers advanced features and is the top tool for making trees. However, due to the licensing terms of SpeedTree, we couldn’t use it for this project. The AGRARSENSE requires us to share models across partners and use cases, and SpeedTree’s license prevents unrestricted distribution of its assets. This constraint led us to develop a custom pipeline using Blender and Substance tools. Although more time-intensive, this approach allowed us full control over the workflow and ensured the assets could be freely shared with interested partners. It also gave us the flexibility to tailor every detail of the trees to our needs, balancing realism and performance without any licensing limitations. My pipeline for creating realistic 3D trees 1. Research and Gather References The first step in my process was to understand the type of tree I wanted to model. Whether it was pine, spruce, or birch, I carefully studied each tree species. Understanding the structure, bark, and leaves in detail was essential to accurately recreate them. To get accurate references, my team and I visited forests and took numerous detailed photos of trunks, branches, and leaves from different angles. These photos served as visual references for modeling and were also instrumental in creating realistic textures. Combining firsthand observations with additional images and research provided a solid foundation for both the 3D models and their accompanying materials. Picture 1 Forest reference material picture 2. Using the Sapling Tree Gen Add-on Blender’s Sapling Tree Gen add-on played a key role in creating realistic tree structures. This powerful tool enabled me to generate procedural models. It allowed me to accurately replicate the natural characteristics of the specific tree species I was modeling. Adding Leaves: I customized the shape, scale, and density of the leaves to reflect the specific tree species. For added accuracy, I modeled custom leaf shapes when the default options were insufficient and integrated them into the add-on to ensure the leaves matched the real-world tree as closely as possible. Converting the Tree to a Mesh: Once I was satisfied with the structure, I converted the procedural tree to a mesh. This allowed me to manually refine the geometry, adding finer details to branches and making any necessary adjustments. Picture 2 Blender sapling tree gen add on 3. UV Mapping the Tree focusing on trunk and larger Branches After completing the tree’s structure, I moved on to UV mapping. UV mapping is a technique used in 3D modeling to project a 2D image (a texture) onto the surface of a 3D object. It’s a critical step in the 3D art pipeline that ensures textures are accurately wrapped around the geometry of a model. U and V: Represent the 2D coordinates used to map a texture to the 3D model. Unlike the X, Y, and Z axes in 3D space, U and V define the horizontal and vertical directions of a texture on a flat plane. During the UV mapping for the trees I allocated more space to the trunk and larger branches, as these are the most visible parts of the final tree. This approach ensured that the textures for these areas were detailed and seamless, significantly enhancing the overall realism and visual quality of the model. 4. Creating Trunk, Branch, and Leaf Textures Processing in Substance Sampler: I imported the photos from reference materials into Adobe Substance Sampler to create base materials. The AI-driven tools in Sampler allowed me to transform the photos into materials. I carefully fine-tuned these textures to remove inconsistencies. Refining in Substance Designer: For more precise adjustments, I imported the materials into Substance Designer, where I refined the textures further: Ensuring seamless tiling for the bark textures. Enhancing depth by refining normal and height maps. Designing custom patterns for the leaves, ensuring they closely matched the tree species. Exporting the Final Textures: Once complete, I exported the textures, ready for application to the UV-mapped tree model in Substance Painter. Picture 3 real birch tree trunk and the texture I made 5. Exporting the UV-Mapped Model to Substance Painter Once UV mapping was finalized in Blender, I exported the tree model as an FBX file for use in Substance Painter. In Painter, I created a new project and set the document resolution to 4096 x 4096, ensuring a balance between detail and performance. 6. Texturing in Substance Painter Applying Base Textures: I imported the bark and leaf textures created in Substance Sampler and Designer into Substance Painter. These were applied to the tree’s trunk, branches, and leaves. I aligned the textures to the UV map using brush tools to ensure seamless coverage. Fine-Tuning Materials: To enhance realism, I adjusted material properties like roughness and height. For areas where branches intersected with the trunk, I used masking tools to blend the textures naturally. Adding Details: Using brushes and smart masks, I added details such as cracks in the bark, subtle moss, and dirt. These elements gave the tree a weathered and lifelike appearance. Picture 4 substance painter texturing a birch tree 7. Exporting the Tree Model and Textures to Unreal Engine Exporting Textures: I exported the textures, including Base Color, Normal, Roughness, and Metallic maps, in PNG format. Exporting the Model: The tree model was exported as an FBX file, ensuring proper scale and clean geometry for optimal performance in Unreal Engine. Importing into Unreal Engine: In Unreal Engine — which is a 3D computer graphics game engine and creation tool that we use as a base for the project — I imported the model and textures and set up materials in the Material Editor by connecting the exported texture maps to their respective inputs. For the leaves, I enabled Two-Sided shading to achieve a natural look. Leveraging Nanite for Detail: Unreal Engine’s Nanite technology allowed me to maintain an exceptionally high level of detail in the tree model without compromising performance. This made it possible to include intricate geometry and textures, ensuring the trees looked lifelike even in large-scale forest environments. Finalizing the Tree Model With the tree placed in Unreal Engine, I tested its appearance under various lighting conditions and scenes. Any necessary adjustments were made to materials, textures, or geometry to ensure performance and realistic trees. This process resulted in a tree model that balances visual and efficiency, staying true to the natural form of the species while being ready for use in AGRASENSE project. Picture 5 What it looks like in the game engine and project