National Geophysical Data Center
2D Fluid Displacement method (shown above)
There are a few methods where one can import the data into a fully 3D fluid grid, although it is also possible to directly apply the 2d displacement image to a 2d fluid and volumetrically render it. The "useAsHeightField" toggle on a 2d fluid will interpret its opacity as displacement. It renders as a flat bottomed volume with continuous density between the bottom and the top or surface of displacement. The "pond" feature uses this toggle, but uses a surface render method. For clouds it is better to use a volume render method with self shadowing.
In the examples I've attached I've mapped a texture to the opacity and edited the opacity graph to get good shape on the clouds. If one instead wishes to use a map then instead make the opacityInput = density, and make the density grid static. Make the opacity graph the default linear 0-1 ramp to start with. Set the fluid resolution to your displacement map resolution, then use the fluid paint tool import function to load the image into the fluid density grid. One can then adjust the the opacityInputBias and transparency to get the best effect. Also the edgeDropoff can be used to soften the bottoms of the clouds( although it also softens all 6 boundaries of the fluids container ). The fluid's size "z" value will determine the maximum displacment while the opacity determines the displacement relative to the range. The transparency attribute determines how opaque the clouds are.
Here is a 2D fluid heightfield that uses noise on the opacity to create the clouds:





If you want to instead map a displacement to a 3d fluid grid there are a variety of possible methods, although they are generally harder to implement than the 2D method above and will require more memory.
First off you should create a fluid that has the resolution set to cloud image resolution in x and z and the y resolution set based on the relative height of the cloud layer. Adjust the fluid size to the desired cloud bank size, but make sure the size value is always proportional to the resolution. Thus for a resolution of 1000, 500, 10 one might have a size of 20.0, 10.0, 0.2. The total memory used will be proportional to xres*yres*zres.
Here are a couple of methods for initializing the fluid density values from the displacement image:
1. In the paint fluids tool Import the cloud image as density starting from the bottom fluid slice or layer(click on the light blue dial next to the fluid to set the layer.. the view initially rotates the layer unless on hit the lock icon). As one moves upward
import the same (displacement style) texture, but threshold it so that only the peak intensities remain. The import remaps the image based on the min/max values in the paint attributes block, so I think one could use this to do the desired thresholding by making the min negative.
2. Write a script that loops over the image pixels, getting the color using either bonus tools iffPixelCmd or perhaps using colorAtPoint on a file texture with the image. For each pixel do setFluidAttr on the voxels where intensity from the image would be considered height, so for a given pixel if the intensity was one, one would set the density of all the fluid voxels in that column. If the intensity was 0.5 one would only set the bottom half of the voxels in that column, etc..
3. Apply the texture as a displacement to a surface. Convert this displacement to polys. Then emit from this mesh into the fluid over a few frames moving the mesh downward during the emission until it is totally below the fluid.
4. Write a standalone program that converts the image to a fluids cache using the technique in #2 above.
A Dynamic Cloud texture
In some cases you may wish to texture a cloud layer on a planet yet dynamically animate it as a fluid. In this case one can simply apply a 2D fluid texture as a transparency and color map on a cloud layer shader, and initializes it with the paint fluids tool. This is useful when you need to have clouds wrap around curvature of the earth.
parentToSurface.mel
nClothBook.ma
dynamicFollow.mel
cameraFollow.mel
cameraFollowScene.ma
lightOcclusion.ma
fireball.ma
itsSlinky.ma
TunShu_BindClothSkin.zip
confettiFall.mb
simpleConfetti.ma
roundConfetti.ma
partyStreamers.ma
waterTank.ma
nClothWater2.ma
nClothWater.ma
waterPlayground.ma
sunsetLeaf.zip
oakBigLeaf.mel + oakBigLeaf.mel.icon
ribbonTwist.ma
bagOfMarbles.ma
toonOcean.ma
buckySphere.ma
thickSlab.ma
phoneChord.ma
forestRoad.ma
bark.iff
basicLeafHC.jpg
birchBark.gif
grassRoad.jpg
leafSerrate.tif
WhiteBark.tif
sideleaf.rgb
atmosphere.ma
writeHello.ma
zipper.ma
nClothVertexEditor.mel
equalizer.ma
slidingCurtain.ma
inkDrop.ma
orangeDye.ma
displacementClouds.ma
displacementCloudsWithSkyFog.ma
displacementHurricane.mb
fluid initial state
hurricaneDetailNoise.mb
hurricaneDynamic.mb
im having trouble mapping an infra red image to the initial state also… i was wondering if a third request will encourage you to elaborate a bit on the process of mapping the image to the fluid. ive tried a few ways but cant get rid of the perlin noise.
these methods produce decent looking clouds, but how would a person go about implementing them if they wanted them to look good from below instead of from above?
Hmmm. I am not sure my previous post made it so here I go again. First of all, thanks very much for the tutorials Duncan, they are always great and offer new possibilities.
I was wondering if you could go into a little bit more details on the approach of mapping the image to the 2d container. I assume that you plugged the image as a projected file texture into the opacity input bias. Is this correct? I am asking because when I try it I only get a decent image when rendering from above. As soon as I go down toward a side or eye level view it breaks down, sometimes not rendering any fluid density at all. This does not occur when I do it with your sample scene.
Thanks much Duncan.
jim
Hi there,
Great tutorials. Thanks very much.
I am currently trying to create a simliar effect using a 2d fluid mapped onto a sphere to create a globe. I need to get up close to the clouds and would like to have a volumetric effect. The problem is, the 2d fluid acts as the texture placement for the phong shader. How do I place, or is there a work around so that the fluid wraps around the globe correctly. I am using a cloud mp designed to be applied to a sphere as the density.
Any help or ideas you can provide would be greatly appreciated.
Regards
Martin Waters
I don’t have understand where is load the file hurricane infra-red..
Can help me??




