Hello
I know that static batching can result in a much higher memory use due to how unity keeps the original meshes and also the combined mesh in memory is this true as well for the material gpu instancing option or does it use a different process.So in short which process would be less memory intensive?
Thx
This is not the case for gpu instancing, so it is less memory intensive.
Instancing on the GPU generally works by combining multiple information streams. Say you have 50 instances of an object with 100 vertices. With static batching, that results in 5000 vertices and all the information for these vertices is sent to the gpu. Including the position, which combines the vertex and instance position. Most information though, like the uv coordinates is actually the same in each instance.
With multiple information streams, you can have one set of data per vertex and one per instance. In the above case you have 100 entries of per vertex data where the gpu loops over 50 times. There are also 50 entries of per instance data, where each entry is repeated 100 times before the next is sent. In this way, 150 entries are sent in 5000 unique combinations.
Thanks for the response Jvo so if im understanding this essentially static batching increases memory use but decreases cpu load while gpu instancing has little impact on memory but increases cpu load?
No, in short, gpu instancing is just a smarter way of rendering multiple instances. It reduces both memory use (main and gpu) and cpu load. It might increase the gpu load by a fraction, but that’s not commonly the bottle neck. I’m not talking about the use in Unity per se. There might be different cpu loads there to select which models to render. It would surprise me however if the cpu load of gpu instancing is higher than that of batching.
In my opinion it is by far the preferred solution if available. So much so that gpu instancing should by default be preferred by Unity over batching.
Aha music to my ears never been a big fan of static batching. Thx bud