Search Unity

Question Getting Low FPS [DrawOpaqueObjects]

Discussion in 'Universal Render Pipeline' started by UserNobody, Jan 8, 2021.

  1. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    144
    Hello,
    I am designing a level and when I placed some trees, I started to get really low performance. I use this package for the environment. And I am also using GPU Instancer for better performance.
    When I opened a profiler in the CPU 'Semaphore.WaitForSignal' takes the most time, around 32ms. Which is insane... And in GPU the thing that takes the most time is 'DrawOpaqueObjects'. Which is around 35ms...

    I have placed quite a few trees, but each tree has a LOD system. So in total, I only get around 100k tris. Which is nothing. So I don't quite understand such a terrible performance.

    I tried to convert the URP project back to a Built-in pipeline and it actually runs better. Not super great, but around 15-25FPS better.

    I want to make a big world, but with such poor performance, I have no idea if it's even possible, to be honest...

    I use a GPU instancer, all trees have LOD's and most in the near distance use low-density level, so many use billboard version, I only use 1k textures, occlusion culling, very light Post FX, only get 100k more or less tris, and yet 20+FPS. What is even happening?!

    I would really appreciate some help with this. I'm not sure if I'm doing something wrong, or if it's something to do with Unity.

    Computer Specs:
    RAM: 12GB
    GPU: GeForce GTX 765M
    CPU: Intel Core i7-4700HQ

    Windows Specs:
    Edition: Pro
    Version: 10
    OS Build: Windows
    System Type: 64-bit, x64-based processor

    Quality Asset:
    Quality Asset.JPG

    Game Camera:
    Game Camera.JPG

    This is without the profiler running:
    Stats.JPG

    Profiler:

    ProfilerCPU.JPG ProfilerGPU.JPG
     
    Last edited: Jan 8, 2021
  2. Sky77

    Sky77

    Joined:
    Jan 30, 2014
    Posts:
    171
    Without knowing the platform you're working on, the URP settings and more informations it's impossible to understand what's going on.
    We're working on iOS mainly and we're able to push over 1k draw call and 2+ million polygons with complex post processing at 30+fps on URP, so there's definitely something specific to your setup.
     
  3. UserNobody

    UserNobody

    Joined:
    Oct 3, 2019
    Posts:
    144
    Thank you for your reply! Absolutely, I included more details in the question. It has to be something of my doing, cause it shouldn't perform like this...
     
  4. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    I would start stripping away stuff to see what's causing it. Does disabling the trees make the biggest difference? How about swapping the tree meshes with a cube mesh? Or swapping the tree material for a basic material? Disabling shadows? Etc etc. I'd consider building a simple tool (ingame so you can run it in a build) that lets you easily disable all of these features at will. Also, be sure to debug your build, not in editor. Also, I think gpu instanced trees do NOT contribute to vertex count in URP. I use gpu instancer as well and noticed this the other day.
     
  5. Ruslank100

    Ruslank100

    Joined:
    Apr 11, 2018
    Posts:
    46
    Try to disable opaque, depth texture if you don't need them (a quick test is coming below), maybe this will speed up your game

    I have seen somewhere on the forum that opaque and depth textures are slowing down the GPU performance (and you have them enabled). I decided to check if it is really true

    This test was performed on a Windows 10 PC, with Ryzen 7 2700 CPU, 16GB of RAM and a GTX1050 GPU in a pretty simple scene + a script and simple UI that switches the opaque, depth textures and Post - Processing (no effects, basically I am measuring the GPU cost of PP being on) on the camera. Unity 2021.1.0b1 and URP 11 on a build with 4K resolution - with standalone profiler

    These are the results I have measured (not very accurate, since this is the first time I am doing such measurements) :
    upload_2021-1-9_20-15-2.png

    I have a conclusion for this test :
    Depth, opaque texture and Post - Processing (even without any effects, I didn't attach a Volume script to the camera!) are slowing down the GPU performance. In my case I slowed down the game by more than twice(!!) while the visuals remained the same. So use them only if you need them!
     
    Last edited: Jan 9, 2021
    joshcamas and Deleted User like this.
  6. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Wow, that's extremely surprising. Opaque texture should essentially be free, and obviously post processing shouldn't have an effect on GPU if there isn't any effects. I'm going to run a few tests on my end
     
    Ruslank100 likes this.