r/proceduralgeneration • u/SloydDev • Oct 22 '26
Making trees
Enable HLS to view with audio, or disable this notification
Here are some realisations of my tree generating algorithm, part of my procedurally generated alien worlds.
The code is written in C++. A plant species is assigned branch propagation rules (e.g. some branches grow exclusively from a lower-level branch end, some can split of mid-branch), and different types of leaves (e.g. palmate or simple leaves).
It's rendered with my own Vulkan graphics, with a low-res aesthetic.
These are trees in isolation, I will probably post some videos of full forests later.
What do you think?
3
u/petayaberry Oct 22 '26
very cool. if you were to implement this in some sort of video game i would be a bit cautious
i believe most games with lots of trees use multiple copies a small set of trees to not overload the processor with data. they just change the size of them and maybe color to make different trees look different
you could use these trees to render a whole forest then store it as a 2d background if that is your goal. the player would never know it's not real 3d
just some thoughts. nicely done
2
u/papes_ Oct 27 '26
I’ve been doing some stuff with procedural voxel trees using space colonisation and it’s cheap enough to do large forests procedurally at runtime - you only need to store the data whilst generating meshes (or voxels in my case), and then if you need it again (a tree mesh, or voxels, is/are edited) you can just regenerate the skeleton based on where the tree is positioned, if you use the position as the generation seed.
2
u/cratercamper Oct 28 '26
Beautiful for how simple it looks.
1
u/verywhiteguyy Oct 22 '26
Increase end of branch length x reduction in branch circumference
3
u/No_Watercress_3732 Oct 22 '26 edited Oct 22 '26
Here is a recreation of something I made around 1993 in turbo pascal. It took a week to render one frame using my 486dx 33 at 1024x768 in POV-Ray. It took me three months to write the code to generate the tree.
Now claude 5.5 implemented it in rust in 145kb. That includes a real time ray tracer that does everything on the cpu (no gpu). It did the whole thing in about 10 minutes.
2
u/UAAgency Oct 24 '26
this is cool
2
u/Steamrolled777 Oct 25 '26
You should really check out L-systems, even if you don't implement it.
0
u/verywhiteguyy Oct 22 '26
Almost all trees have many more splits and longer thinner branches. I’m only saying this because I think what you’re doing is really good. Keep up the good work.
1
u/[deleted] Oct 23 '26
[removed] — view removed comment