Page 28 of 29

Posted: Thu Jan 14, 2010 9:37 pm
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.

Posted: Sat Jan 16, 2010 9:18 am
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 !!!!!!!!!!!!!!!

Posted: Mon Jan 18, 2010 7:08 pm
by Steel Style
IIRC you need to change you global axis example (0,1,0);

Posted: Tue Jan 19, 2010 4:37 pm
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

Posted: Tue Jan 19, 2010 7:55 pm
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.

Posted: Mon Jan 25, 2010 2:44 pm
by JP
Cool job rootroot1, how's the performance though?

Posted: Tue Jan 26, 2010 4:48 pm
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:

Posted: Wed Jan 27, 2010 1:16 pm
by Dorth
Have you tried using the spark engine? There might be some way to combine it's performance with physix positioning...

Posted: Wed Jan 27, 2010 11:49 pm
by rootroot1
I've tried using it, but i dont know how to draw custom set of particles with custom coordinates :(

Posted: Thu Jan 28, 2010 12:52 am
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

Posted: Thu Jan 28, 2010 9:13 am
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:

Posted: Thu Jan 28, 2010 4:05 pm
by Halifax
Ah, yes, you caught me hybrid, I should have said billboard/textured quad. :oops:

Posted: Sat Jan 30, 2010 3:19 pm
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

Posted: Sat Jan 30, 2010 7:29 pm
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

Posted: Mon Feb 01, 2010 3:16 pm
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 :(