Godot Version
4.5
Question
All this is basically me just trying to find some way to make lots of plants spawn themselves on a plain as one object for the sake of GPU/CPU efficiency. I want to put flowers and other plants on a plane, and make the meshes themselves flush with the plane itself, so the plants look like they’re coming out of the ground properly. This is based on studying the ways plants were placed in an old Nintendo DS game, The Wizard Of Oz: Beyond The Yellow Brick Road:
Everything is placed on a hillside that’s at an angle. Each plant in the original game was clearly hand placed by an artist, who then took each individual plant and made it flush with the environment. This model in particular is one I made by studying their methods, but all the textures here are theirs.
And here’s an image of what the landscape looks like below; all the plants are pulled just a bit below the ground so they look like they’re in the landscape itself. That’s how they did it in the original, too. But one thing they didn’t do in the original game was sway. Every plant in the game just sat there, motionless. My goal is:
- Get all (or most) of the plants in one object, generated as a shader.
- Get all the plants flush with the landscape.
- Pull all the plants juuuust a little bit below the landscape, so they look like they’re coming out of it properly.
- Get the plants to sway in the wind.
Now, I’ve figured out how to get the plants to look like they’re swaying in the wind in a different thread. But If I try to individually place every plant as if they’re all individual instances of the same scene, the game is going to hate me. After all, an average scene might look something like this:
Too many plants! It would look beautiful if they all swayed in the wind, but it would also be great if they did that at a proper frame rate.
If I could make some kind of generic scene set up that I could repeat for plants ad nauseam, that would let me place plants dynamically in a scene, that would be a dream come true. So I’m trying to brainstorm solutions. And I figure I’m not the first wannabe dev in history to have this problem, so I thought I’d come ask here for insight and suggestions.
ANYWAYS, I THOUGHT I’D POST SOME STUFF I’VE CONSIDERED (but haven’t had time to try yet):
- A multimesh3D. Here’s a link to a youtube video tutorial I’ve been reviewing. It looks really useful for your standard grass or fur shaders, but it doesn’t seem to let you choose where specifically the spawned meshes go. Useful for a perfectly flat plane, but not for our dynamic hillsides and valleys.
- I though, maybe, harshly limiting the options for spawning plants? I could, say, figure out where I want all the plants to be on the landscape by placing them in blender. Then I’d place vertices at the base of each given plant, delete every plant so I just have a map of loose floating vertices, export that as its own object into Godot, and now I have a perfect map of the location of every plant I want to spawn. But I have no idea if that would even work.
- Path based mesh generation. This would let me just spawn a path in any given mesh and place shader flowers wherever I want. It might be kind of awkward and unwieldy, and result in some strange paths in the editor, but if it creates plants placed neatly where I want them, what does that matter?
- The video explains briefly how to make meshes that rotate themselves perfectly aligned to your path, but it doesn’t solve the problem where I need the vertical sides of the mesh to be perfectly vertical every time; the horizontal top and bottoms of each quad should rotate to be flush with the landscape they’re sitting on, but the sides should always be vertical, to make sure the plant looks like it’s growing upwards.
I’m so certain someone out there with experience in this just read whatever I wrote and said “What? No, you’re wrong, this is what you should do.” Please tell me what I should do! I’m still a novice and I’m trying to figure out how and where to learn all of this stuff to begin with! Thanks in advance!




