Newton extremely slow :(

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Newton extremely slow :(

Postby Forthehorde » Sun Dec 29, 2013 11:41 am

I spent the weekend trying out PhysX which is pretty clean and fast but its character controller falls through objects and is a giant mess.

I then went back to my old friend Newton which I used back in 2008, I checked out the latest build from svn and was up and running in about 3 hours.

The problem's I am having are these:

Newton is extremly slow, I am using a large demo scene and getting 25 fps where as with PhysX in exact same test conditions up to 200 fps, this is only the scene geometry and character controller.

Code: Select all
GlobalWorld = NewtonCreate();
NewtonInvalidateCache(GlobalWorld);
NewtonSetSolverModel(GlobalWorld, 1); //8
NewtonSetFrictionModel(GlobalWorld, 1); //0

#define MAX_PHYSICS_LOOPS         1
#define MAX_PHYSICS_FPS            60.0f
const dFloat timestepInSecunds    = 1.0f / MAX_PHYSICS_FPS;


NewtonCreateConvexHullFromMesh returns 0 for very small meshes (these meshes caused problems in PhysX character controller, they are like tables full of small objects).

What could be going wrong?

I am using this scene for testing along with the sample code from intel:
http://www.youtube.com/watch?v=lj-8EYjusLk
User avatar
Forthehorde
 
Posts: 26
Joined: Sun Dec 29, 2013 6:17 am

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 12:36 pm

is that the right video?
the scene has 25 thousand objects?

I assume the are static object.

My guess you build the scene think the newton is Physx, but it is not

if that scene is the way you mention newton should be around an order of magnitude faster than PhysX.
That about 10 or more time faster, while more accurate and more stable at the same time.

How did you build you scene?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 12:44 pm

where did you downloaded that scene from? maybe I can try it out.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Forthehorde » Sun Dec 29, 2013 1:20 pm

I pm'd you my full source, just change the paths in the project and add newton folder to ThirdParty.
Actually I realised that I made lots of small newton meshes and that might be why its so slow, however if I try to create one giant mesh I get very strange Run-Time Check Failure #2 - Stack around the variable 'omega' was corrupted and stuff like that.
User avatar
Forthehorde
 
Posts: 26
Joined: Sun Dec 29, 2013 6:17 am

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 3:09 pm

what is ID3DBlob *mpBlob; ?

I have lot of error there?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 3:34 pm

Oh I see that some new stuff for d3d 11, I had d3d 10.
I am installing D3d 11, but I am no sure if my video card supports that.
anyway this is what I will do.
I will download the original demo from intell.
and I will add the basics to make the castle in t newton work. the I will send you the change so that you continue form there.
Is that ok with you.

I will use the CNetwon class, I believes that's the eassiest physic library there is. Much simpler that Netwon C,
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 4:57 pm

Ok now I manage to install dx11 in my system, I finally figure out why I could never installed in eh pass, I always have runtime error, s103 and I assume it was because my video card was not Dx11 compatible, but that was no the bug I read over MS side that
DX11 is a Visual studio 2008 application, so I had to un install Visual studio 2010 libraries, install Dx11 and then re-install Vs2010 redistributable again.
Now everything works,

I am getting between 60 and 100 fps in my system with all option on. supricinlly when I set the occlusion off my system shows almost the same performance
The performance do slow down when I set the Scalar rasterization mode.

for what I can see that a very small level mesh, yes newton should run at around 0.1 millisecond or less, (10,000 fps)
The problem is that you added each geometry piece as a rigidly, so you are running a scene with 25000, dynamic bodies, that will not be fast.

I will add the layer, and then you can go from there.
basically it is all a matter to separate what is dynamics form what is static.
every thong that is static should be place on a scene collision.
I see if I can get it going, and tonight and tomorrow.

are you sure there are 25000 pieces there, it does not looks like that? more like 250
Oh I see, the demo does not has all the litles object, how do I get the full scene to show?
Untitled1.png
Untitled1.png (2.35 MiB) Viewed 4555 times
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 5:28 pm

Oh I see in debug it load a lower resolution version.
I now run is release and I see all the meshes, loo very cool.

Ok I will add newton to the and make few thong dynamic and few thing static.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby FSA » Sun Dec 29, 2013 7:29 pm

If I have many static objects in my scene how schould I manage them? Actually I'm building a rigidbody with zero mass for every static object. Is that the wrong way?
User avatar
FSA
 
Posts: 322
Joined: Wed Dec 21, 2011 9:47 am

Re: Newton extremely slow :(

Postby Julio Jerez » Sun Dec 29, 2013 8:02 pm

you nee to make a scene collision, and add all the collision, as children of the scene collision, the you add one single static body to the world.

you can add, remove, and change the matrix of any child of a scene collision.
scene collision can take hundred of thousand of child shape, at the cost of one test in the broad phase

The can take collisions can take as children collision trees, convex shapes, hieghtfield, user meshes, and compound.
but they can not take other scene collision as children.

for example if a scene has, say 1000 objects, 900 of which are static.
in each step the work will maintain a broad phase or 1000 x 1000 shapes pairs that one million potentials pairs to find at most 10 thousand pairs.

if you place the 900 static shape in a scene collision, now the work will update will test (100 x 1000) that's about 100 thousand potential pairs at most.
to find the same 10 thousand potential pairs, in practice the member is much smaller but the ratios are the same.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Forthehorde » Sun Dec 29, 2013 10:29 pm

Thanks for looking in to this Julio. I was trying to use NewtonMesh and just adding each face after transforming the vertex by the mesh's matrix and it crashes, I guess there are also some degenerate faces somewhere or my code is just completly wrong lol, the demo scene is not perfect but its a really good character controller test scene.

Btw I forgot to mention you should download intel occlusion culling sample update 2 as that included a huge amount of optimizations (40% faster than original sample).
User avatar
Forthehorde
 
Posts: 26
Joined: Sun Dec 29, 2013 6:17 am

Re: Newton extremely slow :(

Postby Forthehorde » Tue Dec 31, 2013 9:10 am

Any luck with this? I tried absolutely everything and it always crashes :(
User avatar
Forthehorde
 
Posts: 26
Joined: Sun Dec 29, 2013 6:17 am

Re: Newton extremely slow :(

Postby Julio Jerez » Tue Dec 31, 2013 3:11 pm

It is the holidays. :)
I try after the second
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton extremely slow :(

Postby Forthehorde » Tue Dec 31, 2013 3:43 pm

Ok happy new year :)
User avatar
Forthehorde
 
Posts: 26
Joined: Sun Dec 29, 2013 6:17 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

cron