Search Unity

Improving performance in first person shooter (fillrate bound)

Discussion in 'General Graphics' started by wenglish, Feb 13, 2018.

  1. wenglish

    wenglish

    Joined:
    Oct 21, 2016
    Posts:
    11
    Hi!

    I've read the docs over and over but am still having problems getting performance where I would like. I have a first person shooter and am trying to improve my frames per second. Static batching is not very useful because most of the small clutter objects are interactable (physics rigidbodies) which i've seen in almost every game ever. I have also baked almost all my lighting (except for a few strategic realtime or mixed lights, never more than 5) but even with so much lighting baked I still get poor fps. The only way to reliably speed it up is to reduce my screen resolution, which is something gamers are never willing to do. the lower the screen res the better the game runs, and it flies at 800x600 but struggles even at 1280x720

    whats a good way to improve this?
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Run the profiler and post it so others can see exactly how best to optimization your project.

    Also - you didn't mention anything about textures or shaders - so maybe combining textures and/or optimizing shaders would help. What type of effects are you running in the scene? How about post effects?

    A video and images will help here.
     
  3. wenglish

    wenglish

    Joined:
    Oct 21, 2016
    Posts:
    11
    ok, here's the profiler



    and here's what the scene looks like:



    and here's the following room (renders even though it's not visible)




    there are 4 realtime lights in the first room, 3 in the second and 1 on the player. most of those lights are very small spot lights. the outline shader costs a bit (around the monitor in the bottom image), the hud costs a bit too and we are using bloom and fog but I've tested it with no hud no post effects and no outline and performance was still bad.

    oh and we are using deffered rendering and the standard shader. hope that helps
     
  4. PacoChan

    PacoChan

    Joined:
    May 28, 2015
    Posts:
    44
    Have you tried occlusion culling? Or maybe some manually placed triggers that disable the renderers of a whole room when you are outside of it?
     
    richardkettlewell likes this.
  5. wenglish

    wenglish

    Joined:
    Oct 21, 2016
    Posts:
    11
    I have not had much luck with occlusion culling. Can it cull non-static objects? Although it doesn't do much for static objects either from my experience.

    Manually placed triggers would definitely help, we used that approach in our first game, but it is so time consuming... would be great if occlusion culling could help more. Maybe i'm missing something
     
  6. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    375
    Look inside Camera.render in the profiler and at the frame debugger and see which objects are taking the longest to render and optimize those shaders.
     
    theANMATOR2b likes this.