I’ve used an Instanced Static Mesh in my project, but it doesn’t seem to get rendered on iPad or in the mobile preview.
This documentation page says that Static Meshes are supported on mobile, but other types of mesh are not supported. Is an Instanced Static Mesh a separate thing from a Static Mesh for the purposes of that list?
If so, is this a temporary restriction or a permanent one?
I would naively have thought that mobile would be exactly where the benefits of using an Instanced Static Mesh are most useful?
Hey shadowphiar, we currently don’t suppport it on ES 2 (mobile).
We could probably use EXT_instanced_arrays, but that introduces the additional complexity of the devices who don’t support it (e.g. Apple supports it but some Android devices might not), so we’d have to add a path to handle when it isn’t supported… We’ll add it to our list to investigate.
Hey, this does not seem to be working for me. I’ve my test scene in which I load in a couple thousand of the same object. On PC all is good with 13 static mesh draw calls. However when running on my mobile (Samsung Galaxy Note3) I get all the static mesh instances added (and rendered fine) but they are not batched, resulting in a good 4k draw calls.
I am running the latest, non-preview, (4.6.1) and I am fairly sure this phone supports the capability, in that other engines it does work.
I tested it on a phone with a snapdragon 801, which although quite recent and fast apparently does not support the extension. So maybe yours doesn’t either? Those other engines might use some form of software instancing instead of hardware instancing.
Ah yep. That answers it. I should have checked rather than assumed. Would be nice to see a software solution similar to other engines as it does make a massive difference (for my situation anyway as I am not doing much else to chew up the CPU). Anyway, thanks again.
Thanks RCaloca, awesome work. Do you know if it’s something that the engine automatically falls back to trying to do in software if the hardware extension is not supported, or is this something we need to enable. I could not really find any answer in the docs related to the software emulation.
Could you please be more specific in terms what the software emulation does currenlty if it’s not reducing number of draw calls? From my experience saving 20 draw calls on mobile is a big win on mobile devices.
If the hardware/api supports instancing, we set up a separate vertex stream with the per-instance information, so 1 draw call per N instances.
If it has to fallback to emulation, it instead becomes:
for (1 to N)
Set Instance shader parameters (transform, color, etc)
Draw Call
For 4.8 i’ll bump up the priority for getting OpenGL using the extension for instancing.
@RCaloca sorry to dig up this old thread but I’m curious if there have been new developments/improvements for using instanced static meshes on mobile?
I’m testing developing for the GO and using ISM’s (200 billboard trees instanced or as separate meshes) don’t seem to have any/much impact on the performance.