Pouring Water with nParticles

By -

With the introduction of nParticles in Maya 2009 one now has a tool that can handle pouring liquids. (note that Maya Fluids, despite its name, is currently better suited for gaseous effects than pouring water) If one toggles on "Enable Liquid Simulation" on the particle system a "Smooth Particle Hydrodynamics" (SPH) solver is used. Note that in general one should turn OFF self collision when using this. Self collisions, even with friction set to zero, will tend to lock up the flow as well as prevent particles from settling into a smooth surface. By contrast the SPH solver does not compute collisions but rather repels and attracts adjacent particles based on the cumulative overlap, or density. The target density or cumulative overlap of the particles is controlled by the attribute "Rest Density". The default value of 2.0 corresponds to two particles totally overlapping, however note that if we add a third particle then they will not totally overlap because that would make the cumulative density 3.0. The attribute "liquidRadiusScale" is simply a multiplier of the radius of the particle when determining the SPH overlap, or density. It helps to make this less than one when using the blobby surface rendering so that the particles overlap enough to create a smooth surface.

The smooth surface we render is called an isosurface. An isosurface is the boundary where the cumulative particle density is equal to the value set by the "threshold" attribute. Each particle has a density that is 1.0 at the particle center going to zero at its boundary. At a value of zero the surface is at the particle boundary, and as one increases the threshold to 1.0 the surface will move inwards towards the center of the particle. Higher thresholds make the resulting surface smoother. At a threshold of 1.0 or greater individual particles will only appear when they overlap others.

In Maya there are two primary methods to render this particle isosurface. We can directly raytrace the isosurface by setting the particle RenderType to "Blobby Surface". Or in Maya 2009 we now have the option to create a polygon mesh of the isosurface. To do this one calls "Convert: nParticle to Polygons", which essentially makes the particle system upstream construction history for a mesh node. Each method has its advantages and disadvantages. The polygon mesh method can result in a very large number of triangles, which can overflow available memory as well as take a long time to generate. The direct blobby raytrace method does not use much memory but can be very slow to raytrace, particularly with refractions through dense overlapping particles (opaque milk is generally faster than water). The blobby raytrace is generally superior if you have lots of fine droplets, as oppose to a smooth contained fluid. Also in Maya2009 motion blur on the particle mesh will not work properly and should be disabled, while one can use Motion blur in Mental Ray when using the direct blobby raytrace. As well if one wished to have different transparency and color values on a per particle basis it will work OK with the direct blobby raytrace but not with the mesh method. One advantage of the mesh method is that one can refine and smooth the resulting surface. The smoothing available this way is of a higher order than the smoothing that occurs by simply increasing the particle size and blobby threshold. In this tutorial both methods of rendering are explored.

INITIAL SETUP

To start with we will create two containers to pour with. 1. Create the cup. Create a default poly cylinder, setting the subdivisions Caps to zero and the height to 2.5. Then select the top face of the cylinder and delete to create a cup. Use "Edit Mesh:extrude" to thicken the cup. The position the cup up and to the side where we will pour it from (translate = -0.7, 6.2, 0.1).

2. Create the glass. It helps if the glass to pour into has a rounded bottom so that the water can slosh around better. Create a nurbsCurve for the cup profile and use "Surfaces: Revolve" to create the glass shape, setting "Output Geometry" to Polygons in the revolve options. In order to get a good fit of the polygons edit the resulting "nurbsTessellate1" node, using "enable advanced tessellation" and setting the general tessellation options. Optionally one and use "Normal: set Normal Angle" and adjust the angle such that the body of the glass will render smooth, but the lip have a sharp edge, like crystal.

3. Fill the cup. First do "nParticles:Create nParticles: Water" to set the style to water. Now select the cup and bring up the option box for "Create nParticles: Fill Object". Set the resolution to 30 and make the MaxY 0.4 ( just under half full ). Also toggle on "Double Walled" (so that particles are not created inside the wall of the cup) then click the "Particle Fill" button on the option box.

Note that with this workflow the total particle count is fixed and difficult to change later. Instead one could use a cylinder shaped volume particle emitter, emit some particles, set initial state and toggle off emission. This would allow for later changing the particle count by clearing initial state and re-emitting. Currently one can't use the fill command to add into an existing particle system. Emitted particles are more random than the fill method, however one can run the simulation to settle their positions.

SIMULATION

1. Select the cup and glass then do "nMesh:Create Passive Collider"

2. Playback to view simulation. Note that the particles collapse to the cup bottom as if they are not colliding. This is because the fill command initially sets the particle radius such that they just touch, while the particle liquid simulation treats the radius as a max interaction distance not a collide distance. Additionally the default simulation is quite compressible, so a large stack of particles will tend to compress like a weak spring under gravity.

3. Adjust the particle radius values: First off we want some overlap where the particles collide with surfaces so they look more like drops as oppose to spheres, so make the collideWidthScale 0.5(note that this will cause the particles to compress even more). We also want even more self overlap of the particles so that blobby rendering will look smooth(rather than lumpy), so set the "Liquid Radius Scale" to 0.65(note this is very similar to "Self Collide Width Scale"). Next set the nucleus substeps to 20, which will make the water much less compressible and improve the collision quality( although it will slow down the simulation ). Now increase the particle radius just to the point where the particles will settle near the starting point(in this case around 0.13). Playback until it settles then select the particle system and do "nSolver: Initial State: Set From Current". When you rewind and playback it should now remain stationary. Note that you may also wish to randomize the radius values a little to help prevent stacking along boundaries. This can be done by setting the "Radius Scale Input" to RandomizedID and then increasing the "Radius Scale Randomize" to something like 0.1. Note that you may need to slightly increase the overall radius when doing this. Something else that can help is to keyframe the particle "Damp" such that it is initially 1 or so then goes to zero over after a couple of frames. This allows one to vary attributes that affect the initial state without always needing to reset the initial state to keep particles from exploding apart.

4. Keyframe the cup rotating to pour the fluid into the glass: Select Cup, hit "s" key to keyframe. Go to frame 30 rotate the cup (something like 0,0,-110) and hit "s" again.

5. On the nucleus node turn on "Use Plane" so that the particle system will collide with the ground. We can also at this point create a ground plane mesh for rendering, although note that it is a little more efficient to collide with the nucleus ground plane than a mesh version. Also increase the friction a little on the nucleus node to keep the particles from sliding too much on the plane.

6. Cache the simulation. Set the time slider range to around 150, select the particle system and do "nCache: Create New Cache". When done, playback to view the animation so far. For faster playback set the particleRenderType to "Points". One can set it back to "Blobby Surface" later before rendering.

7. Attract the particles to the glass. Real water would tend to adhere to the glass a little and droplets would stick to the sides of the glass and roll down it. To accomplish this we can use the "Force Field" attribute on the glass to create an attractive force for particles that are very close to the surface of the glass. On the nRigid shape for the glass set the following: Force Field = Single Sided Field Magnitude = -4.0 Field Distance = 0.13 You may also wish to edit the field scale so that the force drops off to zero when the distance is less than the particle radius. In this manner the force then does not fight collisions. The left of the graph represents the strength at zero distance and the right at the max distance(Field Distance): forceField.jpg Cache the simulation again. Some of the particles should now stick to the outside of the glass and slide down it. If no particles slosh over the side or catch on the lip then move the cup over a little. The exact field magnitude and distance is important. Too great a distance and the particles will fly towards the glass as they get near. We use a value of 0.13 which is about twice the effective particle collision distance(given that the collideWidthScale is 0.5 and the radius is 0.13) Too great a magnitude and water will not drip off and will cling to the inside walls instead of filling. One other thing that can keep the particles from stacking along the inner wall of the glass is to use a bit of radiusScaleRandomize. If you want the drops to slide more slowly adjust the friction on the glass, but for this simulation we have kept the friction at zero, because we want as much sloshing in the glass as possible.

RENDERING USING BLOBBIES

1. Do a test render. First set the "Particle Render Type" back to "Blobby Surface". The water style particles have built in water style shading, but assume that you will be raytracing, preferably in Mental Ray. Also there are still numerous things that need to be done for good shading. First we can create a couple of lights, in this case I used a slightly amber colored key spotlight with raytraced shadows along with a dim bluish non-shadowed point light for fill. The glass and cup can get a blinn shader that is nearly fully transparent. An initial Mental Ray render at the preview setting may look something like this:

2. Set the refraction levels. If one simply enables raytrace refractions on the glass shader it will look like this:

Additionally lets set the shader's refractive index to around 1.3 and then in the render settings under quality increase the refractions and maxTraceDepth both to 6:

Note that the particles do not appear in the glass. One additionally needs to set "visibleInRefractions" true on the particle system(under Render Stats):

However note that this now starts to make the render slow. Tracing rays through the internals of the blobby isosurface is considerably slower than with a normal mesh, especially when motion blur is added. We will first show how to improve the look of the blobby rendering, then describe how to instead render with a mesh.

3. Adjust the blobby threshold on the particle shape. We can increase it a bit to make the surface smoother: threshold = 0.85 ->This will also move the surface inward slighty.

In general to make smoother water one want more overlap between particles and at the same time a higher blobby threshold. Changing the radius will change the simulation, so unfortunately one also needs to lower the liquid radius scale to avoid changing the simulation( in case one wishes to recache). Note that with the particle mesh method this is not an issue as one can simply adjust the blobby radius scale instead of the radius. However "blobby radius scale" does not yet apply to the blobby raytracing( hopefully this will be added in future, making things easier ).

4. Adjust opacity. At this scale water is pretty much totally transparent so on the particle system set the opacity to 0.08.

5. Enable Motion blur. In the Render Settings quality tab set "Motion Blur" to "Full". This can make the render quite slow with raytraced blobby particles, so it helps to both lower the size of the blur and increase the time contrast(will be more dithered but significantly faster): shutterClose = 0.4 timeContrast = 0.4

Here is the finished render of the scene pourBlobby.ma. In addition to refining the shaders a bit the raytracing levels have been increased. reflections = 3, refractions = 8, maxTraceDepth = 8, and shadows = 4. As well the rayDepthLimit on the spotlight is set to 4( allows shadows to be seen though droplets ).

pourBlobby.ma
RENDERING USING A MESH

1. Create the mesh: Select the particle system then do "Modify: Convert: nParticle to Polygons". This creates a mesh node connected to the output of the particle shape. The mesh may initially not appear if the triangleSize is too large(that should be the case here). Conversely if you are working at a large scene scale it might be initially very slow because the triangle size is to small for that scene scale. In such cases it can help to make meshTriangleSize large before doing the convert to poly. Mesh raytracing is faster than the blobby raytracing, but can consume a lot of memory and time building the mesh. Also the mesh currently cannot be cached currently, because its topology changes over time. Thus you will generally only wish to display the output mesh for renders and keep it hidden during playback.

2. Set the output mesh attributes on the particle shape: The fastest mesh method is quads and this will require about 3 smoothing iterations. The meshSmoothingIterations take the initial set of polygons formed by walking a voxel grid and fit these to the particle density function, as well as make the polygons more uniform. A nice thing about the quads method is that we can further refine the mesh by using polysmooth (hitting the 3 Key). This is much faster than making the meshTriangleSize smaller. On the nParticleShape set the following in the output mesh block: meshMethod = Quads meshTriangleSize = 0.05 blobbyRadiusScale = 1.7 meshSmoothingIterations = 3 threshold = 1.1 motionStreak = 0.3 -> motion blur is not supported yet, but this is a partial workaround

3. Hide the particleShape so it will not display or render

4. Smooth the output mesh by selecting it and hitting the 3 Key.

5. Turn off motion blur for the particle mesh... either disable it on the particle output mesh shape or turn it off in the render settings. The motion streak attribute provides a bit of stretch on particle movement that helps compensate for the lack of blur.

6. Create a watery shader for the mesh: We do not wish to use the exact same shader as the particle system ("npWaterBlinn") because the particleSamplerInfo connections are not supported for meshes, thus we can't have per particle shading values when using the output mesh. Assign a blinn shader to the particle mesh with the following settings: color = 0 0 0 transparency = 0.95 0.95 0.95 eccentricity = 0.07 specularRolloff = 0.16 ->this makes edges more reflective than the center specularColor = 1 1 1 reflectivity = 0.7 refractions = ON refractiveIndex = 1.25 refractionLimit = 8 shadowAttenuation = 0.02 reflectionLimit = 3

7. Set the raytrace settings. These can be setup in the same manner as for blobby although one can generally use much higher quality settings without as high a penalty.

8. Add caustics. If we simply enable caustics in the MentalRay features tab then turn on "emit photons" on the spotlight it will look as follows: To get sharp detailed caustics we will need to fire more photons from the light, which will take more render time. On the spotlight set the following: photonIntensity = 5000 causticPhotons = 500000 -> could be less if the spread of the spotlight were smaller On the tab "RenderSettings: IndirectLighting:Caustics" set Accuracy = 200 Lets also se the shadow limit to 6 on the raytracing options as well as make the spotlight rayDepthLimit 6.

Here is a final image with also an added bluish point light(no shadows) for ambience.

This is the final render of the scene file pourMesh.ma. Before rendering it you should first cache the simulation. Also the particles are visibile in the file and the mesh is hidden. You need to show the mesh (polySurfaceShape1) and hide the particle shape before rendering. Note that the file is also slow to load because it initially generates the mesh even though it is hidden. One could workaround this by making the meshTriangle size temporarily large.

pourMesh.ma
SURFACE TENSION

If desired one could additionally try to add effects like surface tension on the drops. This can be done by using the selfAttract attribute on the particle system, but be warned that currently this makes the simulation much slower(hopefully a surface tension attribute will be added to the liquid simulation in a future release, which would be much more efficient). One would make pointForceField = thickness relative, pointFieldMagnitude = 0, then adjust selfAttract for the desired tension.

Mesh rendered scene file Blobby rendered scene file
Published In
Tags
  • nParticles
51 Comments
To post a comment please login or register
| 6 years ago
Anyone having the problem where the emitter stops emitting or the particles disappear? Lifespan = live forever and max count = -1.
Edited by hX1a85KX 6 years ago
| 7 years ago
Having also a problem with converting the nParticles to a mesh. After it, the mesh doesn't follow the movement of the glass anymore. It simply stays in the same position without any changes. While having particles in, they are going out of the glass... Any advise? And please reactivate the video ;-) Thanks a lot Jens
Edited by H4zaISlr 7 years ago
| 7 years ago
Yeah it seems like Duncan's blog is missing a lot of articles! Which is a shame because this one was really helpful.
Edited by 4Q9aE9II 7 years ago
| 7 years ago
By the way I'm geting this: //===================================================== Maya Crash Report //===================================================== Exception code: E06D7363: Fault address: FDC5CACD in C:\Windows\system32\KERNELBASE.dll 0001:0000BACD Logical offset (see .map file for location)
Edited by e0r6pksR 7 years ago
| 7 years ago
Hello there, I've converted my nparticles into a polymesh but every time I try to increase the blobby radius scale in order to see the mesh, maya crashes. Can you please advise me what to do?
Edited by e0r6pksR 7 years ago
| 7 years ago
The content isn't showing up for me, videos or images. Is it working still for anyone else?
Edited by edLjqOCI 7 years ago
| 7 years ago
Hi. First off, wonderful work. i tried the exact same thing with two glasses. worked fine. But now im tryin with a small mouth mineral water bottle and i need the water to be full till the neck. I tried myself but either the water isnt filling up fully or the water isnt flowing out properly. How do i fill it up completely(without water level goin down during simulating) and make it flow out like water?? Thank you..
| 7 years ago
On the particle shape node set the attribute intermediateObject to OFF. This attribute keeps the particle system node from rendering but still allows it to evaluate. The visibility attribute fully disables the system which is why intermediateObject is used... You should turn it back on before rendering to avoid having the native particle render along with the mesh render.
| 7 years ago
Hello, I have a serious problem converting nparticles to mesh via surely from the convert menu. Whenever I do it the nparticle shape node disappears from the scene. Thus I am not able to further refine the sim by adding fields etc... since I can't find the nparticle shape node to connect to newly created field nodes. Hypergraphing the mesh node does reveal a particle shape node, greyed out... but selecting this still does not enable me to attach other fields to the sim, even if I try it via the dynamic relationships editor. Can someone advise on the proper workflow here please? Thank you, and a Happy new year!
| 8 years ago
Make sure that history is ON when you do the convert... if so the mesh should rebuild automatically for each frame. For the shading try a mental ray mia material with refraction. There are controls where you can make it more opaque for longer raypaths through the material. (the maya shaders don't support that)
| 8 years ago
Oh thanks that seem to work but I still cant get the materials to look right yet either looks to much like water or too much like paint, cant get almost transparent parts mixed with spots of thinker Opacity spots. The Mesh also seems to stop on every frame when converting from the particles do you have to convert every single frame to mesh by hand or am I doing something wrong?
| 8 years ago
For slime you might want to try high viscosity and high stickiness. For shooting out of a super soaker a directional emitter might work ok. You will need motion blur and also some motion streak on the particle mesh may help.
| 8 years ago
This helps a ton, I was Trying to use the fluid or dynamics tab to do stuff since I herd the normal particles sucked I did not even know Nparticles was there just the Ncloth. but how do we make the water shoot out of a squirt gun/super soaker? and what is good settings for thick sticky semi transparent paint or slime doing the same shooting? I am trying to make that Slime gun backpack from ghostbusters 2 or some kind of slime gun. I am a noob student so I have no idea been playing with it cant get good results. http://www.youtube.com/watch?v=P6NhfRFSaFo
Edited by qz2Zv2B0 8 years ago
| 8 years ago
Thanxxxxxxxxxxxx bro
| 8 years ago
Thanks so much for your reply, Duncan! So the solver Substep is really the key here. I did find that turning it up to as high as 60 helped the simulation, but then calculations got so slow that I started to get impatient. I also tried adjusting Time Scale, but not sure if I've mastered that. One could speed the rendering up in post, or render on twos or threes, but that wouldn't work if one needed the simulation to interact with characters etc. It seems like there's a "perfect storm" of attribute values that produces realistic water, but that combination currently eludes me. If you guys put in any more time on this in the future, I'd request that a preset be made with physically accurate behavior. Also, multiprocessor support would make this feature a lot more useful. Thanks again!
| 8 years ago
If you were simply scaling up or down the simulation in this example and wanted to preserve the behavior there are a few things you would adjust. If you scale up then space scale would need to be lowered (increasing the effect of gravity, so the relative speed would then stay the same). The particle radius would also need to be scaled up, and any attribute or effect that uses a worldspace distance( as opposed to a particle radius relative distance ) would also need to be scaled up, although offhand I'm not sure if there are any such attributes in this scene. (perhaps self attract distance, if that was used, although now one would use surfaceTension instead) This simulation was really with low gravity( or slow motion ) if the cup were to be about 7in high. Full gravity at this scale would take more substeps on the solver to better handle. At any rate the settings for real world gravity work the same way as for nCloth and one can set the spaceScale in a similar fashion to achieve it. Just be prepared for long solve times when working at small scales, because things happen so fast that one needs a small time step (high substep).
| 8 years ago
Hi Duncan, thanks so much for all the great work you've done in Maya. I'm coming to the party here a bit late, but I have a question. What scale conventions should I be using for accurate results with Liquid Simulation? My understanding is that nucleus assumes that one Maya unit (cm) = one meter. In other words, nucleus assumes the world is built at 1/100th scale. I know you can compensate for this with the Space Scale attribute, so that you can model your scene to whatever scale you like... and this works fine for me with nCloth. I model at 1:1 scale (one unit = one cm) and set Space Scale to 0.01, and it works perfectly. But when it comes to these Liquid Sims, I just can't get it to work properly by following that method. It also doesn't work well if I build my scene to 1/100th scale and leave the Space Scale at 1. In your example, you've modeled geometry at what looks like approximately 1/5th scale. Your glass is 3 units tall; a real glass would be about 15 cm tall. You didn't change the Gravity or Space Scale attributes in the nucleus solver node. So what should I do in my own scenes? Model at 1/10th scale? Thanks, Aaron
| 9 years ago
Thanks!! I thought it was more complicated than that! Thank you so much!!!
| 9 years ago
You can use multiple emitters for the same particle system. You could use the dynamics relationship editor to have your second emitter emit into your original system then delete your second system. As well the fill particle menu can work for multiple selected objects, but it always creates a particle system( you can't directly fill into an existing system).
Edited by XfBIG9DY 9 years ago
| 9 years ago
Oh thanks! but how can I put all particles in the same particle system?? Thanks! I really appreciate your help
| 9 years ago
You will need to have all the particles for both glasses in the same particle system. If desired you can give them different properties and color by using per particle attributes.
| 9 years ago
Great tutorial, but I have a problem. I want to create a glass puring water into another glass with water, but when both particles systems are together they don´t mix as one, how can I solve that? thanks!
| 9 years ago
thnx for explanation, nParticles are very powerful, no needs thirdParty plugs. I looks for more tuts like that
| 9 years ago
great tutorial Duncan! pandora51: if you want to make that just open Visor (in Maya) and import the streaks scene. Its exactly that, but the the person who did the version you found just changed the colors. Basically all you do is create a 1x1x1 cube, select it and create an nParticle emitting from object. By Default it will create an emitter for every vertex. Then you just need to make your visual look the way you want.
Edited by G3qUyMH3 9 years ago
| 9 years ago
I was wondering if you can help me out with turning the nParticals into a fluid water. For the last 3 weeks I've been following this tutorial and I'm stuck so I'm asking for help. Where I'm lost is turning the Bubbly Surfaces (or the Nparticals when I render) into the smooth water when I render in Mental Ray. I might be missing a small step that turns it into water but I'm lost and really looking for help. My end going is to turn the water into lava and have it come out of the glass. If you know of any tutorials or guides that might help me.
Edited by RCZMVUM0 9 years ago
| 9 years ago
I was wondering if you can help me out with turning the nParticals into a fluid water. For the last 3 weeks I've been following this tutorial and I'm stuck so I'm asking for help. Where I'm lost is turning the Bubbly Surfaces (or the Nparticals when I render) into the smooth water when I render in Mental Ray. I might be missing a small step that turns it into water but I'm lost and really looking for help. My end going is to turn the water into lava and have it come out of the glass. If you know of any tutorials or guides that might help me.
| 9 years ago
Hi Duncan. Great tutorial as always. I was wondering if u had any tutorials to create light streaks with nparticles like in the following video:http://www.youtube.com/watch?v=IJLRHFkha30 Any help would be greatly appreciated. Thanx in advance.
| 10 years ago
duncan you are the man
| 10 years ago
awesome sir u are great for a long i was looking for stuff like water pouring but noe i got that so nice of u sir.
| 10 years ago
Duncan, Thanks so much for all your help here! The render turned out great - I really appreciate your time! Allen
| 10 years ago
Wow, looks pretty nice, but there's something about the geometry that's off, imho. Anyways, really cool :)
| 10 years ago
I'm not sure your problem is substeps, however the total computations required generally go up exponentially with the number of particles. One could possibly need substeps as high as 500 or more if you have lots of stacked particles. A tall column of water would need more substeps generally than a shallow pan filled with the same amount of particles because the collision of the bottom particle with the container needs to propagate up to the top to fight the effect of gravity. Lower gravity will allow for lower substeps. Make sure the incompressiblity on the particles is 1.0 and the radius scale is around 1. The particles should have about a 50 percent overlap( do not expect the water simulation to collide with no overlap the way self collisions do). It is important that you confirm your radius values are good before trying high substeps, but for large numbers of particles on a small scale object with real world gravity you could need very high substeps (small scale = faster relative motion = more time samples) Duncan
| 10 years ago
"a proportionately high substep" What is concidered high? I have it set at 20 now. Thank you so much for your help! Allen
| 10 years ago
"my particles tend to always compress to the bottom of the glass" First off the radius value should be large enough that the particles overlap initially almost to the point where they begin to explode apart. Then for a very high particle count you will also need a proportionately high substep on the nucleus node, which will slow the simulation down. If you are doing slow motion water (i.e. lower gravity and such) then the substeps can be lower. Duncan
| 10 years ago
Duncan, I am having a terrible time. I am relatively new to particles, and I am trying to have a simple glass of milk sitting on a table and a cookie dip into the glass. I followed your tutorial to the letter (except for the pouring part) but my particles tend to always compress to the bottom of the glass. I have over 50,000 particles, and they are just sinking. Any thoughts? Thank you in advance for your help. Allen
| 10 years ago
You could project UVs onto the mesh(or simply use 3D or projective textures) however you currently can't have uvs that track with the particle motion. It is a bit of a tricky problem given that the mesh changes topology from frame to frame. One method we could potentially add in future is to assign particles a uv on emission then assign uvs to vertices based on relative distances to particles, although this won't work well for all situations. One technique that could potentially work in some cases is to create a 3D fluid texture node with a dynamic color grid. This volumetric grid could be initialized with colors that match the desired uvw values for the surface at the start frame. In a runtime expression one could set the fluid voxel velocity values based on the particle velocity so that the color (i.e uvw) values would get pushed around. The outColor of the fluid could then be connected to the refPointCamera XYZ(for a 3D texture) or the R+G to the coordUV of a 2D texture. The actual workflow and scripting are somewhat involved, and I don't have time at the moment to elaborate and test it, although one would need to use the routines fluidVoxelInfo and setFluidAttr. If possible it would be much easier to simply hand translate and stretch a 3D texture to try and match the overal flow of the particle mesh. Duncan
| 10 years ago
Hi duncan, i would like to know if it's possible to create non destrictive Uvs on mesh based on Nparticles ? to add bump map in his shader, like mud shader. Thank you sylvain
| 10 years ago
Hi Duncan. I would love to see what expressions you had in mind. The surface tension properties of water are critical to get it to look real. I would like to do some tests to see how far you can go with the nParticle system. pete
| 10 years ago
One can produce surface tension effects using the the self attract force, but it will slow down the solve and takes a bit of playing with to get the correct value. In real life surface tension is essentially due to self attraction of the water molecules. Hopefully at some point we will add surface tension to the base liquid solve, which would be much more efficient than using self attract. With the self attract the water tends to clump more and form strands and sheets instead of breaking up into droplets. Another problem here is the particle count is relatively low and thus the partice size is rather large. Using a larger number of smaller particles will make the spilled liquid thinner, although it would take much longer to compute. One could potentially use a different particle system for the spilled liquid, emitting from the first particle system into the second on collisions. (this involves a bit of expression writing) Duncan
| 10 years ago
Thanks Duncan, always enjoy seeing what these things can do. How would you, if its possible, add some motion to the spilled 'water' it kinda of just clumps into beads at the bottom. Would there be a way to make it mesh together, maybe lose mass a little like water would? Is that where you're going with adding surface tension to the drops?
| 10 years ago
Yes that's the spot. Thanks.
| 10 years ago
No im not using motion blur. So do I submit it here? http://www.alias.com/glb/eng/support/bug_report/reportBug.jsp?Product=Maya
| 10 years ago
One thing I'm curious about... were you rendering with motion blur on? In general motion blur on the output particle mesh should be turned off as it is not currently supported. It will sort of work in Mental Ray if the topology of the mesh doesn't change during the simulation( but it almost always does with a particle mesh ). One can get bad blurring and we have a known crash in the MR renders for motion blur when the geometry in non-manifold. At any rate it would be good to have your scene that fails so we could test and find where it is failing.
| 10 years ago
You know I already had it set to quads. So I changed it to one of the other options, "Acute Tetrahedra" and now its working. Thanks Duncan pete
| 10 years ago
It is possible that you are getting some bad mesh geometry from the nParticle node. Try using the quad particle mesh type and set the smoothing iterations to about 3 or so. This is faster than the other mesh methods, and is more reliable. The other mesh methods may sometimes produce degenerate or non manifold geometry, especially for large triangle size values. Also it may help if the threshold is not too close to zero(at least 0.1). Also it would be great if you could enter a bug with your file, indicating the bad frame.
| 10 years ago
I have a 900 frame simulation that is cached, and I have it set to mesh out. When I try to playblast or render, Maya keeps freezing on frame 91. So I have to restart Maya. When I load the scene up, I can type in a frame past 91 like frame 240 and the mesh will show up after about a minute or so of waiting, but if I type in frame 91 Maya crashes. The scene is not too heavy, there are about 600 particles (I have them hidden) and the mesh is around 5-10 thousand faces per frame. I have been able to load meshes from Real Flow that are over a million polys, so I know that the computers here are able to handle a lot more than my current scene. Is this a bug or could I get this fixed? I am re caching my shot again, but this will be the third time. I would appreciate any clues to help me out. thanks, pete
| 10 years ago
Wow thanks for this Duncan. Been playing a bit with nParticles at work in-between jobs. Lots of fun. I am hoping that you will post some more explinations/tutes especially of the features you showed at SIGGRAPH, like the elastic goo and slicing examples. I am more or less getting the hang whilst teaching myself, but I am sure there are cool things that I am overlooking. Having been a longtime Maya dynamics dabbler I am very optimistic about where all this is headed. Well done to everyone involved.
| 10 years ago
Actually the blobby-render looks far mor detailed and turbulent. From where I'm sitting it looks better aside from the particles on the table-surface that is.
| 10 years ago
I've tried testing cached rendering of instanced nParticles in both MR and Maya as well as with a variety of setting and views, yet have not been able to reproduce your problem. Do the instances display properly in the view port when you scrub the time slider backwards? By default not all perParticle attributes are cached on nParticles. On the nParticle shape under Caching you can set Cacheable Attributes to "All", if there are any extra per particles attributes that are driving the instance locations. However it sounds like you may be hitting a bug. Could you submit a bugreport with a simple file showing the problem? (In maya "Help:report a problem") Duncan
| 10 years ago
Hi Duncan, I'm having problem with batch rendering ncached instanced nParticles. It renders only one frame entire sequence.
| 10 years ago
The meshing really helps with the realism of the shot. The flattened spilled particles look much better as a mesh. Looking good so far, can't wait to see more.
*Save $66 per month on Autodesk's Suggested Retail Price (SRP) when purchasing 1 year term 3ds Max or Maya subscription.