Aborting long calculation in Newton

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Aborting long calculation in Newton

Postby Bird » Wed Aug 07, 2013 5:06 pm

My Newton project is an artist tool rather than a game and I need to be able provide users with a way to escape if they've done something that causes Newton to become unresponsive during long calculations. My beta testers have done silly things like adding 200,000 bodies to the scene and trying to use NewtonMeshApproximateConvexDecomposition on a mesh with 4 million polygons.

Is it possible to abort Newton now in such situations?

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Aborting long calculation in Newton

Postby Julio Jerez » Wed Aug 07, 2013 6:07 pm

NewtonMeshApproximateConvexDecomposition is used by 3ds and teh has teh same problem, fo rthat I added a progrees bar call back.
this was about 6 to 8 years ago, so I do no even know if still works.

NewtonMesh* NewtonMeshApproximateConvexDecomposition (const NewtonMesh* const mesh, dFloat maxConcavity, dFloat backFaceDistanceFactor, int maxCount, int maxVertexPerHull, NewtonReportProgress reportPrograssCallback);
The last parameter is a poite ot the progress bar functions, di dyou try that?

but the one thing that I found help more a lot is that decimate the mesh with a mesh reduction tool.

I will add the funtionality, but that have to way for next week, after I do the Scaling and few oeth task I have pending.

Bascially I will make the progress bar call bakc funtional again and I will add a return funtion for termination.
That should fix it
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Aborting long calculation in Newton

Postby Bird » Wed Aug 07, 2013 6:30 pm

Yes, I've tried NewtonReportProgress for NewtonMeshApproximateConvexDecomposition and it seemed to work fine. If you could allow us to set a termination flag during the callback, that would be great!

What about doing the same when Newton is bogged down with a heavy scene. Is there any wait to abort Newton then?

Thanks!

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Aborting long calculation in Newton

Postby Julio Jerez » Wed Aug 07, 2013 6:37 pm

Ha good that it works,
yes that was I meant I will change the progreess bar callback so that it returns a bool that when teh values is false it will terminate the proccess.
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Aborting long calculation in Newton

Postby Julio Jerez » Wed Aug 07, 2013 6:38 pm

how long does a single frame is taking for a 200,000 objects?
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Aborting long calculation in Newton

Postby Bird » Wed Aug 07, 2013 8:46 pm

Julio Jerez wrote:how long does a single frame is taking for a 200,000 objects?


Ha, it's LightWave that''s taking all the time. Newton updates in a under 2 seconds and LW takes almost 10 minutes. My scene was just 200,000 boxes in a long column, falling down on a ground mesh.

Code: Select all
Controller.cpp(255): [19:50:22.453] [P2852|t44] INFO: Added 200000 bodies in 4.84557 seconds
Controller.cpp(196): [19:50:25.578] [P2852|t44] INFO: PhysicsState::Start
Timer.cpp(46): [19:50:25.625] [P2852|t44] INFO: LW time: 0.0430618 seconds
Model.cpp(186): [19:50:27.359] [P2852|t44] INFO: Newton time: 1.73309 seconds
Timer.cpp(46): [20:00:04.703] [P2852|t44] INFO: LW time: 576.19 seconds
Model.cpp(186): [20:00:05.906] [P2852|t44] INFO: Newton time: 1.19509 seconds
Timer.cpp(46): [20:09:31.875] [P2852|t44] INFO: LW time: 564.838 seconds
Model.cpp(186): [20:09:33.093] [P2852|t44] INFO: Newton time: 1.20904 seconds


But I found a problem in the "Scaled Mesh Collision" demo scene (release config)
-on line 312 of ScaledCollision.cpp I changed count = 100, to create 100,000 primitives and ran it. After several minutes of inactivity the demo app just crashed.

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am

Re: Aborting long calculation in Newton

Postby Julio Jerez » Wed Aug 07, 2013 9:00 pm

Bird wrote:Ha, it's LightWave that''s taking all the time. Newton updates in a under 2 seconds and LW takes almost 10 minutes.

That was what I though.
In general high quality rendering takes longer that a physics updates. I am gessung that if you are making an animation you can set the render off or to minumum quality while you generates the animation and save it.
then what most people do is tha the use ditributed system to render in parallel.

Bird wrote:-on line 312 of ScaledCollision.cpp I changed count = 100...

is one of the sandmox demos?, I will try tonight. se what is wrong. I had never tried so many objects.
the most I try was a big block of 30 x 30 x 30 staked spheres.
Julio Jerez
Moderator
Moderator
 
Posts: 12478
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Aborting long calculation in Newton

Postby Bird » Wed Aug 07, 2013 9:13 pm

In general high quality rendering takes longer that a physics updates.


This is just very slow updating in LW's opengl viewport. I'm wasn't doing any raytrace rendering. I'm using LW Instancing for the boxes ... maybe there's a bug there.

LW's raytrace render preview is very fast these days. I made a little demo using Newton .... just 200 boxes though. :)
http://hurleyworks.com/media/flash/BoxBuster/BoxBuster.html

-Bird
Bird
 
Posts: 636
Joined: Tue Nov 22, 2011 1:27 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron