Search Unity

High poly object optimization

Discussion in 'General Graphics' started by DenisTribouillois, Jan 12, 2021.

  1. DenisTribouillois

    DenisTribouillois

    Joined:
    Jun 14, 2016
    Posts:
    3
    Hi,
    I'm working on a project of VR visualization of 3D scanned objects.
    The objects are pretty heavy and detailed (for exemple, one of them is 6,800,000 vertices /14,000,000 faces).
    The source STL file is around 650MB, when converted in OBJ and imported in Unity, the OBJ file is now 1.1GB
    Loading such a file in a VR environment (Quest 2) is both annoying for pure file size and is way too laggy to display properly on the Quest 2.

    I'm using MeshLab + 3DHOP for online WebGL visualization and it's working great. After the conversion pipeline (using Nexus, as described in 3DHOP HowTo) I end up with a 60MB file, with no noticeable quality loss. The file also contains multiple LODs.

    Of course, and unfortunately, the 3DHOP file is specific and can not be loaded in Unity.

    So my question is: is there a way to optimize/compress the 3D object to a more reasonable size? (meaning in a similar way 3DHOP is doing it, without quality loss and using LODs)
    Maybe the source file is too big for Oculus Quest 2 and I should work on a lower resolution file? Or change Unity settings (I'm using default material, URP, one directional light)

    Thanks for your help!
     
  2. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    It might be possible, that some of these models moreso the high poly ones, have alot of UV's, UV islands and seams, which might be causing the file size to increase. If that is the reason, then you might have to put the objects in one of those 3d modelling software, like maya, or 3dsmax, Cheetah 3d, or blender, and remove unnecessary UV's and seams, or re UV the objects individually, which can be sometimes easy or tiring to do.

    The other reason, is that some of the models you mentioned in your post, have too many polys. You might have to reduce the polycount, in a poly reducing software, or use the software I mentioned above, to reduce the polycount.
     
    Last edited: Jan 21, 2021
  3. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    You're not even gonna be able to render 14M faces (assuming even more triangles as triangles != faces) on a Quest. I would suggest you get a new model or try something like SimplyGon to reduce model quality
     
  4. DenisTribouillois

    DenisTribouillois

    Joined:
    Jun 14, 2016
    Posts:
    3
    Thanks for the repplies!
    I indeed reduced the polycount, using Meshlab "Quadratic Edge Collapse Decimation". Results are quite good, but I have no idea if it's best/standard method to do so.
    I don't think there are UVs in the Mesh (using STL, which should have only vertices positions) and I don't need them, but good to know it might increase file.
    With 2M faces (only object render in the scene) I have 20-30fps on quest2. Then it just comes to performance VS quality when I reduce polycount.

    I still have no idea how 3DHOP manage to reduce file size so much without quality loss.
     
    BrandyStarbrite likes this.
  5. norair97

    norair97

    Joined:
    Dec 14, 2021
    Posts:
    2
    Another possibility is to use Streaming. So you basically offload your XR app to a server/notebook and just connect to your XR app, that is running on your server/notebook. Have fun showing 30MIO+ polygones on Quest 2 or 3. Here on github you can have a look: https://github.com/Holo-Light-GmbH/ISAR-SDK-Trial
     
  6. xofreshxo

    xofreshxo

    Joined:
    Apr 12, 2017
    Posts:
    79
    What you want to try to do in your photogrammetry/scanning/mesh software, once you have a high-poly model with high-res textures & normals, is 1) simplify/decimate the model and then 2) Reproject your high-res textures onto the lower poly models. I've had the best results with this when I perform the reprojecting in the photogrammetry/scanning (i.e. Reality Capture, Meshroom, etc.) software as opposed to afterwards in the mesh software (Meshlab, Blender).
     
    BrandyStarbrite likes this.