Recommended way to create vegetation (large patches of grass) in 3D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Macryc

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?

:bust_in_silhouette: Reply From: Ertain

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

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.

Macryc | 2020-06-07 16:11

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.

Ertain | 2020-06-07 16:18

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.

Ertain | 2020-06-07 16:25

:bust_in_silhouette: Reply From: dirtbuilder

I think the problem is not the way you use your png but the fact that you use a png

the transparency of a png is the problem because your gpu has to render pixels that are transparent and if a pixel is transparent your gpu redraws the surface beneath it too and this results in a huge bottleneck

try to avoid tramceparent pices of mesh

Yeah, I was wondering about the PNG transparency when I wrote one of the comments.

Ertain | 2021-09-17 09:31