SharpNav icon indicating copy to clipboard operation
SharpNav copied to clipboard

Mesh generation time. Testing on big meshes.

Open Stridemann opened this issue 6 years ago • 2 comments
trafficstars

Hi Many thanks for this system. Not sure it still have some support.. Trying to make it work for my case. I can say generation is perfect, navigation is fast as hell even on big maps. But I have a problems with big (huge?) meshes.

I have something like a grid (let's say 2 dimensional array of bools) that goes to my fast pre-optimization algorithm that form a bigger squares from small one.

For 11k vertices mesh it takes 4.5sec, it's ok. Here is the SharpNav input mesh: https://dl.dropboxusercontent.com/s/f8tfv4sxu4sfgku/PoeHUD_2019-01-14_21-38-41.png SharpNav makes a optimized mesh (really nice): https://dl.dropboxusercontent.com/s/gmy3o84qhl89ekx/PoeHUD_2019-01-14_21-37-47.png Mesh obj: https://ufile.io/z2pc7

200k input mesh: https://dl.dropboxusercontent.com/s/ej7nzkrf28rc0if/PoeHUD_2019-01-16_06-34-27.png Takes maybe 2 min to generate a mesh: https://dl.dropboxusercontent.com/s/cjbj8ue77oyosn0/PoeHUD_2019-01-16_06-35-33.png Mesh obj: https://ufile.io/jf73z

On huge meshes it goes to infinity (1.8m vertices), I'm tired to wait when he finish processing. Mesh obj: https://ufile.io/rj1gi

Was trying to make a profiler measurements Jetbrains dotTrace.. it doesn't help a lot in case if I don't know the source code.. https://dl.dropboxusercontent.com/s/og2hqk8z4qp9xte/dotTraceView64_2019-01-16_07-01-10.png .dtp file https://ufile.io/cpe2y

Should I try to do something with this or is there some other way? Maybe make some better pre-optimiser for it.. I know that all of this works fast on original C++ Recast with a custom C# wrapper I have for x32 bit.. (don't have it's code) but I need for x64 bit, so...

Just want to hear ur opinion about all of this..

Stridemann avatar Jan 16 '19 05:01 Stridemann

Maybe I should try to split the huge mesh into few small size... ?

Stridemann avatar Jan 16 '19 05:01 Stridemann

It's been a while since I've actually worked on this project. The code was ported over instead of wrapped, so it should have similar performance characteristics but it won't ever be identical. There were some changes made to better suit C#.

IMO the code should be revisited, built on a newer version of .NET (Core?) and optimized using the available features. Vectorization and Span<T> will likely help out a lot.

This repo is also several years out of sync from Recast, so if they've applied more optimizations, it would be worthwhile to port those optimizations over.

I don't really have much time or energy to spare on open source work. I'll accept PRs and make new releases just so that things can stay in one place, but for the time being I won't be able to actually work on this.

Robmaister avatar Feb 10 '19 23:02 Robmaister