Movable mesh behavior when Auto-Instancing with GPU Scene for Mobile

Hello, we’re evaluating the possibility of using GPU Scene on Mobile in our project, hoping to take advantage of the auto-instancing feature.

Currently we’re seeing a discrepancy between auto-instancing of static meshes with movable transforms on Mobile ES3_1 vs Desktop SM5/SM6. On Desktop, movable transforms are auto-instanced as we expected, but not on Mobile. We tested this on our fork of the engine as well as vanilla 5.6.1 from the Epic Launcher and saw the same results.

These are the results from r.MeshDrawCommands.LogDynamicInstancingStats in a simple test scene with 4 static meshes (static transforms) and 4 static meshes (movable transforms), all using the same mesh asset/material.

ES3_1 Mobile

LogRenderer: Instancing stats for BasePass
LogRenderer:  8 Mesh Draw Commands in 5 instancing state buckets
LogRenderer:  Largest 4
LogRenderer:  1.6 Dynamic Instancing draw call reduction factor

SM5/SM6 Desktop

LogRenderer: Instancing stats for BasePass
LogRenderer:  8 Mesh Draw Commands in 2 instancing state buckets
LogRenderer:  Largest 4
LogRenderer:  4.0 Dynamic Instancing draw call reduction factor

We’re wondering if this is expected behavior on the ES3_1 feature level or if it’s potentially a bug with how the dynamic instancing hash is generated on this platform?

Hi, just wanted to check in on this and see if there is any additional information I could provide to help get an answer, thanks!

Hi Joe,

5.6 included GPUScene for mobile. This issue may be caused by the fact that the mobile renderer uses forward rendering by default whereas desktop is deferred. There could be different conditions on mesh auto-merging. things like lights, reflections captures can interfere as well. Can you confirm if you still see this discrepancy when mobile and desktop are both configured as deferred? If that’s not the case, can you share a test scene?

Best regards.

Hi Stéphane, thanks for your reply!

I can confirm that I’m seeing the same results with mobile shading set to deferred as I was when it was set to forward.

I’ve attached a test project, in which I’ve been using the following repro steps

  1. Open TestLevel
  2. Set preview to mobile and run r.MeshDrawCommands.LogDynamicInstancingStats 1
  3. Set preview to desktop and run r.MeshDrawCommands.LogDynamicInstancingStats 1

That being said, our project is going to ship with forward rendering. I didn’t see any mention in the documentation, but if auto-instancing or GPU Scene on Mobile is not expected to be used with forward, this might not fit our use case.

Thank you!

Hi Joe,

Thanks for the repro. The batching results you observed appear to be as expected. In this scene there are 4 static boxes and 4 movable boxes. Static boxes get batched into a single draw on both desktop and mobile. However on mobile movable boxes are not batched together, but on desktop they are. This a related to pre-computed indirect lighting. On mobile we use CPU based indirect lighting. Movable objects get assigned an indirect sample on the CPU depending on their position, so boxes in different locations get a different sample which prevents batching them together. On Desktop it is done differently on the GPU, which is a more expensive option but does not prevent batching.

Best regards

This is great info, thank you!