Announcement

Collapse
No announcement yet.

Rendering 5000 sprites in UE4 10x slower than Unity5?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rendering 5000 sprites in UE4 10x slower than Unity5?

    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:

    UE4:

    24 fps, 5001 drawcalls, 5000 Paper2D Sprites, cpu load 22%, memory usage 556M

    Unity5:

    234 fps, 137 drawcalls, 5000 sprites (same fps with or without dynamic batching), cpu load 29%, memory usage 45M
    165 fps, 5001 drawcalls, 5000 quads without dynamic batching, cpu load 32%, memory usage 55M
    278 fps, 2 drawcalls, 5000 quads with dynamic batching, cpu load 32%, memory usage 52M


    5000 sprites in UE4:

    Click image for larger version

Name:	ue4_5000sprites.JPG
Views:	1
Size:	54.8 KB
ID:	1146266

    5000 sprites in Unity5:

    Click image for larger version

Name:	unity_5000sprites.JPG
Views:	1
Size:	51.4 KB
ID:	1146267

    UE4 stats:

    Click image for larger version

Name:	ue4_5000sprites_drawcalls.JPG
Views:	1
Size:	48.0 KB
ID:	1146268

    Unity5 stats:

    5000 spites
    Click image for larger version

Name:	unity_5000sprites_stats.JPG
Views:	1
Size:	23.2 KB
ID:	1146269

    5000 quads without dynamic batching
    Click image for larger version

Name:	unity_5000sprites_QUAD_nobatching_stats.JPG
Views:	1
Size:	22.5 KB
ID:	1146289

    5000 quads with dynamic batching
    Click image for larger version

Name:	unity_5000sprites_QUAD_batching_stats.JPG
Views:	1
Size:	21.5 KB
ID:	1146290
    Attached Files
    Last edited by Nate; 03-17-2015, 07:58 AM. Reason: update cpu and memory usage
    | twitter | github | #ue4tip

    #2
    You need bach the sprites in unreal or unchek the baching in unity to run the same test, or your test dont have many sense.

    Comment


      #3
      Originally posted by erWilly View Post
      You need bach the sprites in unreal or unchek the baching in unity to run the same test, or your test dont have many sense.
      How to batch sprites in unreal? It would be great that we can batch drawcalls in UE4, but I simply failed to find that feature been implemented.
      | twitter | github | #ue4tip

      Comment


        #4
        I have no idea

        Comment


          #5
          Update unity 5 test with dynamic batching off. There's 40% performance drop after turn off dynamic batching option when rendering quads in unity 5.
          | twitter | github | #ue4tip

          Comment


            #6
            Originally posted by Nate View Post
            How to batch sprites in unreal? It would be great that we can batch drawcalls in UE4, but I simply failed to find that feature been implemented.
            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

            Comment


              #7
              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.

              Comment


                #8
                Drawcalls is more dangerous that polys.

                UE4:
                24 fps, 5001 drawcalls, 5000 Paper2D Sprites, cpu load 22%, memory usage 556M

                Unity5:
                165 fps, 5001 drawcalls, 5000 quads without dynamic batching, cpu load 32%, memory usage 55M
                Looking that, even with baching you will be minus performance in unreal.

                Comment


                  #9
                  Originally posted by Nate View Post
                  How to batch sprites in unreal? It would be great that we can batch drawcalls in UE4, but I simply failed to find that feature been implemented.
                  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.

                  Comment


                    #10
                    Originally posted by devzero808 View Post
                    Hmm think the forum ate my last post. Sorry if it shows up again.
                    it wasn't eaten, it was just waiting for approval from a moderator, the first few posts of new members need to be approved.

                    anyway back to the thread topic.

                    Comment


                      #11
                      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.

                      Cheers,
                      Michael Noland

                      Comment


                        #12
                        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.

                        Cheers,
                        Michael Noland

                        Comment


                          #13
                          Just to clarify, all default post-processing was turned off in unreal 5000 sprites test:
                          Click image for larger version

Name:	ue_default_postprocess_off.JPG
Views:	1
Size:	19.0 KB
ID:	1070599

                          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?
                          | twitter | github | #ue4tip

                          Comment


                            #14
                            3D Meshes already have batching IIRC, Instanced Meshes definitely do. Separate meshes might not, though I don't see why that would be the case.

                            I know that Mesh particles in UE4 are done in batches now, but they're probably instanced meshes too.

                            Comment


                              #15
                              If UE4 with the 4.8 give me something like this https://github.com/urho3d/Urho3D/issues/567 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.

                              About x5 times better than Unity5...
                              Last edited by Hevedy; 03-18-2015, 12:45 PM.
                              Hevedy - Instance Tools: https://hevedy.itch.io/hevedyinstances
                              Hevedy - Image Tools: https://hevedy.itch.io/imagetools

                              Comment

                              Working...
                              X