Ok somebody needs to re-explain to me how the foliage tool affects draw calls (preferably like I’m 6.) I was told that the foliage tool automatically batches (I know that’s probably not the right word but my vocab sucks) a set of foliage meshes in order to reduce the number of draw calls, so like you could place a patch of grass and have it be like 1-4 draw calls (dependent on the number of materials assigned to the grass asset of course.) But now I’m starting to think that I misunderstood the whole thing, because I put a set of 12 foliage meshes into a scene and, for the sake of this post, let’s just say each of them have 5 materials assigned to them. That, plus the landscape and the sky sphere should be 62 draw calls right? Well apparently not because this is what I’m getting:
I mean, there must be something I’m misunderstanding, because I have no idea where all 330 of these draw calls are coming from.
Can somebody please explain to me what it is I’m missing? Please and thank you very much.
Addendum: Here’s what the scene looks like without the annoying words all over it.
UPDATE: I fooled around with the lighting and the post processing, and even with the post processing turned off and all the lighting set to stationary/static (tried both), the number of draw calls did not decrease whatsoever
Each material on a model adds a drawcall, so 5 materials on a model = 5 drawcalls
Instances/foliage are drawn as one, so if you have 50 instances of one model with 5 materials, that’s 1 x 5 = 5 draw calls
Also, if you have 5 different models sharing the ***same ***material, that will still be 5 draw calls unless they are combined into one static mesh. This applies to instances too: if you have 5 different foliage models with 100 instances each that should = 5 draw calls
Adding a dynamic light to the scene multiplies the draw calls as it has to render the scene twice; once from the camera view and once from the light view/radius (but only if you have shadows). So the more dynamic lights you have with shadows, the more draw calls.
Some other things that might be increasing draw calls (although im not 100% on this yet) is LODs or LODs with different materials. Also foliage instancing may be breaking up foliage counts into small clusters for LOD-ing purposes (although i really need to test this) further increasing draw calls.
The best way to test this is to start a blank level, paint a foliage prop that only has one material and see what happens when you start adding more.
Ok that makes sense, but even with the dynamic lighting thing I should be getting a maximum of like 150 draw calls, There’s still 180 left unaccounted for. I’ll have to do like you said and start experimenting in a blank level.
Only like two are drawn at a time on a single asset (for the trees), the other 2 - 3 materials are all for LOD sake, like the grass has two, one masked transparent material for up close and one opaque material for far away.
Like half of them have masked transparency, half of them are opaque. Almost all of them use either speedtree wind or simplegrasswind. That’s legitimately as complex as they all get.
hi, you can try temparory remove some of the speedtree wind or simplegrass wind or opaque of one of the material and check the drawcall, see is it the material effect the drawcall