0 votes

Hi All!

What is the recommended way to create grass cells on a 3d grid map without too much performance cost?

I've been experimenting with multimeshes with PNG grass textures on them but performance suffered horribly. I've also tried instancing dozens of those PNG-textured meshes (basically, everywhere I had a 'grass' cell) and it was a little better but still caused huge performance drops. I keep seeing games on Steam with lush grass and other vegetation covering large patches of terrain with seemingly no FPS cost. How is this achieved?

asked Jun 7 in Engine by Macryc (289 points)

1 Answer

0 votes

Have you looked at a MultiMeshInstance? You can create hundreds of copies of something without much of a performance hit.

answered Jun 7 by Ertain (1,253 points)

Yes, as mentioned above, the multimesh instance was my go to method for this as I'm already using multiple multimesh instances for other props in my world. Unfortunately, once a mesh has a transparent texture, performance suffers greatly.

Ah, thanks for the clarification.

There is one method I've seen which utilizes shaders. Here's a video where the author of the video describes how he made fields of grass using shaders.

There's the shader approach, and there's also using 3D models of grass. If your PNG files use transparency, that's what may be causing the slow down. I've used 3D grass models from this pack in some scenes.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.