Try to understand 2d performance difference between Unity and Unreal Engine, so I did a simple 2d sprites benchmark today to render 5000 sprites on screen and here’s the result:
You’ll want to use instancing, BUT… for me at least it never worked on mobile as a big portion of mobile hardware does not support hardware instancing. On PC my test dropped several thousand objects down to a dozen.
Never worked it out but my guess is unity does some “magic” on software which I don’t think UE4 does… yet. I really hope its something that gets looked into soonish in UE4
I’m not sure if Paper2D has any easy batching support out-of-the-box since I’ve not used it. Paper2D is a work in progress and is aimed at mobile hardware though (which does not always support instancing). You can test batching by using an instanced static mesh component setup.
In my own tests, I had around 32 million triangles on screen before I started getting a depreciation in performance.
Hmm think the forum ate my last post. Sorry if it shows up again. Anyway I’m not sure if the Trello board for Paper2D is up to date. But under the TODO: Rendering column
it says Batched rendering and performance optimizations is slated for 4.8. It is the first item for that column.
Currently each sprite component is a separate draw call. Some form of easier batching will be coming in 4.8, but you can manually batch in 4.7 by submitting multiple FSpriteDrawCallRecords in a UPaperSpriteComponent subclass, or by using something that automatically batches like a terrain spline component or tile map component.
One other thing to check so that you are comparing apples to apples is post-processing settings. There’s a non-trivial per-frame overhead even for an empty scene with no geometry due to the post-processing chain passes that are enabled by default in Unreal. You can turn things off in project settings … Rendering.
Just to clarify, all default post-processing was turned off in unreal 5000 sprites test:
Glad to hear that batching support is coming in 4.8, is the code already in master branch? And is the batching support only for paper2d or there’ll be general batching for 3d mesh too?
If UE4 with the 4.8 give me something like this Make Urho2D more faster · Issue #567 · urho3d/Urho3D · GitHub then i’m gonna be much happy (About 100.000 static sprites at 60FPS), but since is a big engine, probably a 60FPS for 50.000 sprites make me fun.
The batching support isn’t in yet, I’ll probably start on it in the next week or two. It will be specific to sprites, and the first form will be a similar interface to instanced static mesh components (but not using hardware instancing).
For 3D meshes, we have the instanced static mesh component for dynamic batching, and you can also use Simplygon if you have it to mesh merge (I think having a built-in mesh merging system is on the backlog). Loose static mesh components are not batched at the RHI level, but there is already a lot of render-thread optimization for static meshes with mobility set to Static. They still end up being multiple API draw calls, but they go down a much faster path on the render thread with fairly low per-mesh overhead.