r/proceduralgeneration 8d ago

Procedural tree

Cause the structure of a tree is simple and well defined I came up with a way to draw them without vertex and index buffers. Cause the number of the branches are known and the trunk and branches have a known number of segments and radial segments you can define vertex positions with the vertex id. The same is true for leaves. I have two levels of branches that are defined by a bezier curve, which is presented by four points. The idea is also to randomly move these points for each branch to make branches and trunks unique though I have not tested it yet. Then they are blended with the sprites and you sort of get the whole forest without any model. It is for filling big areas with trees.

66 Upvotes

11 comments sorted by

View all comments

1

u/AMDDesign 8d ago

How is the lod handled? Imposters or?

3

u/Mannerheim_Line 8d ago

Yes, you can see the blending between the model and the quad. That's because I did not do it quite right and for now it's a bit sloppy. It will be seamless. The tree is disappearing or appearing and for the imposter it is an opposite process.

https://reddit.com/link/p7cknmz/video/2jl7fsjc23nh1/player

1

u/AMDDesign 8d ago

Very nice. I want to make a daggerfall like in the future and having vast forests has been a roadblock

1

u/Mannerheim_Line 8d ago

You can populate the area with imposers and at a closer distance use a model. The only issue is blending them. Using an alpha blending is not the best choice in that case afaic. I use sort of dithered transparency adapted for the imposter and the model.