Posted by Duncan Brinsmead, 21 June 2010 8:00 pm

Here is an example scene file showing how one can use particle emission into a fluid for a natural looking waterfall effect.
In this case the particles simply fall under gravity and collide and bounce with objects. They emit into a fluid which has high density dissipation. The self shadowing of the fluid is important for the look of the render, and this scene also uses ambient diffusion to help provide detail in the shadowed regions. For efficiency auto resize was also enabled for the fluid. The particle system rendering was disabled by turn on "intermediate object" on the particle shape. This way the fluid handles all the water shading, and as a result it also needs to be fairly high resolution to get good detail in the flow.
Here are some general rough steps to set this up:
1. Create an nParticle emitter. Use the "balls" preset and make the emitter a volume cube shape. Scale the emitter to fit the top of the water fall and edit the emitter speed to push the particles over the edge.
2. Select any geometry you wish to collide with the particles and do "nMesh: create passive collider".
3. Create a 3d fluid container. Turn on auto resize on the fluid, as well as self shadowing. Because this is an auto resize fluid the resolution is a result of the scale of the fluid relative to the particle system, so one can get higher resolution by simply scaling down the fluid.
4. Select the fluid and the particle system and do fluid:emitFromObject. Make the fluid emitter type "omni" (this does not affect emission with particle emitters, but it ungreys the maxDistance attribute) then set the maxDistance attribute to your desired particle size. (this will be better if it is larger than the size of a voxel in your fluid)
5. On the emitter enable motion streak and make the speed method "replace" . Make "inherit velocity" around 1 or 2. This causes the particles to also push on the fluid as they fall through it.
6. On the fluid make density dissipation around 1.0. The dissipation is pretty critical to the overall effect. You may also wish to have the density buoyancy negative. Turning on high detail solve will help to preserve detail in the flow.
7. Make the fluid auto resize threshold 0.0. You can later experiment with raising it slightly to keep the fluid bounds tighter, but be careful because if it is higher than the particle density emission per step it can cause artifacts in the flow.
8. For good shading make the transparency of the fluid very low and adjust ambient brightness to taste (note that ambient diffusion requires mental ray, it is not supported in the maya software renderer) Also ambient diffusion did not render properly with auto resize in the 2011 gold release( check for future hot fixes that may fix this issue ).
Note that care should be taken to limit the range of the particles to avoid making the fluid grow too large. One can either kill stray particles, limit their lifespan or bound them with collisions.
Please only report comments that are spam or abusive.
42 Comments
sacslacker
Posted 23 June 2010 1:22 am
belgant
Posted 23 June 2010 2:48 am
hai duncan, we are interesting for script making explotion that u made....i dont know, u can share us or no!!...
and i can see that u make some explotion for particlebomber scene...
hoply u can share us for that script....thank.s ..
Max Balboa
Posted 23 June 2010 6:15 am
Although I was convinced that it looked like a waterfall in the the image. But when I watched the video, I have to be honest, the beginning looked more like a big pile sand, dust, gravel and debris falling altogether. Although the latter parts of the video looked like a waterfall eventually. I think this will for both.
RROCHS
Posted 23 June 2010 1:39 pm
SantiDarkG
Posted 23 June 2010 6:07 pm
palesdream
Posted 5 July 2010 11:28 am
Duncan Brinsmead
Posted 20 July 2010 9:49 pm
CBKR
Posted 21 July 2010 12:59 am
How would I go about converting my data into iFF format? IS there a pluggin or script of somesort? And can this then be directly attached to a particle?
Duncan Brinsmead
Posted 21 July 2010 1:15 am
Another way might be to create a bunch of ascii files with your particle positions in them... then create an expression (not a particle one) that each frame reads the file for the current frame then sets the positions of your particles(looping over all the particles). If this was slow, you could then create a particle cache and use that instead of doing the MEL read.
CBKR
Posted 22 July 2010 2:31 pm
sacslacker
Posted 27 July 2010 6:25 am
Duncan Brinsmead
Posted 27 July 2010 5:03 pm
I would suggest you explore this site:
http://www.fractalforums.com/
You will find lots of discussion about the Mandelbox including code and posts by the fellow who created it. As well there is info on what software to use and how to use it.
If you really want to use Maya I think it would involve writing a volume rendering shader in Mental Ray, which would be a chore. (although perhaps there is something available for mental ray already out there) Maya of course would provide more flexibility with things like animation and light setup than specialized fractal programs.
Duncan Brinsmead
Posted 27 July 2010 5:31 pm
http://www.ms.mff.cuni.cz/~kadlj3am/big/boxplorer/
Jan Kadlec has graciously made this realtime GPU Mandelbox program available to all, source code included!
sacslacker
Posted 29 July 2010 9:54 pm
I would definitely like to use Maya for this because there so much opportunity for unique FX based on this technique. Great stuff!
dyei nightmare
Posted 12 August 2010 7:23 am
stuff maya 2011 special features:
vimeo.com/12466787
it looks really amazing... mainly those cubic structures with random patterns.... fractals and such... i didnt know that maya was able to do things like that... how did you that???
Duncan Brinsmead
Posted 12 August 2010 7:27 pm
www.ms.mff.cuni.cz/~kadlj3am/big/boxplorer/
Also www.fractalforums.com has lots of info on generating these structures.
Duncan Brinsmead
Posted 8 September 2010 4:19 pm
Duncan Brinsmead
Posted 8 September 2010 4:40 pm
Duncan Brinsmead
Posted 10 September 2010 6:48 pm
Duncan Brinsmead
Posted 13 September 2010 9:44 pm
http://dailyator.com/new-ipad-app-is-perfect-for-piano-enthusiasts/52810/
1) some favorite of piano work composers?
It is really hard to single out favorites, because I'm constantly becoming enthralled with different composers and works( the piano has such a wonderful repertoire ). A lot of the best stuff I get over exposed to, so I like to play things I'm less familiar with.
Bach (although he didn't compose for the piano exactly). I would rank him as the greatest composer of all time if I had to, but it is apples and oranges, really. He is the one composer that I never tire of. The Well Tempered Clavier is great, the Goldberg Variations. I really enjoy listening to the grand organ works he did, and I have some transcriptions for piano, but while fun to play don't really have the same effect as on a large organ.
I've been playing some Handel lately, and really enjoying it. I think one of his suites was inspiration for the Goldberg variations, and I find the simplicity of Handel helps me better understands the musical forms that Bach was building upon. His music is not as complex or deep as Bach's but is fun and easy to play.
Beethovens Sonatas are magnificent... surely the finest written. Being an orchestral player I especially like to play transcriptions of Symphonies and concertos. Liszt transcribed( in his style ) all the Beethoven symphonies, and these are fun and challenging to play. I also have some other transcriptions of the 3d, 5th and 9th that are simpler that I sometimes enjoy playing. That iPad app has all his string quartets transcribed for piano, which is the first time I've seen this. It is like discovering a bunch of new Sonatas.
Brahms is also one of my favorites. I have a transcription of his Symphonies I really like to play. As well his more intimate works as well as his sonatas are some of my favorites. I also love his two piano concertos.
Rachmaninoff wrote a lot of great stuff for piano. I find his work not all up to a high standard but his best works are brilliant. I prefer much of his earlier work, and my favorite is likely his 2nd concerto.
I especially love the later symphonies and piano concertos of Mozart.
I suppose I need to cut this list short, as otherwise I will go on for pages and pages.
2) and to return a little bit on 3D stuff, days ago I have the question, if possible share a one mesh solver(convert:nParticles_to_Polygons) for two diferent nParticles, in order to mix it and be independent, but if they approach close the same mesh solver work like metaballs and integrate the two nParticles. (kinda makes RealFlow, particles of different emitters using a single solver mesh.)
There is no direct way to do this, however there are workarounds. The simplest is to simulate within a single particles system, and use per particle attributes and multiple emitters to differentiate the particles. (you can assign as many emitters to a single particles system as desired using the dynamic relationship editor). Another potential workaround is to combine two systems into a single one(there would be 3 particles systems in the scene). One could use emission to combine the systems, although it might be fussy setting everything up efficiently.
Duncan Brinsmead
Posted 21 September 2010 5:15 pm
Duncan Brinsmead
Posted 21 September 2010 7:25 pm
Skorpius
Posted 21 September 2010 7:56 pm
thank you for you help...
sarosh
Posted 16 October 2010 9:52 am
klf_lupo
Posted 14 November 2010 12:31 am
Duncan Brinsmead
Posted 20 December 2010 10:13 pm
Duncan Brinsmead
Posted 21 December 2010 7:08 pm
Animate nParticles by making conserve = 0 and using a curve field. Set up the radius and directions on the curve field for the correction rotation of the particles. Emit from the particles into a fluid in a manner similar to this waterfall and render the fluid, setting intermediateObject ON for the particle shape so it doesn't render.
The particles can emit both density and speed (with inherit motion) into the fluid. You need to use Maya2011 for the emission from particles into the fluid. Also enable motion streak on the emitter. Also look at:
particleVortexFanHR5.ma
which can be found here:
http://area.autodesk.com/blogs/duncan/scene_files_for_fun_stuff_in_maya2011
giftbaby
Posted 24 December 2010 2:21 am
Greeting my dear
I'm gift Koneh
anyway i came across your profile on
www.the-area.com and i love it so much.Here is my
email address (gift_1000@yahoo.in)
you can email me with the above id then
i will send you my picture and also tell
you more about my self
hope to hear from you soon
have a nice day
thanks
Duncan Brinsmead
Posted 18 March 2011 5:42 pm
Satyajit Ramesh
Posted 9 April 2011 6:50 pm
Great Work Duncan........ Thanks for the Tutorial
Duncan Brinsmead
Posted 2 May 2011 9:10 pm
1. Make sure the particle motion is roughly correct without any fluid(you can look for other particle tutorials if this is a problem)
2. If the fluid simply looks like hard balls, not streaks, then your density dissipation may be too high on the fluid. As well you may not have enabled motion streak on the fluid emitter. Another possible issue could be having too large an emission radius (maxDistance on the fluid emitter). It should not be too much more than the size of a voxel.
3. Perhaps your fluid is stationary. You want some solving in general. Turn on draw of the velocity vectors so you can see what is going on. One can use both density buoyancy and inheritVelocity on the particle fluid emitter as a means of applying force to the fluid. (external fields could also be used but shouldn't be needed)
If you download the scene file you should be able to compare your setup with the settings of the various nodes.
Duncan Brinsmead
Posted 4 May 2011 5:32 pm
It is possible to use shading network textures with a fluid(textures mapped to things like transparency or color ramp indices on the fluid), but by default they will evaluate at the outer bounds of the fluid. To evaluate such textures( which must be 3d or projected textures) within the fluid you need to enable volumeSamplesOverride on the fluid shape and increase the volumeSamples. For a detailed texture the volumeSamples would need to be very high, which could make the render significantly slower.
Also note that if you want to convert the fluid to poly then shading network textures are not evaluated properly.
Duncan Brinsmead
Posted 5 May 2011 2:56 am
Duncan Brinsmead
Posted 11 May 2011 11:53 pm
fluidTexture2DShape1.opacity[0].opacity_FloatValue
If you wanted to smear your texture around based on the motion of the fluid you could make the fluid coord method =grid and the coord speed 1.0 then connect the fluid texture outUV to your fractal uvCoords.
JimBean
Posted 17 May 2011 3:47 pm
Love your work. It's been too long since we've seen any of it, what have you been busy doing? Maybe that would make a nice post.
Regards
Duncan Brinsmead
Posted 17 May 2011 8:54 pm
JimBean
Posted 18 May 2011 5:44 pm
Thanks for the update.
jbturof
Posted 31 August 2011 6:39 am
Don't know why I have so many problems finding these things....
Where can I find the Inherit Velocity attribute and motion streak? I've looked through the emitter, nParticle Shape and nucleus tabs and don't see it anywhere. Also...after assigning the fluid to my particles, they are rendering very large now. Thoughts
Duncan Brinsmead
Posted 31 August 2011 10:13 am
The main direction of flow should be determined by the particle emitter unless the dissipation is not high enough on the fluid.
jbturof
Posted 31 August 2011 12:07 pm
Duncan Brinsmead
Posted 26 September 2011 5:39 pm
faveric
Posted 26 July 2012 4:28 am
1.Does it use the SPH algorithm to realize the liquid simulation between the two nparticles from different transmitters?
2.How to achieve the self collision of the nparticles? What is its internal algorithm?
Add Your Comment
You must be logged in to post a comment. Login or Register here