Announcement

Collapse
No announcement yet.

Instances Extremely Slow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Instances Extremely Slow

    Hi!

    I'm just testing a scene with a simple object (~55.000 polygons). Scene export until V-Ray starts rendering is ~1.5 seconds.
    After building an instance array with 5x5x5 (=125) instances the scene export takes ~1 minutes and 50 seconds, almost as if V-Ray exports every single instance as a complete mesh.
    If I do the very same using a "Replica Array", scene export time goes down to the expected ~2 seconds.

    Is this a shortcoming of MODO or is it the exporter?

    Thanks
    Steffen

  • #2
    Just to clarify, it's the "Translating Modo scene to V-Ray" part that takes the times I mentioned. After that, the "Exporting Keyframe" part takes ~7.5 seconds in all 3 cases.

    Comment


    • #3
      That's not normal. The exporter needs to iterate over the mesh's polygons during "Translating Modo scene to V-Ray" in order to get
      their material, part and selection tags, which are needed for the proper material export. The results are cached for each mesh though
      and used for its instances. I have a test here with a 1000 instances resulting in 500 billion triangles that exports in less than a second.

      I probably have a bug in the caching scheme, that manifests in your scene. Is there a chance you can send it to me ?

      Btw, 7.5 seconds for the key-frame export seems like a lot too. Are those 55000 polygons subdivisions ? If yes, what number of polygons are they expanded to ?
      Can you try setting the "render" and "subdivision" levels in the mesh properties to the same value ?

      Greetings,
      Vladimir Nedev
      Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

      Comment


      • #4
        Thanks for taking care of this, Vladimir.

        I'm still investigating and I'm trying to reproduce the bug (?) with a simpler / non-production non-top-secret ( ) mesh.
        At first I thought it might be related to me using the latest 801 SP3 and new changes that you @Chaosgroup didn't have a chance to adapt your exporter to, but after testing the same scene / mesh with the 801 SP2 I get the very same numbers.

        There are 3 things I found so far:

        Opening the scene and clicking "Render with V-Ray" results in ~1.5 seconds translation time plus an additional 7.3 seconds (!!) for exporting the keyframe. No animation, no subdivision is on the mesh. It's a simple CAD model made up only of "faces".

        Using the "Mesh Cleanup" command gets rid of some two- and single-sided polys and brings the keyframe export time down to 4.3 seconds. The mesh itself contains several >4 vertex n-gons plus UVs plus vertex normals.
        Deleting the vertex normals and/or the UVs doesn't improve anything. BUT: triangulating the mesh brings the keyframe export time down to 0.2 seconds (!!!).
        So it looks like it has something to do with n-gons. There are some nasty ones in there, some with a few thousand vertices (it's from a CAD exporter). Converting them to triangles / quads helps a lot. Also getting rid of 1- and 2-point polygons helps a lot.

        But then again, instancing this optimized mesh 125 times still results in roughly 2 minutes scene translation time (with 0.2 seconds of keyframe exporting time).

        So it looks like there are 2 different problems...
        Last edited by Steffen Dünner; 10-01-2015, 05:14 AM.

        Comment


        • #5
          Yes, 2 separate problems - the instance handling and the mesh triangulation.

          For the triangulation I am using the one provided in the MODO API starting from MODO 801. So I don't think I can do anything to speed this
          up. Writing this on our own can be quite a complex task, because it will have to handle all kinds of edge cases.
          How long does it take to run the triangulate command in MODO, is it very fast, or does it take around 7 seconds as well ?

          Interesting that polygons with 1 and 2 vertices also slow it down, I am not using MODO for these. That's strange.

          For the instance problem, what happens if you use another mesh with the same number of faces ? Is it fast that way ?
          The slow-down is probably caused by the set of material/part/selection tags on the mesh, or its internal name as set by the importer
          (the name is used for finding the cache). Maybe you can run a "jitter" command on the mesh with a changed seed, and send it to me.
          This way I can't see or use the original mesh.

          Greetings,
          Vladimir Nedev
          Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

          Comment


          • #6
            The MODO renderer starts rendering instantly, no matter if there's the original mesh or the "fixed" version in it.

            The funny thing is that during my mission to destroy the mesh for export, I created a true monster for MODO for V-Ray to render (and for MODO to cleanup / triangulate)

            Here it is: https://www.dropbox.com/s/4sebvx9c5m..._mesh.lxo?dl=0

            You should be able to import it into a fresh MODO scene and after clicking "Render with V-Ray" it should take several minutes to start rendering. In my case the "Export Keyframe" time is ~2:45 minutes!!!
            The MODO renderer starts rendering even this mesh in under a second. OK, this mesh is seriously damaged, but maybe it leads you somewhere, especially given the enormous difference before rendering starts.
            Still trying to find a simpler scene to give to you...

            Thanks
            Steffen

            Comment


            • #7
              The slow "translating" with many instances is most likely caused by the 3000 part tags that the mesh has. I will try to optimize my code
              and write back here when it is done. But until then, you can try selecting all the mesh faces and then doing a
              Geometry -> Polygon -> Set Part... and set them to all use the same new part tag. This will delete all the old part tags.
              I suspect you don't use them since it seems they don't have descriptive names.

              Yes, the modo production and preview renderers start very fast on this scene. It seems they use some cached
              version of the triangulation, or maybe there is a performance bug in the API for 3rd parties. The modo triangulate
              command seems to run very slow too. I don't think I can do anything here, aside from reporting this to Luxology.

              Greetings,
              Vladimir Nedev
              Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

              Comment


              • #8
                Wow! Didn't pay attention to 3000 (!!!) part tags. Must come from the CAD conversion process.

                As I said. This mesh is seriously damaged. I can e.g. run the "Mesh Cleanup" several times and get fixed face normals again and again.

                And yes, triangulation is SLOW in MODO. I'll file a bug @Luxology.

                EDIT: And yes, getting rid of the insane amount of parts really helps with instancing.

                Thanks
                Steffen
                Last edited by Steffen Dünner; 24-09-2014, 03:35 AM.

                Comment

                Working...
                X