Bodies not detecting collision with my player

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Bodies not detecting collision with my player

Postby JoeJ » Tue Dec 06, 2016 1:42 pm

Yes, AMD can process different tasks even on the same CU. Nvidia still does not make such details public. Currently VK exposes max. 4 compute queues for AMD card, but 16 for NV.

I tried to use 3 queues simultaneously and the timestamps of the dispatches overlapped which proofs it works, but it was slightly slower than using just one queue.
However, each of my dispatches was demanding and can saturate the GPU on its own so that was a bad test case.
They say we should pair bandwidth heavy with ALU heavy tasks, but like you i'm hoping more for a solution for small workloads. E.g. i have shaders that need to process a tree with one dispatch per level, so i have tiny workloads near the root.
Early next year i should know more, but from what i hear everywhere we should not expect too much. Let's hope im wrong...

The API is good (but really cumbersome to use, otherwise i'd create a test case to get a quick answer :)
Maybe there is some work left on the drivers but i doupt so. Actually Mantle driver handles both VK and DX12 on AMD.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Wed Dec 07, 2016 2:51 am

time for another video capsule.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby JoeJ » Wed Dec 07, 2016 3:12 am

:)

Ahem - if device side enqueue is indispensable for you, you could use Cuda for NV and CL 2.0 for AMD.
I've never used it and don't know how well it works.

For AMD there are still many R-3XX cards that do not support 2.0, and in the 2XX series only 290 and 285 have soppurt.

Don't know for Nvidia.

Intel has CL 2.0 support, but i assume they group similar device side enques to a large batches and process it serially. (I assumed that's similar for all vendors and under the hood it leads to similar limitations like the graphics APIs. You'd need to check this)
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Wed Dec 07, 2016 9:13 am

well we just nee to pick one API, and developed it, after that working I we will know the short comings, and form that we can add more GPU modules.

I will start with Intel OpenCL, because I am guessing Is the more flexible for developers.

Remember we do no need to do everything on GPU, stuff that is more convenient on CPU can be done on CPU and the load to GPU memory.

for that all we need to have is the vector array version of all the systems, which will be the focus of 3.15, for example the first task of 3.15 will be the vector array version of the broad phase, which I already have on paper.

there is a potential for great saving there, specially with particle support, since that stuff is mostly big data manipulations.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby JoeJ » Wed Dec 07, 2016 2:10 pm

Julio Jerez wrote:I will start with Intel OpenCL, because I am guessing Is the more flexible for developers.


Yeah, should be fairly easy to port this to another API later if desired.
Intel CL also has kernel debugger integrated in VS now :)

To me there is only one thing CL 1.x can do but those stupid shading languages can not:

CL has pointers so you can take a piece of float4 typed LDS memory and when you're done cast it to another type like uint2 and continue.
With GLSL you would need to reserve twice the memory for nothing, or you do crazy casting and indexing on each access.

Anything else is pretty much the same on both sides.

Maybe device side enque will come to graphics APIs as well, Mantle has it.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Thu Dec 08, 2016 9:39 am

and one more
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby JoeJ » Thu Dec 08, 2016 5:39 pm

That's a good one - shows a lot of Newtons advantage.
Also i really wonder because even my own physics * was able to get to rest with such capsule setups.

Seems you have good progress with softbodies?
But there's nothing like this to see in sandbox yet, do i need to open a specific project?


If we create a simple tetrahedron softbody, do you have a way to prevent flipping it inside out?

I've had experimented with plane contraints for that, but i did not always work.
So i ended up using particles with orientation which worked well and was not much slower than hving distance AND plane constraints.
I did not use inertia, only point mass, but it behaved natural because connected point masses get that kind of behaviour automatically.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Thu Dec 08, 2016 6:54 pm

I am still one more weekend away, from having the first working demo.

A tetrahedral flipping inside out will depend on the strong of the external force.

If the forces are so strong that the deformation is such that the volume of the tetra becomes negative, the tetrahedral will flip else it will not. This criteria there can be used as constraint to prevent that event. Later when I get the first demos, there will be a utility that will convert solid mesh to tetrahedral meshed and these tetrahedral will be the atomic based of a softbody simulation.

The advantage of this is that all of the properties of a soft body: like volume preservation, ply deformation, twist etc, should emerge natural from the simulation, and long as the stiffness and damping are set to match the real life material.
The soft body solver is not the Jacobson verlet mombo jumbo, it is a more serious solve that should reproduce extreme realistic behavior in part with Finite Element Analysis solvers.
It should be able to produce proper friction, interact naturally with rigid bodies, and can be attack to other soft bodies or rigid bodies using the standard joints. and all that should come seamless from the simulation or particle constraints.

I am hopping that this weekend I can have the first demo up and running.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Thu Dec 08, 2016 7:08 pm

JoeJ wrote:Also i really wonder because even my own physics * was able to get to rest with such capsule setups.


the long thing capsule is actually quite a challenging problem. The reason is that the inertia matrix of the capsule is quite skewed, so any slight moment translate to high angular velocity of the body.

the people has these problems for years and the think they are doing something special.
the answers is that this is hard to solve problem, In newton I brought back a function that I used in 1.5 that allow me to test if a configuration was going to be stable or not.

basically to know if a configuration is stable will you need to know is get the singular values of the
mass matrix and check is the ratio of form the larger singular value to the smaller is a number that can be encoded with half the number of significant bit of a float.

for that capsule tower that ratio comes about 2000 barely the maximum condition number that can deal with in 32 bit float.
it is not only the mass ratio that can create high condition number a skew inertia is even more difficult to deal with.
in any case these kind of test are useless, but for some reason nvidia thinks they are of some values even though their engine does not passes their own tests.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby JoeJ » Fri Dec 09, 2016 3:34 am

Julio Jerez wrote:the long thin capsule is actually quite a challenging problem. the reason is that the inertia matrix of the capsule is quite skewed so any slight moment translate to high angular velocity of the body.


Makes sense. I did not have this problem because i also modelled capsules by 2 point masses and a distance joint between.

So it might be a good idea to use your new soft bodies for long objects like wood planks.
Would this work with a low number of points like 16 or do you need high tesselation?
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Fri Dec 09, 2016 10:56 am

Ha now you are getting to the central problem.

A box is a perfect solid with zero degree of freedom on the internal parts. Therefore is we assume we have perfect solver. The box onle deformation allowed are the one possible but the internal stress properties of the material.

we are representing the box with stiff spring and dampers. so the box should only deform by what the spring allowed to deform. Of course the solve is no perfect so we also has to account for error in the solver.

what this mean is that, in the limit a simple box of 18 links, should behave exactly like a rigibody with some linear elasticity. Is you take the same box and we subdivide into more voxels, the this will add high order deformations.
right the we already have a model for building complex soft bodies in a natural way using boxes as build blocks. Voxelized the nodel and represent with stiff springs.
This is the simple model, a more robust model is to make a constrained tetrahedralizasion of the model and represent each tetra by springs/dampers. This is actually very realistic because the are already FEM that map properties of real material to string/damper of a tetrahedral.

but that will come later, the fist thing we need to get going is the simpler but robust cloth model, with collision and self collision.
I hope I get some of that this weekend.

BTW I added a generic LumpMass collision object that will serve as the interface for:
-unconstrained particles (people has asked for this for a long time)
-cloth
-elastic and deformable bodies
-particle hydrodynamic fluid

the last one will be for small fluid objects like glass of water, gun smoke, bum fire, plasma and goo stuff.
I do not have the illusion that I will be able to model large bodies of fluid, to me that is just a waste of time, computer are no powerful or fast enough to cope with volumetric problems like oceans , swimming pool and stuff like that in real time but small objects that can be model with less than 1000 particle are with in the scope of real time simulation, so I will for for that.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby pHySiQuE » Sun Dec 11, 2016 12:34 pm

If you presented it a bit better, that would make a very powerful case for Newton.

The PhysX blocks should be bright green, the Newton blocks should be orange, and the Bullet blocks should be yellow or gray. It is very hard to keep looking back and forth to figure out the color code.

A side-by-side render running at the same time might be easier to see. Each simulation should have the brand logo shown in the corner.

You need some graphs showing actual results in a visual manner. This should all be on your front page. It would make an extremely compelling argument if it was laid out really clearly.

The misspelled words need to be fixed.

There's no point in showing two different versions of Newton. It just makes things more confusing.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Bodies not detecting collision with my player

Postby JoeJ » Sun Dec 11, 2016 2:41 pm

Edit: deleted nonsense
Last edited by JoeJ on Tue Dec 13, 2016 8:39 am, edited 1 time in total.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Bodies not detecting collision with my player

Postby Julio Jerez » Mon Dec 12, 2016 10:11 am

pHySiQuE wrote:The PhysX blocks should be bright green, the Newton blocks should be orange, and the Bullet blocks should be yellow or gray. It is very hard to keep looking back and forth to figure out the color code.

those are compiled dlls, I can not change color or anything.
I am interested in comparing newton VS newton. that tool in fact has being a big help for tuning the engine for both performance and quality.

Joe,
I committed the skeleton of what the soft body system work be. still need a lot of work, in every area.
-no friction,
-no picking logic
-collision is brute force and only again flat terrain
-solve still misses half of the derivatives.

I need to work on each one of those item one at time until they are all working.
you were right, a box is no stable. I try it and what happens is that as along as the perturbation is small (linear stretch) the box recover, by ass soon a is passes some limit, the is folds onto itself because it does not know who to preserve volume.
maybe late after the solve is done we can add some force like volume preservation, pressure, wind and other stuff. for now we just need the springs stable.

now I am debugging why it allowed such deep penetration when pressure down the ground, this should no happens. then this week I will added the rest of the derivative.

The tetrahedral seem to be the best building block for constructing solid because is does not required any extract links, of forces.
so I will have to get the tethahedralization tool working, it may be broken.
for now I can get some model from the interned that are already converted to FEM from.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Bodies not detecting collision with my player

Postby JoeJ » Mon Dec 12, 2016 6:04 pm

Julio Jerez wrote:by ass soon a is passes some limit, the is folds onto itself because it does not know who to preserve volume.
maybe late after the solve is done we can add some force like volume preservation


So if the volume comes close to zero the tetrahedron knows it is in trouble, and fliped if negative.
I think this can work, but i'm still worried what would happen if some tetras in a body get fliped, some planar, some ok... In the worst case can this cause some chain reaction of chaos?

I remember i tried to make a tetra constraint too and how i failed on this.
I did not find a equation that resolved it to it's initial state without causing the effect of an unwanted external force.
I've spent months on this, got crazy :)
Ha ha, today i know all i needed to do would have been set it to initial state and translate / rotate so that momentum is conserved - super easy :roll:

But doing this for multiple connected tetras? Still no clue how guys like you do this :)
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 20 guests