IrrPhysx 0.2 - Nvidia Physx 2.8.1 wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

threading is enabled by default in physx. The only change that can be made is using the non-blocking fetch results which will allow you to continue running until the results are in from the last simulate. With a large number of objects this will increase your fps but the physx itself will still be the same speed. This doesn't make much of a difference but if you are getting 50fps but are having to wait .2 seconds for physx to return then you need to optimize your physx objects. I have thought of making the fetch results non blocking, I will prolly have to write a different function for it to work well with how things are currently set up.

I would suggest not using triangle meshes as your physx objects. This makes a very large number of triangles for each object, if you need it to be close but not exactly the same try the convex meshes. Or Make a less detailed representation of the object and make that into a triangle mesh to reduce the poly count.

I am currently focusing on learning shaders since that is going to be one of my parts on the game I am working on. So I haven't had much time to work on irrphysx. I will try to set up the svn today when I get home and that should help with things like character controller and let you help debug some of the issues. I lost my train of thought... so I will stop.
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

Hi, guys !!!!!!!!!!!!!!!!!!

Could someone gime me an advice ??


This is dangling vertically revolute joints

Code: Select all

	NxRevoluteJoint* revJoint = NULL;
	PhysXNode* box1 = physx->CreateBox(smgr->addCubeSceneNode(4), 4,4,4, vector3df(0,14,0));
	box1->GetActor()->raiseBodyFlag(NX_BF_KINEMATIC);
	SetActorCollisionGroup(box1->GetActor(), GROUP_COLLIDABLE_NON_PUSHABLE);
	physx->Nodes.push_back(box1);
	
	PhysXNode* box2 = physx->CreateBox(smgr->addCubeSceneNode(4), 4,4,4,vector3df(0,10,0));
	SetActorCollisionGroup(box2->GetActor(), GROUP_COLLIDABLE_PUSHABLE);
	physx->Nodes.push_back(box2);

	int x =  box1->GetActor()->getGlobalPosition().x-2;
	int y =  box1->GetActor()->getGlobalPosition().y-2;
	int z =  box1->GetActor()->getGlobalPosition().z;

	NxVec3 globalAnchor = NxVec3(x,y,z);
	NxVec3 globalAxis = NxVec3(0,0,1);

	revJoint = CreateRevoluteJoint(physx->pscene, box1->GetActor(), box2->GetActor(), globalAnchor, globalAxis);
How to do the same, but for the horizontall position, to make this looks like a door ????????????????????????

Thanks in advance !!!!!!!!!!!!!!!
Steel Style
Posts: 168
Joined: Sun Feb 04, 2007 3:30 pm
Location: France

Post by Steel Style »

IIRC you need to change you global axis example (0,1,0);
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

Congratulate me, boys !!!!!!!!!!!!!!!!!

Finally i made my PhysX fluid implementation, it was a simple task.
I made it using MyFluid class from SDK samples and CParticleSystemSceneNode from Irrlicht sources.

Here is the screen

Image
Insomniacp
Posts: 288
Joined: Wed Apr 16, 2008 1:45 am
Contact:

Post by Insomniacp »

awesome, I am having trouble setting up svn on my web-site but it should be up shortly unless someone lied to me and I can't do it. Once it is up it would be nice if people could help debug the last few issues in the todo list then we would be able to release the next version and start adding fluids and joints and things like that.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Cool job rootroot1, how's the performance though?
Image Image Image
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

Do you mean global performance, or fluid performance ??

In global case we can just use active transforms, this will increase speed.
But with fluids I'm thinking for another way of drawing, because when we draw less than 10 000 particles everything is ok, but when we trying to draw more than 20000 particles fps is too slow, and it was a message about 16 bit index buffers :cry: Currently, I haven't ideas how to speed up fluid drawing,
but in my example I did it in the same way like sio2 did

:idea:
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Have you tried using the spark engine? There might be some way to combine it's performance with physix positioning...
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

I've tried using it, but i dont know how to draw custom set of particles with custom coordinates :(
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

rootroot1 wrote:Do you mean global performance, or fluid performance ??

In global case we can just use active transforms, this will increase speed.
But with fluids I'm thinking for another way of drawing, because when we draw less than 10 000 particles everything is ok, but when we trying to draw more than 20000 particles fps is too slow, and it was a message about 16 bit index buffers :cry: Currently, I haven't ideas how to speed up fluid drawing,
but in my example I did it in the same way like sio2 did

:idea:
That makes sense. Assuming you have 6 indices per point sprite (I'm guessing that's what you are rendering with) then you will receive 6 indices per point sprite:
6 indices/particle * 10,000 particles = 60,000 indices <= 2^16 = 65,536
6 indices/particle * 20,000 particles = 120,000 indices > 2^16 = 65,536

Therefore you will receive that message about 16-bit index buffers. You can use 32-bit index buffers (I don't know how PhysX works) to solve the problem. I have one question for you. Do you receive that poor performance when PhysX starts complaining about 16-bit index buffers?

Also, what is your graphics card? I've looked up some videos on YouTube and it appears as though the GTX 280/275 both get around 60,000 particles at 23-30 FPS
TheQuestion = 2B || !2B
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

points and point sprites should only have one index, but IIRC, Irrlicht's particle system is not yet ready for these types. Or did I add the code? Guess I need to work on the particle system again, but not now :wink:
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Ah, yes, you caught me hybrid, I should have said billboard/textured quad. :oops:
TheQuestion = 2B || !2B
grumpymonkey
Posts: 222
Joined: Mon Jan 19, 2009 10:03 pm
Location: Miami, Florida
Contact:

Post by grumpymonkey »

Im trying to make a character controller for my game by using a sphere or capsule for the players collision.

Is there a way to disable physics simulations on some axis or something because when I add a constant force for movement it causes him to start rolling and looks like the node jumps when I disable rotations
Image
rootroot1
Posts: 44
Joined: Wed Nov 25, 2009 6:42 pm
Location: Odessa, Ukraine

Post by rootroot1 »

Just use character controller capsule from NxCharacter.lib
This is the best way
but you also may take a look for "angular damping" settings
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

In the IrrPhysx Game Example i did a very simple character controller made from a sphere which worked roughly ok so you might want to look at that. The next version of IrrPhysx will have character controllers in it (dread to think how long i've been saying that for...) but i'm not sure when that release will make it out... we've got some nasty bugs and little time to work on them :(
Image Image Image
Post Reply