Search Unity

Unity's breaking point?

Discussion in 'VR' started by cgbenner, Aug 14, 2019.

  1. cgbenner

    cgbenner

    Joined:
    Jun 26, 2019
    Posts:
    13
    Hey....

    Can anyone tell me, on a computer that meets or exceeds all of the hardware requirements, latest drivers and running the latest version of Unity.... Is there a maximum recommended scene size, or perhaps number of assets that can be smoothly processed in play mode using Oculus Rift?

    I've been challenged to find the outer limits of Unity. I put together a scene with a full chemical plant. Roughly 2 dozen imported CAD models, all with dozens of individual meshes and all shaded. Everything loaded into Unity fine and I had the scene built and shaded in less than an hour. Gameplay with the Rift is extremely choppy and there are obvious FPS issue. The scene freezes and then catches up, tiles and is just very unpleasant to run. The file size of the scene is 475 KB.

    I'm sure there are ways I can optimize these models to make them smaller, but the point of this test was to basically find the breaking point. Now I need to determine if this is software or hardware related. Since the laptop more than meets the sys reqs, I'm thinking it's in Unity, and I may have FOUND my breaking point.

    Any ideas?
     
  2. mikerz1985

    mikerz1985

    Joined:
    Oct 23, 2014
    Posts:
    43

    It's not a limitation of Unity; all heavy 3d programs need to be optimized and VR in particular needs special care. For something like this, you'll see some benefit from single pass stereo rendering. You need to be very sensitive about what's happening in your shader; since you're using high poly meshes it matters a lot for both the vertex and fragment portions. If you can bake the lighting, that would be a big benefit. You would benefit a lot from using a LOD system for these kinds of meshes. You will benefit from marking the objects that will not be moving around as static. You will see benefits from using the LWRP.
     
  3. cgbenner

    cgbenner

    Joined:
    Jun 26, 2019
    Posts:
    13
    @mikerz1985

    If I am reading you correctly, the number of assets has less to do with the breaking point than how they are processed? Does that sound about right? If so, then our next focus (for me) is to learn about proper optimization.
     
  4. Matt_D_work

    Matt_D_work

    Unity Technologies

    Joined:
    Nov 30, 2016
    Posts:
    57
    so, at 90fps you have somewhere in the region of 11ms worth of processing time per frame. how and where you spend that time will depend on what your eventual goals are.

    large CAD models can contain an extremely large number of polygons (into the 100's of millions), assuming that your rendering is taking significantly longer than the allotted 11ms, its likely that you will need to simplify the models, or simplify the shader, or both, in order to approach a desired 90fps.

    you can use the unity profiler to get an idea of how much over you are, and then work backwards from there to determine what changes you'll need to make to your scene to achieve frame rate.
    (https://docs.unity3d.com/Manual/Profiler.html)
     
    Antypodish likes this.
  5. cgbenner

    cgbenner

    Joined:
    Jun 26, 2019
    Posts:
    13
    I have found that if I derive these large assemblies in Inventor, before pushing out to 3DS Max and exporting as FBX, I can drastically reduce the number of polys. Unfortunately it also means that I cannot apply shaders to individual faces in Max, because a derived assembly is seen as one single part. So, I have to do all of my shading in Inventor... which is slower than.... you know what. But so far, from the Unity side, the performance is much better.

    Thank you guys for the input!
     
  6. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    183
    Have you looked into using PIXYZ? It sounds like it's doing a lot of things you might be trying to do https://unity3d.com/pixyz
     
  7. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,196
    Feels like OP need big LOD optimization of meshes. Could improve things a lot.
     
  8. cgbenner

    cgbenner

    Joined:
    Jun 26, 2019
    Posts:
    13
    Again, thanks for the input. My only issue is with a specific set of models given to us by a third party. This was only a test anyway. My own Inventor models I am able to work with without any issues. If we have more of this down the road, I have some good ideas from this thread as to solutions.
     
    Antypodish likes this.