Search Unity

UWP Lower Framerate than Standalone (slower fps than .exe)

Discussion in 'Windows' started by developersice, Oct 26, 2017.

  1. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Been digging around the forums/Unity Answers section and seen a few vague mentions of this issue, our app is being built in Unity 2017.1.1, as a standalone .exe build, it runs up to 60fps as we intend. However, a UWP export and build as release or master, the framerate drops below 10fps - for no good reason.

    This has been very frustrating to look into and fix, but from looking at some games released on UWP like Gears, the performance is achieveable - what's giving us so much hassle with our build?

    The game has a menu screen, three 3d levels, scripting runtime .NET 3.5 equivalent, scripting backend .NET, API Compatibility .NET 2.0 Subset. Build type XAML OR D3D doesn't make any difference to the horrible framerate. We have even pushed the game to the windows store, downloaded it to run it to see if it was VS 2017 and it was still BAD.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Hey this doesn't seem like a known or expected issue. UWP builds generally should have identical performance to Windows Standalone builds. Have you tried using the profiler to identify what exactly is much slower? Since you have a comparison build (Windows Standalone), it should be easy to identify which part is slow.
     
  3. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Quick update on this, we have identified our issue - our project was building on our test device ( A microsoft surface book) which has a screen resolution of 3000 x 2000, the UWP build auto scales to full screen always on the device. I found that switching the display resolution of the surface book to 1920 x 1080 then running the app would make it perform fine.

    A standalone build always runs at the 1920 x 1080p resolution that we have set, however the UWP app scales itself really small when we try to set the same resolution on it when the app opens.

    This is concerning if anyone was to use our app on a device like a surface book as it will automatically scale to 3000 x 2000 and chug the framerate. We have also tried adding the screen.setresolution code to make the rendering resolution 1920 x 1080 which automatically switches the UWP app to a small screen view on a display resolution of 3000 x 2000.

    Is there anything obvious we are missing in terms of rendering and display resolution here?
     
    Python_37 likes this.
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Are you passing "false" as the fullscreen parameter? If so, it's expected that the window is resized to requested size. If you want it to be stretched, pass "true" instead.

    By the way, 1920x1080 and 3000x2000 are two very different aspect ratios... you might want to run your game on a resolution that has the same aspect ratio as the display, or the contents will be distorted.
     
    Salvador-Romero likes this.
  5. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Passed fullscreen as true, and adjusted the running resolution to one that fits the 3:2 aspect ratio and that did the trick, thanks for the help on this one. Hopefully this post helps anyone else in the bizarre situation we have had with a screen not being a 16:9 resolution with UWP apps.
     
    Python_37 and Salvador-Romero like this.