Procedural Plants + Procedural Terrain

I’ve posted a few things at various points about my terrain system. I have now added a meshManager.

I took the tree generator, and after major modifications, hooked it up to my new meshManager system. While it is a bit laggy when generating, I can generate trees surrounding the player as you move around in realtime. I also added a fern factory.



More images at: craig.p3dp.com/MiscPics/Plants/

Source At: https://github.com/Craig-Macomber/Panda3D-Terrain-System/tree/devchaos

meshManager code and description at: https://github.com/Craig-Macomber/Panda3D-Terrain-System/blob/devchaos/meshManager/meshManager.py

Sounds great. I’m guessing this is the finished product of the work being donehere? I’ll have to try this out on my terrain engine until we figure out how to merge each of our terrain engines. I can easily mesh it with my terrain texturing algorithm to make it alter vegetation density or other properties appropriately.

Have you considered just preloading a couple hundred or so procedural trees? You could do a rotation where when one goes out of range it becomes eligible again for placement. With that enough possible trees and no two trees in sight ever being identical I think it would be impossible to notice repetition. You could also regenerate some of the trees over time as you transition to an area with a different style of vegetation.

I definitely intend to include support for pre-generated (and even pre-placed) meshes (pre-generated trees, buildings, etc). There are a couple ways to do it, but they are all pretty simple.

The trees are derived from that tree project. I wrote the mesh manager and ported the tree generator to work with it as an example. The fern generator is pretty trivial.

I’ll make an attempt at integrating your renderer when I have time. I got your height map generator working with my system just fine. When I have time I can go dig through your sources and see if I can make it work. Currently the only connection between my meshManager and my renderers is that some of the mesh factories call the current renderer’s height(x,y) method. It should be really easy though to hook it up to the maps so I can use density maps for placing things.