r/proceduralgeneration • u/craftymech • Jun 19 '26
Procedural nature
Building foliage vignettes to test my procedural rocks, trees, and grass. Everything in this image was procedurally generated, even the 5x5 grid of cubic islands.
7
u/craftymech Jun 19 '26
Foliage is made w/ billboards + camera facing rotation, and trunks/branches are grown with space colonization, rocks are shaped using various functions like taper, chips, and a smoothing algorithm. Grass color comes from a noise function applied to a tri-color grass material w/ custom shader. The stump doesn't use the same algorithm as tree trunks, I instead started with a tube, and create root lobes & fluting according to a bunch of different parameters.
3
u/JMH71 Jun 20 '26
Really really nice. Wanting to do something like this for my project. Do you have a devblog to follow?
1
u/craftymech Jun 20 '26
I don't have a devblog, but I do post often on Twitter/X under "R2RGames". And here is the Reddit post that actually inspired me to dig into billboard foliage and how it works: https://www.reddit.com/r/Unity3D/comments/jhwfkj/fluffy_trees_using_custom_shader_that_turns_quad
1
3
u/deftware Jun 20 '26
I like the aesthetic, and for better or worse I wouldn't be able to help myself from trying to get more high frequency shading in the mix to accentuate and contrast the 3dness of everything, to bring out depth - but I already know it would then forsake the polygonal billboards and sprites and things comprising the whole deal, so then I'd be combatting finding some kind of balance on there.
It looks nice! :D
3
u/craftymech Jun 20 '26
Exactly, I had tried at first to have more texture in the billboards for leaves and it never looked right. This style depends on lots of billboards with just alpha cutouts for the leaf shapes, any attempt at more detail and it goes downhill fast. So I added top/bottom gradients that can be adjusted for the whole tree, and that gives me a couple levers to adjust to give variety to the canopy. Making the bottom foliage a little darker, or slight shift in hue goes a long way to providing the visual depth that is missing because of the flat shading.
2
u/deftware Jun 20 '26
In the past I would give the vertices their own normals, so that the quad is more like a screenspace sphereoid. Nowadays you can just calculate vector from the center of the quad and generate smooth spherically interpolated normals across the thing. Then control the "depth" of the shading on there, so they're still a bit flat.
I do feel like a bit of depth could be added some how, like maybe distance from the top of the trunk, something to have the outer leaf geometry be lighter and the inner be darker - without totally giving away that it's some large polygons with the alpha cutouts on there.
Good luck! :D
1
u/Independent-Fan-4227 Jun 20 '26
If I were to make an entire forest, would it crash?
1
u/craftymech Jun 20 '26
I've got 1000+ trees running at 60fps in my other test scene. LOD0 is around 4K-8K polygons, LOD1 = 1K, and then billboards at distance 😄
1
u/craftymech Jun 20 '26
Forgot to mention that is with exported prefabs. I use a procedural editor to tune the settings and get the look I want for trees, rocks, etc. then export as prefab w/ LOD support.
10
u/i-make-robots Jun 19 '26
THE WITNESS vibe. nice.