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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Did I go too far ?

Discussion in 'AR/VR (XR) Discussion' started by EarthHobbit, May 17, 2016.

  1. EarthHobbit

    EarthHobbit

    Joined:
    May 10, 2016
    Posts:
    41
    I am working on an easy project, which is simply a scene downloaded from the asset store.
    While the movements on the screen seem ok, on the Vive HMD it's awfully shaky.
    My GPU is an R9 390 with 8GB VRAM, is the amount of polygons in the attached image the issue ?
    Thanks.
     

    Attached Files:

    scottb9239 likes this.
  2. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    I'm not developing on the Vive, but I would say the first thing you need to look at for optimization is radically reducing the batches, 3342 is very high, even for PC VR (I'm working on Gear VR, where I'm aiming to keep it below 50 batches per frame).

    If it were me I would want to get that down to the low-mid hundreds at most, and definitely get it as low as possible overall through atlasing textures together, using as few materials and utilize static batching as much as possible.

    Reducing the batch count will really help the CPU, notice the CPU is at 53ms, this needs lowering substantially. Hope this helps.
     
    Last edited: May 17, 2016
    EarthHobbit likes this.
  3. EarthHobbit

    EarthHobbit

    Joined:
    May 10, 2016
    Posts:
    41
    Quite some new terms for me, thanks for the batch hint. The building indeed improves performance by optimizing batches, but I will look closer at this parameter. How could I influence it, better than deleting assets ?
     
  4. Harley-B

    Harley-B

    Joined:
    Aug 12, 2013
    Posts:
    3
    3000+ shadow casters will give you some performance problems. If the light source won't move you can bake them. Use the profiler instead of that performance stats box so you can see exactly what's causing it to be so slow. For good VR on Vive or Oculus you need the CPU and GPU to complete in 11ms combined (90fps) (unbuffered).
     
    EarthHobbit likes this.
  5. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Another thing you can do to reduce batch count (draw calls) is reduce the number of unique materials. The more materials can be shared, the fewer draw calls you'll typically have. I've noticed some art assets on the asset store are not optimized at all in that area.

    There's an asset called Mesh Baker that will combine textures into larger texture sheets called "atlas" textures and adjust the meshes to use those new texture coordinates. It's specifically meant as a way to reduce draw calls:
    https://www.assetstore.unity3d.com/en/#!/content/5017
     
    EarthHobbit likes this.
  6. scottb9239

    scottb9239

    Joined:
    Jan 5, 2013
    Posts:
    107
    As Steve Tack touched on, the best way to influence the number of batches is to combine all like-materials together as much as possible (for example, if you have 10 materials that all use the same material type, eg. Bumped/Diffuse, then combine these together into one Bumped/Diffuse material, then do this for other material types, eg, transparent etc). So as an example you would put all the textures onto one large sheet together and then adjust all the UV"s for the meshes to represent that new place on the texture map.

    Here's an article about it:
    http://www.gamasutra.com/view/feature/2530/practical_texture_atlases.php?print=1

    Scott
     
    EarthHobbit likes this.