Modifiers: SimplifyModifier performance issue

Good Day,
Im am trying to simplify a buffer Geometry with a position count of around 203K positions. In order to reduce the position count by 100 position it is taking around 55 seconds. Am i doing something wrong? I was hoping to reduce position counts in the multi tens-millions down to 1 million or so but fear it will not be possible.

Are there any optimization techniques that would help? Maybe make triangle soup instead of indexed? If i were to put into an octree and simplify by octants? It also looks like this algorithm culls the least expensive, would maybe putting a “expense” constant in and then just cull anything below that in a single pass work?

Regards.

1 Like

If you’re planning on reducing 20 million vertices down to 1 million, why don’t you decimate your geometry in a 3D editor like Blender, and then import the simpler geometry?

These are real world terrain models that are modified in real time. I need to export the model to be opened in a CAD environment on users computer. Autocad support dwg/dxf which needs down sampling of the model in order to be a reasonable size. I deally would like to just push out a binnary TIN format but not sure how to get autocad to import that

1 Like

Running this through debugger i am getting al my time spent on “Run microtransactions” what is this?

image

Simplifying 20M vertices down to 1M in real-time is always going to take time and effort from your CPU. JavaScript is single-threaded, so doing these calculations will freeze your app. Maybe you could look into offloading the simplification calculations onto a Web Worker so it performs them in the background (in a separate CPU thread) so your main application doesn’t freeze?