Simple tree generator made with the goal of learning geo nodes (Blender 5.1). The terrain and grass scattering also made with geo nodes. All tree materials (aside trunk on big tree zoomed in image) are also procedural. Composition and post processing made in compositor nodes.
Thanks! The illusion breaks down on close up and they are a bit too high poly for my liking, but I’m actually surprised that it wasn’t too hard to make it. Trunk is just a curve with 3 layers of curves for branches (+ simple twigs for leaves on branches).
Ah, I forgot to say that one thing is not procedural: I modelled the leaves. Those are super simple:
Maybe for nanite foliage it would be OK, though even there it feels a bit excessive. I’m actually surprised that it doesn’t slow down blender on my laptop with 5060 with multiple trees in the scene.
LODs would definitely help here. But even before that I could probably optimize it a lot. I wasn’t focused on performance as this was primarily a learning project. But three obvious things come to mind:
Reducing the resolution of all the curves as what I have now is excessive:
Edit: I actually have exposed those parameters, but it still applies to one level of branches uniformly. I think figuring something out that on bends it would keep higher resolution, but aside from that could be fairly low poly would be even better.
Instead of having the twigs with leaves as geometry using alpha cutout cards.
Tweaking parameters as I used way too many branches and leaves. E.g this is quick reduction in branches and leaves and it still looks good but is now “just” 612k tris:
It’s not bad actually as I sample the curve and make each level of branches a bit smaller. The blending (both in geo and materials) could be better though
Edit: I’m actually more concerned about the fact that some branches can overlap (and twigs with branches or trunk). Also it isn’t really visible on dense trees and you can tweak parameters on less dense ones to have satisfactory result. But tbh, I don’t have idea how to address this issue.
It’s all generated in one go. First is trunk then 3 level of branches (all line curves). All of this is distorted to make it more natural looking. Twigs (separate node group) are attached last for 2nd and first level branches as one set of nodes controlled by some parameters and for 1st level branches as another set of nodes (to have 2 density controls there).
Sounds good, I did something similar for leaves as part of a course I was following. The trees where generated using Mtree, but for the leaves a photo-scanned texture was used. Geometry nodes was then used to instance the leaves and ensure the correct density and rotation, a vertex paint was then used to control where they spawn.
I believe it’s in one of my portfolio posts, but I would need to find it.
yeah, the overlapping could be an issue. One way could be to have a solver that moves the initial curves away from each other before they get meshed. Or for example if you have an issue where the smaller branches clip into the larger ones, you could use the raycast node to check if it’s intersecting, and just delete the affected ones.
I had my own experiment with creating a tree generator in geo nodes, but my method was to use the repeat zone to grow the tree, and essentially at each iteration it would check the closest points and grow away from them, or at least that was the idea. Kind of like a smoothing effect, or points relax solver.
I think the hardest part to solve is the branch intersection with the trunk, where ideally they would mesh with correct topology with the trunk itself, and that would allow you to use displacement on the trunk that also affects the branches correctly. Or at least this is where I left my setup at since I couldnt figure it out at that point.
I actually almost don’t have this problem. I add random rotation to the branches, but I’m also using tangent from the curve of previous one (so 1st level of branches go away from trunk, 2nd level go away from first branch). Also I generate next level of branches some (configurable) distance away from previous level of branches/trunk. I just took a look at those 6 trees I have generated there and I have just 2 cases of small branches (I think 3rd level) overlapping with the trunk. I could probably limit those too using smaller random rotation angle or shorter branches.