View Full Version : Using nParticles for water sim - Questions

03 March 2010, 07:51 AM
So, I'm trying to make a decent-looking water simulation, using nPartices. To get a hang of what the settings actually does, I've rigged up a simple scene - a glass filled with nParticles, getting knocked over, the particles spilling out - Pretty basic.

Now, i rendered this and immediately noticed a problem. The mesh created from the nParticles when one converts Nparts to Mesh seems based on particle concentration. In other words, as the particles start to spread out after the glass is tipped over, the actual volume of the liquids mesh gets less and less - it looks like globs of water are instantly evaporating.
What setting did i miss? What do i need to tweak to sort this out?

Additionaly, I wonder if its possible to simulate/fake surface tension with nParticles (if at all possible). Like when water is running down a sphere, for instance. It wont just lose its "grip" of the spheres surface when it reaches the horizontal middle of the sphere, it will continue on down it until gravity overpowers the waterdrops own "stickyness", and makes it drop from the spheres surface. Also, a force between the particles themselves, that makes two drops of liquid that collides join into one, bigger drop. And also, that several joined drops of water have a greater pull on a single drop than vice versa. Is this at all possible to simulate?

This is for a work-related project, and the only tools I have are Maya 2009. It seems like RealFlow would be the way to go, ideally, but I have to make due with what I have at hand now.

Just to clarify: I'm not looking for a hyperrealistic, 100% physically correct simulation. Think more along the lines of an acceptable estimate of how it would look :)

03 March 2010, 08:48 AM
Check out Duncan's blog post on nParticles.

The final outcome is still blobby but might help you in some way.

03 March 2010, 08:55 AM
This is a good one for Duncan. But just to help you out on the mean time you could try using self attract under force field to keep the particles hanging together and I believe this together with incompressibility will stop them from bunching up, this would help with a surface tension.

As for the sticking to surfaces I think you may have hit it on the head by mentioning "Stickiness". Use that attribute to make your particles glue themselves to a surface. I think both the particles and surface need stickiness for it to take affect. You should check out the docs for these attributes to get you going.

Edit. I just checked the link by Efecto in which Duncan mentions using a negative force field on the passive nRigid to get particles to adhere to surface.

03 March 2010, 01:20 PM
Duncan's blog answers and explains a lot of what you are looking for. In my own experience I have found that it is a delicate balance between the size of the nparticle and the mesh triangle size. Ideally you want the smallest radius and the smallest mesh and millions of nparticles, however that is computationally unfriendly.

I know this is far from the effect you are trying to achieve but this is a flood type effect I have been working on.
Flood (

I am emitting 100,000 nparticles with a radius of .7 and a mesh Triangle size of .3. You can still see how large the nparticles are though as they leave the main volume and slide across the ground.

03 March 2010, 07:10 PM
there is a good video on youtube that shows comparison between nParticles and realFlow.
- here (

Todd > Nice flood. :) I have also noticed in your dynamics book that flood made with nParticles look very blobby. I'm not convinced to use it for highend water fx. But it may be useful for water fx in cartoonish 3d.

03 March 2010, 12:18 AM
Something in particular to watch out for... as the particle system bounding box increases you may hit the maximum resolution for the voxel grid used to march and create the mesh. When this happens you can see the size of the triangles grow and eventually your entire fluid may dissappear. One solution is to increase the MaxTriangleResolution attribute, however you should also try to avoid having any stray particles fly far out. (i.e keep the total volume of the particle system bounding box as small as possible)


03 March 2010, 09:56 AM
This clip shows pretty clearly what my main problem is atm. The water dissipates towards the end of the system. Is the way to sort this out to increase the particle count and decrease tri size?

03 March 2010, 02:25 PM
This clip shows pretty clearly what my main problem is atm. The water dissipates towards the end of the system. Is the way to sort this out to increase the particle count and decrease tri size?

I believe just above you, Duncan mentions that you would need to increase resolution. What I would also try if simulation power is already maxed, make a kill plane before the problem area, and emit new particles with a second simulation, have your new nparticles continue on inherit velocity, and then resim your mesh with only these new particles, and of course blend in comp(blend could be tricky!).
But in theory, you could have that grid resolution continue on for miles and miles.

03 March 2010, 03:56 PM
Yep that looks pretty much like you need to increase the max resolution, as well as kill particles that go out of view to keep the particle bounds tight.


CGTalk Moderation
03 March 2010, 03:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.