Billboard planes and performance question

Hi, I have created billboard grass (example pic) and have imported my blender file into Unity. I have hen copied the prefab over my scene (manually) and i noticed that my draw calls have only increased by 1. Is this a good method (copy and pasting to make my grass)? will this make my game slow or can i use this method for large areas?

have know idea on the other settings to look out for regarding performance, just the draw calls. So some scene i could have about 2000 of them. Will this be bad or good?

my app is for ios and android

Combining a few of those meshes into grass-patches beforehand might bring better performance than having it batch at runtime.
There should be a few tools (i think also on the asset store) to combine meshes in the editor or I think even combining at hitting play while maintaining lightmaps. Otherwise you could do that in blender, but it’d be a lot more work to create a few varying grass patches for certain regeions of your level.
2000 of them for mobile seems like a lot. That 8 times for triangles and 16 times for vertices. So you’d end up with:
16k tris and 32k verts just for grass. If it’s the main focus of the game, okay, If it’s just for a nicer scenery you may want to cut that down a little depending on your target devices.
As an end result only your profiler will tell you if it works out.

Hi, thanks for the information. So if I create a big patch of grass and merge it into one object and then import it into unity itwill be a lot less expensive? Or have I got the wrong idea?

Ill look at the asset store as well in case there’s something I can utilise. Cheers.

that’s right.
One reason is there are less game objects in the scene.
Another one is the batch process itself. unity goes through all the objects that are being rendered to see how they can be batched into a single drawcall to create less drawcalls overall. And this going through the list and checking for what to batch becomes faster.
At least that’s how I understood it.

thanks, does the ‘static’ button in unity help in any way with this too? also if i have a transparent png as my material then will this be bad for mobile?

sorry for all the questions.

the static button can mean multiple things.
lightmap static: (most of) the lighting is calculated in the editor and doesn’t need to be calculated at runtime. Best to check the documentation for details.
batching static: I think it maps equal meshes/materials into a table at build time to be able to batch those faster at runtime. But it increases the filesize aswell.

Transparency is usually a performance killer, but it should only get really nasty when it takes up a lot of the screen.
please someone correct me on this if i’m wrong but i think regular transparent shaders perform better than cut-out transparency?

I think it would be really helpful to you to skim through the documentation and do a quick check on things you want to know more about regarding editor stuff. I think there’s even a page about built-in shader performances.

hi, ok ill take a look into this using the information you provided. Ive just read that ‘mip maps’ are good for when lowering resolution at a distance (Unity - Manual: Texture Import Settings). do you think its best to actually model the grass or to use billboards?

Concerning static batching:

“Using static batching will require additional memory for storing the combined geometry.”

This means when you compile your game, it’s actually combining all the meshes, which is why there is a memory increase.

So if you have 5 cubes all using the same geometry, instead of dynamic batching them at runtime, static batching will combine all 5 cubes into one mesh, so it’s only drawing that one mesh. The downside is that you now have 5x the memory usage because it’s not referencing just the single original cube mesh.

ok so do you think its worth doing in my situation? as the memory increase wont be good for mobile right? im better off combining them in e.g. Blender beforehand.

Combining them in Blender will do the exact same thing.

Also, how will you place them on your terrain if you made them one big mesh in Blender?

Here’s how it works.

Let’s say you have a cube you made in Blender.

You place it in your scene twice, with the same material.

Instead of using 2 draw calls to draw the same mesh with the same material two times, Unity will do some processing real time and realize it can draw the 2 cubes together at the same time. The downside is that it has to do some extra work at runtime to do this, although it’s still probably better than using 2 distinct draw calls.

Now, the other option is to mark the 2 boxes as STATIC and then when you compile the game for mobile, it will realize those two boxes are the same, and combine them into one mesh (so it will have twice the vertex count as the single box mesh). So the problem then becomes the fact that you just doubled the memory for using the box. If you had 1000 boxes, it would create a mesh that has 1000 box meshes, all as one combined mesh.

The nice thing about letting Unity do the static batching for you is that you can place invidivual meshes and not have to worry about combining them yourself, Unity will do that. For mobile especially though, you’ll need to make sure the combine mesh generated isn’t going to take up a lot of memory.

Let me know if that made sense or not… haha!

Hang on, if it really combined all similar objects into one single mesh, wouldn’t that break occlusion culling?
Like the latest UnityLabs demo, if all hallway objects were combined into one giant mesh it would bog down performance significantly.

That’s why it’s better to not create a big combined mesh in Blender, but allow Unity to combine the geometry. Read this: Unity - Scripting API: StaticBatchingUtility

The difference is that if it’s about a patch of grass, say 10m², it would not need to check for culling on each single piece of grass (maybe 100-200pieces?) if it should be rendered or not, but a patch of grass is only one piece of geometry thats usually seen completely or not at all and saves work there.

E:
But it’s right not to create big meshes like a stone on the left side inside a room and a stone on the right side since you’d only ever see one at a time.

ok, ive read the information on the link and it makes more sense now, so using individual billboards across the scene will help, im using unity free version and i read that the ‘static’ button only works for pro version? thanks for the pointers guys, really helping me understand it more.

Yeah grass is a little different because you would probably do it in smaller patches, but it sounded like the OP was thinking of combining all grass planes for entire terrain into a single mesh.

At the end of the day, I believe that dynamic and static batching in Unity is better than combining yourself in Blender, depending on what exactly and how much you have. The overhead of the gameobjects is a big thing to consider so that’s why having a larger combined mesh would be better if that would work. So maybe a mix of both ways to get best performance.