NewtonTreeCollision is very slow in 2.18

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: NewtonTreeCollision is very slow in 2.18

Postby Dave Gravel » Fri Apr 16, 2010 3:55 pm

Here, I don't have calcul times between because I can't rebuild my old demo with all new changes.
In my vehicle demo I use all times the same terrain mesh, I can see now the demo need some more delay for load the mesh.
I don't have try from serialization for now, for me the speed load is not really a problem but I can see a difference with before.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: NewtonTreeCollision is very slow in 2.18

Postby Julio Jerez » Fri Apr 16, 2010 11:32 pm

Well in the firs pass I got a 30,000 faces sample mesh from 25 secund to 8 secudn build time.
In debug mode in mys system.
I figure that my system in debug is like you is in release. so my guess this soudl be aroung tah time in yours too.
The good thing is that thsi buidl generate teh same bottom up tree,

It will still check if there are som more week point I can optime and make better,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonTreeCollision is very slow in 2.18

Postby Yezide » Sat Apr 17, 2010 10:08 am

Great to hear it is faster! Would really like for it to be faster still if possible :) 8 seconds for 30k is still quite a bit of time, so any speed-up is appreciated!
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Re: NewtonTreeCollision is very slow in 2.18

Postby Julio Jerez » Sat Apr 17, 2010 12:38 pm

Ok done. Please If you are reading this, do not forget to get 2.19 from the download again and let me know you results.
With my 30,000 faces test mesh I get this result:
intel core7 2.93 ghz takes 3 seconds to build
Intel Pentium 4, 2.4 ghz takes 7 seconds to build

I do not have the same mesh you are using but my guess is that since your mesh has fewer faces and your CPU is faster than a Pentium 4,
you should get around 4 to 5 seconds build time, Please let me know if this is right after you test.
This is all still using 100% a bottom up build algorithm.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonTreeCollision is very slow in 2.18

Postby Yezide » Mon Apr 19, 2010 1:53 pm

Julio Jerez wrote:Please If you are reading this, do not forget to get 2.19 from the download again and let me know you results.

Gonan try tomorrow or the day after that and will report back as soon as I have done so!
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Re: NewtonTreeCollision is very slow in 2.18

Postby Yezide » Tue Apr 20, 2010 9:16 am

Tried version 2.19 now.

It seems like it freezes when I try to compile 4 triangles.

The triangles (4 x 3 x 3 floats) are these:
Code: Select all
-56.750000, 5.485720, -43.694901, -56.750000, 4.318995, -44.048538, -54.750000, 5.485720, -43.694901,
-56.750000, 4.318995, -44.048538, -54.750000, 4.318994, -44.048538, -54.750000, 5.485720, -43.694901,
-56.685066, 4.182028, -43.486759, -54.814934, 4.182028, -43.486759, -56.685066, 5.223716, -43.097664,
-54.814934, 4.182028, -43.486759, -54.814934, 5.223716, -43.097664, -56.685066, 5.223716, -43.097664,



EDIT: Before the 2.19 froze, I managed to compile a mesh consisting of 15,616 triangles. This took 6792ms. In 2.08 compiling the same mesh takes 731ms. So it seems like 2.19 is still at around 10x slower than the compiling in 2.08. I am not sure sure it will work to have so long build time, but I have to make a final check when I can compile a complete map.
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Re: NewtonTreeCollision is very slow in 2.18

Postby Julio Jerez » Wed Apr 21, 2010 10:41 am

Oh yes there was a bug the will make it crash every time a small mesh was build.
I have the fix it now.
There was also a problem with the speed but it was a marginally.
Let us fist have a working version before start make changes.

I was expecting the bottom up algorithm to be around two to three times slower than bottom up.
The bottom up have two sorts in the outer loop, plus won heap, while top down does not have any kind of sort.
Plus to down inner loop have many more operation than top down since the proximity test is a full aabb to aabb distance while top down s just a plane side test.

Anyway, can you try 2.20 to see if is is any better, at least is should not crash under any circumstance.
What can do is that I can use the Optimize option to decide what algorithm to use in the build process.

Optimized use Bottom Up,
No optimized use Top Down

Is that solution an acceptable solution?

Also function NewtonTreeCollisionEndBuild (const NewtonCollision* treeCollision, dFloat maxAspectRation, int optimize);
Now take and extra parameter to make sure there are not indecent face in the tree, since you face are already well behave to can pass a large value like 10000 and no time will be spend in that face al all.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonTreeCollision is very slow in 2.18

Postby Yezide » Wed Apr 21, 2010 11:35 am

Optimized use Bottom Up,
No optimized use Top Down

Is that solution an acceptable solution?

Sounds good to me! That way I can have a fast mode for testing and slower for release version.

Gonna test 2.20 in a day or two.
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Re: NewtonTreeCollision is very slow in 2.18

Postby Yezide » Mon Apr 26, 2010 3:47 am

Anyway, can you try 2.20 to see if is is any better, at least is should not crash under any circumstance.

Could not find any 2.20 in the download list, so I assume that it will come up in the near future? Or is there a new version of 2.19 up that I should test?
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Re: NewtonTreeCollision is very slow in 2.18

Postby Stucuk » Mon Apr 26, 2010 6:46 am

Yezide wrote:Could not find any 2.20 in the download list, so I assume that it will come up in the near future? Or is there a new version of 2.19 up that I should test?


Just modify the 2.19's url to have 20 instead of 19. Julio doesn't release "test builds" so you won't find any link on the downloads section.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: NewtonTreeCollision is very slow in 2.18

Postby Julio Jerez » Mon Apr 26, 2010 7:04 am

Yeside there was a problem in 2.20, and I pull it down.
I was working on two problems, your and resolving inacuracis with large and oblong poligon, and I made a mistake so I have to undo it.

I fnished that collision improvement this pass weekend.
You can try downloading 2.20 again, but still do not have the fast build more yet, only the marginal improvemnet, I am working on the fast buidl mode now.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonTreeCollision is very slow in 2.18

Postby Julio Jerez » Thu Apr 29, 2010 11:03 am

Ok Yeside, I added the Top down build, for what I can see this build should be even better than it was in 2.08
But I do not get the time you are getting.

Please try it and let me know what results you get. Remember it is in the non optimizing mode.

Download 2.20 from the download site
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: NewtonTreeCollision is very slow in 2.18

Postby Yezide » Tue May 04, 2010 4:31 am

Gonna test today or tomorrow! Sorry for time it is taken but my workload is very heavy atm.
User avatar
Yezide
 
Posts: 173
Joined: Tue Oct 18, 2005 4:31 am

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest

cron