IrrPhysx 0.3 - Nvidia Physx 2.8.1 wrapper

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

IrrPhysx 0.3 - Nvidia Physx 2.8.1 wrapper

Post by sio2 »

EDIT: Added another demo using Blindside's water droplet shader. See below.

This release of IrrPhysx - v0.3 - has added support for Fluids, both in hardware (given a compliant GPU) and software (cpu). I also removed a mesh called "platform" from the GameExample that crashed the Release exe when not running through MSVC. This is an initial release; there are many tweaks that could be made to the fluid system - source code is supplied, allowing people to modify as required.

Please note: v0.3 was developed on an nVidia GPU with hardware PhysX support. Although software (cpu) fluids are possible with v0.3 the GameExample expects hw PhysX support.

Image

Please note: adding fluid support to your apps will require a little bit of work. The GameExample is just that - an example of adding fluids to a scene. In the GameExample fluids are rendered as particles - a full shader system will be required and much tweaking of fluid/emitter parameters to obtain your desired look.

IrrPhysx 0.3 Source:
http://sio2.g0dsoft.com/IrrPhysx-v0_3.zip

IrrPhysx 0.3 GameExample Source:
http://sio2.g0dsoft.com/IrrPhysx-v0_3-GameExample.zip

IrrPhysx 0.3 GameExample Source (with Blindside's water droplet shader):
http://sio2.g0dsoft.com/IrrPhysx-v0_3-G ... action.zip

A big thanks to JP for v0.2, without which I could not have made v0.3. :D
Last edited by sio2 on Wed Dec 31, 2008 4:33 pm, edited 1 time in total.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Nice work sio2!

Anyone who might find the shader part a hurdle could use something like this for the effect:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=27054

Image
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Wow! The frame rate is incredible! Got more than 500FPS with more than 110 physic objects, the scene and the "fluid".
DtD
Posts: 264
Joined: Mon Aug 11, 2008 7:05 am
Location: Kansas
Contact:

Post by DtD »

4-6 (And random jumps to 101?) FPS without fancy NVidia physics acceleration :cry: I knew itd probably be slow on my ATI card...but not that slow!

BTW> The liquid "spouts" didn't follow the bottles when I shot them, but I suppose that was because you just didn't program it, no biggie...

BTW2> This is a little off topic, but does ATI have some equivalent to PhysX?

BTW3> I noticed the fluid stops eventually, after that the speed shoots up to around 350 FPS, so I got to have fun destroying the flag and blowing up spheres =)

~DtD
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Blindside: Very, very nice. It doesn't model a fluid surface so it's not as complex as the shader as I had in mind, but I'll implement the raindrop shader in the GameExample.

Christian: The more objects you have the more you should benefit from hw acceleration. Note that you can have thousands of particles and they all collide with static and dynamic objects.

DtD: I could have spent another month - or more - on it before releasing it. I solved the biggest issues, such as it crashing every time you run the Release exe. :wink: The fluid emitter is anchored in worldspace at the moment - needs a bit of work. You're right: the fluid emitter reservoir runs out when it's supposed to be continuous from what the docs say. I haven't figured that one out yet.

BTW I believe that PhysX acceleration is possible on ATI cards. I don't know the details so if someone could find out then those with ATI cards would be most grateful, I imagine. :wink:
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

christianclavet wrote:Wow! The frame rate is incredible! Got more than 500FPS with more than 110 physic objects, the scene and the "fluid".
One of the changes I made to JP's code was to run the physics in parallel with Irrlicht's beginScene()/endScene(). This gives the GPU the possibility to be doing stuff when normally it would be idle. My frame rate quadrupled with 10000 fluid particles.

This can be dangerous - as JP points out in a comment in GameExample - but should be fine as long as you don't move/update physics objects while the simulation is running.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

BlindSide wrote:Anyone who might find the shader part a hurdle could use something like this for the effect:
I'm going to add this to the GameExample. I'll convert the shaders I need to HLSL so the example can run in GL/D3D.

I notice that when the large refractive quad intersects the lowest edge of the viewport there's some nasty stretching. I remember seeing the same thing - and commenting on it - in Elvman's "realistic" water scene node. :?
Carama
Posts: 10
Joined: Sun Dec 14, 2008 12:44 pm

Post by Carama »

Very nice work!
Do objects swimming?
Nerexis
Posts: 27
Joined: Sun Dec 09, 2007 4:18 pm

Post by Nerexis »

I try to use it in Irrlicht 1.5 and i created 'convexMeshObject' which works fine but it crash in function 'createHeightfieldObject'.
Nerexis
Sorry for bad English.
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Nerexis wrote:I try to use it in Irrlicht 1.5 and i created 'convexMeshObject' which works fine but it crash in function 'createHeightfieldObject'.
I've had IrrPhysx working with Irrlicht 1.5. I can't remember what I did, I just did a Debug build and fixed every issue as it came up. You'll either have to do the same or wait until I update to Irrlicht 1.5.

It seems that some of the model loaders were fixed for Irrlicht 1.5. Great, except that scenes made in IrrEdit 1.4.2 now load and look wrong because the models were orientated based on the previously broken loaders. :?
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Nerexis wrote:I try to use it in Irrlicht 1.5 and i created 'convexMeshObject' which works fine but it crash in function 'createHeightfieldObject'.
Irrlicht 1.5 runs OK for me (the MilkShape models are backwards and the camera is ultra fast, but it runs). Are you sure you've replaced the Irrlicht 1.4.2 dll with a 1.5 dll?
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

I've made a version of the GameExample that uses Blindside's water droplet shader. You can get the exe and source here:
http://sio2.g0dsoft.com/IrrPhysx-v0_3-G ... action.zip

It looks good, but still looks like each separate droplet is a piece of glass or something, as the fluid particles don't merge together (that's an altogether more involved shader). Also, it seems each droplet refracts the whole background.

It's a nice starting point for people anyway. :wink:

Oh, with Vista, OpenGL in a window seems to give me a lower frame rate than D3D9: GL give 60fps whereas D3D9 give 180fps (Irrlicht 1.4.2). This is the original GameExample demo (without refraction) though the demo with refraction is the same frame rate. VSync should be off, unless there's some driver issues...
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Impressive speed!

You could render the blobs to a low res rtt so they merge together(also allows blur) then defer their shading.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Right well i guess this shits all over IrrPhysx as done by me doesn't it? Gonna be a bit confusing if i release a 0.3 right? Would have been nice if you'd whispered a word in my ear before doing this...
Image Image Image
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

[...]
Last edited by MasterGod on Fri Jan 02, 2009 6:20 am, edited 1 time in total.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Post Reply