Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Insanely low FPS with Direct3D 11

Discussion in 'General Graphics' started by osmanzort, Nov 29, 2019.

  1. osmanzort

    osmanzort

    Joined:
    May 22, 2019
    Posts:
    9
    Hello everyone,

    I'm pretty new to using Unity and I'm still discovering most of the stuff as I go along. I'm working on a pretty basic 3d game and while I'm getting 1500 FPS in the editor, I would get around 60 FPS from the standalone executable. At first I thought it was because of Vsync but I lowered the graphics settings, turned off Vsync and nothing changed. I changed my graphics card's default settings for Vsync to "off" but that didn't help either. After a little digging I found out how to use the profiler with the standalone player and I tried to use the profiler that way. I couldn't pinpoint the exact problem but it looked like it wasn't exactly because of Vsync (I'm still not 100% sure), the renderer looks like it's waiting for something every frame.

    In the end, I thought of changing the Graphics API to Vulkan as default and that solved the problem for me. Now the game runs at 2000 FPS but I still don't understand what's causing this huge drop with DirectX. Am I missing something? I'm attaching the profiler window screenshot in case somebody wants to have a look.
     

    Attached Files:

    Last edited: Nov 30, 2019
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,160
    Hello,
    That screenshot is showing a frame that has not been Profiled in it's entirety yet. If you'd select any other frame, you should be able to see samples in the Render thread as well. The Profiler documentation goes into more depth of how VSync, Rendering and WaitFor* samples correlate. You might also want to look at Application.targetFramerate
     
  3. osmanzort

    osmanzort

    Joined:
    May 22, 2019
    Posts:
    9
    Thanks for the reply but would it make any difference? All the frames are like this one.I'm also using "Application.targetFramerate = -1" and that doesn't make any difference.

    Edit: I've switched it back to dx11 and built the game again. I'm uploading another screenshot.
    unity dx11.jpg



    Edit2: It looks like this in the hierarchy: unity semaphore.jpg
     
    Last edited: Nov 30, 2019
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,160
    The difference in this screenshot is, that you can see that parallel to the Wait sample, the Render Thread is reporting a sample for Gfx.PresentFrame. Which means that all this time is spend on the GPU and you should be looking at the GPU Profiler. That time might still be spend VSyncing on the GPU. I'm not sure why that would be and why it would be Graphics API specific. Might be worth a bug report if it still occurs on the latest patch release of whichever Unity version you're on.
     
  5. osmanzort

    osmanzort

    Joined:
    May 22, 2019
    Posts:
    9
    Yes, I downloaded to the latest (2019.2.14f1) and also updated Geforce drivers after having these issues. I'm going to send a bug report, thanks for the help.