Irrlicht and PhysX Demo
-
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
Irrlicht and PhysX Demo
This is a more straigth-forward tutorial-demo to show how easy it is to add PhysX to Irrlicht. It shows a nice class to use to keep Irr-nodes updated, the functions you need to initialise and destroy the PhysX scenes and 300 (THIS IS PHYSX!!!!) cubes falling from the sky. The loss of framerate is mostly because of the 300 nodes, as irrlicht seems to prefer fewer nodes with more polys than more nodes with less polys in total. As it is normal though...
Tutorial 2 also adds a trimesh to the whole scene.
You will need the PhysX drivers. A small game-installer can be downloaded here.
Tutorial 1 - Bare Basics:
The source code and binaries can be found here.
Tutorial 2 - Let's go a wee bit advanced:
The source code and binaries can be found here.
Please tell me any mistakes in my code and feel free to ask me any questions you might have about this.
To quit the application, Alt-F4 . Sorry for no ESC function... was too lazy.
EDIT: Fixed in tutorial 2!!!
Thanks to: jimanjr - for that nice box texture.
Tutorial 2 also adds a trimesh to the whole scene.
You will need the PhysX drivers. A small game-installer can be downloaded here.
Tutorial 1 - Bare Basics:
The source code and binaries can be found here.
Tutorial 2 - Let's go a wee bit advanced:
The source code and binaries can be found here.
Please tell me any mistakes in my code and feel free to ask me any questions you might have about this.
To quit the application, Alt-F4 . Sorry for no ESC function... was too lazy.
EDIT: Fixed in tutorial 2!!!
Thanks to: jimanjr - for that nice box texture.
Last edited by night_hawk on Sat Jul 12, 2008 9:17 am, edited 4 times in total.
Well I'm surprised to say, but the framerate didn't seem at all low to me? And I am running on a pretty low-end system. I get 76 FPS (with everything interacting, and colliding, etc.) on a:
- 866 Mhz AMD Moblie Sempron 2600+
- 256 MB RAM
- ATI Raedon 200M Xpress
Overall, this is very straightforward, and I like it. I have one problem though, and that is the fact that you should at an 'Esc' quit button. Because you locked the cursor with the FPS camera.
EDIT: I would also like to see a demo like this, with fluid particles instead falling from the skies. I have only seen the UE3, and PhysX SDK demo for fluid particles.
- 866 Mhz AMD Moblie Sempron 2600+
- 256 MB RAM
- ATI Raedon 200M Xpress
Overall, this is very straightforward, and I like it. I have one problem though, and that is the fact that you should at an 'Esc' quit button. Because you locked the cursor with the FPS camera.
EDIT: I would also like to see a demo like this, with fluid particles instead falling from the skies. I have only seen the UE3, and PhysX SDK demo for fluid particles.
TheQuestion = 2B || !2B
-
- Posts: 22
- Joined: Wed Mar 05, 2008 8:25 am
If you are developing software that uses a kit provided by another developer. Then I would assume that you need the software development kit (SDK).cooljayman wrote:Thats awesome NightHawk!, any idea how to implement terrain collision? How would you go about adding support for other primitives eg. convex hull mesh?
Do I need the physX sdk to compile this? Have a link to it?
Cheers.
TheQuestion = 2B || !2B
-
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
-
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
Great job on the second tutorial. I am planning on using PhysX in my next programs, and these tutorials will definitely help. Thanks man.
The demo still runs at ~77 FPS for me, which is great on this low-end system. And Alt-F4 is no problem, I just couldn't quit at all in the first demo when I ran it.
The demo still runs at ~77 FPS for me, which is great on this low-end system. And Alt-F4 is no problem, I just couldn't quit at all in the first demo when I ran it.
TheQuestion = 2B || !2B
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
I finally suceeded compiling the PhysX...
I tried to load my own .x level, but it said there are ";" missing in its normal declaraitons.
I want to load BSP level, but have no clue how to do it. I tried using the code from another PhysX example( actually the tutorial ) which had .BSP laoded, but without any sucess.
Can somebody write the code for loading BSPs?
I want to implement a controlled character, but again I don`t know how...
Can somebody explain shortly how can this be done?
Will for example a .BSP level of 12000 trigs using PhysX collisions run slower than running in the buid-in Irrlicht collision system or not?
I tried to load my own .x level, but it said there are ";" missing in its normal declaraitons.
I want to load BSP level, but have no clue how to do it. I tried using the code from another PhysX example( actually the tutorial ) which had .BSP laoded, but without any sucess.
Can somebody write the code for loading BSPs?
I want to implement a controlled character, but again I don`t know how...
Can somebody explain shortly how can this be done?
Will for example a .BSP level of 12000 trigs using PhysX collisions run slower than running in the buid-in Irrlicht collision system or not?
-
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
Well, I have limited to no experience in using BSPs, but I suppose it shouldn't be much of a difference in using them with PhysX.
As for a 12k poly mesh, PhysX will run faster than Irr's default collission ANY time. Take sNow or Never. The terrain there is pretty high-poly and NOT optimized in any way. Yet, constant framerates (and decent) can be gotten even on low end systems.
As for a 12k poly mesh, PhysX will run faster than Irr's default collission ANY time. Take sNow or Never. The terrain there is pretty high-poly and NOT optimized in any way. Yet, constant framerates (and decent) can be gotten even on low end systems.
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
This is a really good newsAs for a 12k poly mesh, PhysX will run faster than Irr's default collission ANY time. Take sNow or Never. The terrain there is pretty high-poly and NOT optimized in any way. Yet, constant framerates (and decent) can be gotten even on low end systems.
But this ain`t helping me much in moving the character and loading BSP. There is a really nice example in the PhysX samples for character control, but when using Irrlicht things are pretty different and turn into a herculean task for my about-ten-days Irr experience...
If I decide to use .X level for now, for testing purposes why I`m not able to load my level? And will there be any difference in performance in 12k BSP and 12k .X?
-
- Posts: 153
- Joined: Mon Mar 03, 2008 8:42 am
- Location: Suceava - Romania
- Contact:
Well, I haven't gotten the PhysX Character controller to work either. I got bored and made my own. Piece of cake Much more control and overall better I say. You should try that too!
As for a 12k BSP and 12k .x, PhysX related, there shouldn't be any difference at all. Irr related, .x loads faster and is imo, better technically-wise. But that's just me.
As for a 12k BSP and 12k .x, PhysX related, there shouldn't be any difference at all. Irr related, .x loads faster and is imo, better technically-wise. But that's just me.
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
I made some tests, trying to compare PhysX and Newton. I used as a level the chiropteraDM and a starting amount of 40 boxes. In the beginning both the engines were on about 75 frames (vsync=off). After this PhysX continued to maintain about 75 frames, adding more boxes gave only a small desrease, but never rised until the end. Newton started more firmly on 75 too. Than seemingly after the Sleeptimer activation rised to 130. Throwing another boxes on the others resulted in desrease to 65. If I add more and more boxes without placing too much in one place keeps the frame rate over 100, no matter the count.
How do you think? Which one is better? PhysX has more functions, but Newton is a good alternative to have...
I even don`t know how to call the identifier of my chracter to set forces. Any chance of posting some code?
Same does for a Newton character movement. How can I call the physics identifier to set forces? Plese post some code if possible, because I`m starting to give up... I just need to use the basic collisions to avoid the build in Irrlicht one, but there`s no fun if the chracter is standing still and watching dumb from the one side, while I`m looking dumb on the other side of the world... Goofy...
HEEELP PLEEEASE....
How do you think? Which one is better? PhysX has more functions, but Newton is a good alternative to have...
Yeah, I tried... lost 4 hours in endless efforts without any results...Well, I haven't gotten the PhysX Character controller to work either. I got bored and made my own. Piece of cake Very Happy Much more control and overall better I say. You should try that too!
I even don`t know how to call the identifier of my chracter to set forces. Any chance of posting some code?
Same does for a Newton character movement. How can I call the physics identifier to set forces? Plese post some code if possible, because I`m starting to give up... I just need to use the basic collisions to avoid the build in Irrlicht one, but there`s no fun if the chracter is standing still and watching dumb from the one side, while I`m looking dumb on the other side of the world... Goofy...
HEEELP PLEEEASE....