Your online Softimage Educational Resource

The blog has been online for more than 4 years and there’s still not a single post even remotely related to the delicious brew called coffee… Perhaps it will someday, but in the meantime you can read the articles about Softimage. Most of the material are tutorials and Q&As I’ve written for 3D World Magazine sometime between today and 2003. If you have any questions please don’t hesitate sending me an email.


Thanks to Letterbox Animation Studios for hosting all the scene files.

Make sure you visit their Redi-Vivus.com for 100s of hours of free XSI video tutorials.

Tuesday, December 28, 2010

Assigning different task based on condition

Select the particle_emitter and Simulate > ICE > Create menu choose Emit Particles from Selection… With the PointCloud still selected, press [Alt] + [9] to open an ICE Tree. Before you can assign any goal or paths for the particles you have to choose a criterion to use to separate the particles. In this example you’ll be using three different objects so it makes sense to divide the particles into three groups, one for each goal/curve. As each particle is born it’s also assigned a unique identification or ID. By feeding this ID into a Modulo operation and set the devisor to the same value as the number of groups you want to create, you’ve efficiently created the 3 collections.

Get a Get Point ID, a Modulo and a Set Data node. Connect the Point ID to the Value input of the Modulo node. Double-click on the Modulo node to open its PPG and set the Modulo By to 3. Connect the Result of the Modulo node to the Value input of the Set Data node. Open the Set Data node’s PPG and in the reference textbox enter self.Goal_ID. This creates a custom variable where each particle is assigned the result from the Modulo node (which is one of three numbers 0, 1 or 2). Connect the Execute port of the Set Data node to the Execute on emit1 input of the Emit from Surface node.

Get a Get Data node and a Select Case node. Open the Set Data PPG and enter self.Goal_ID in the text box and close the PPG. Connect the Value port of the Get Data node to the Condition input of the Select Case node and the Select Case node to the Port2 input of the ICETree node.

Press [8] to open an Explorer. Select the goal object and the two curves and drag and drop them into the ICE Tree. Get a Move Towards Goal node and connect it to the Case0 input of the Select Case node. Connect the Value port of the Goal_No1 node to the Geometry1 input of the Move Towards Goal node. Get two Flow Along Curve node and connect the each Curve node to the Curve1 input of their respective Flow Along Curve node. Connect the execute port of the first Flow along Curve node to the New (Case0)… input of the Select Case node and the second Flow along Curve node to the New (Case1)… input.

The project files used in this tutorial can be found at:
http://www.redi-vivus.com/Caffeineabuse/Multiple_Goals.zip
Image 01
Rather than staking numerous If or Filter nodes, the Select Case node can be used as an efficient way to execute different tasks based on conditions
Image 02
Becoming acquaintance with the Modulo operator will save you a lot of time whenever you need to separate particles into different group or collections.

Quick tip
If you’re using multiple goal objects, replace the Move Toward Goal node with a Set Particle Goal node. On the ICETree node, right click on the Port3 and from the menu choose Insert Port Before to insert a new port. Get a Move Towards Goal node and connect it to the Port3 input of the ICETree node. This way you can control all the particles within a single node even though they have separate goals.


Read the full post>>

Tuesday, December 21, 2010

Painting weights in ICE

While the weights in the weight map will be controlled from within the ICE Tree, you have to create the actual weight map manually. Select the Grid object and from the Get > Property menu choose Weight Map. Select the Grid object and press [Alt]+[9] to open an ICE Tree and from the Create menu choose Simulated ICE Tree. Press [8] to open an Explorer and drag and drop the Sphere object to your ICE Tree. Continue by getting a Pass Trough node, a Get Point Position node and a Get Closest Location node. The Get Point Position node returns the position of each of the points of the grid which is then used by the Get Closest Location node to determine whether the Sphere touches any of the vertices of the grid object (or is within a specified distance). If the Sphere is within this value the corresponding points’ weight should be set 1. If it’s not, the weight should stay unaffected (the default value is zero). Open its PPG. Check the Enable Cutoff Distance checkbox and set the Cutoff Distance to 0.1 and close the PPG.

Connect the Get Sphere node to the In input of the Pass Trough node, and the Pass Trough node to the Geometry input of the Get Closest Location node. The Pass trough node is purely for assisting the creation of compound (see Quick Tip). Connect the Get Point Position to the Position input Get Closest Location node.

Get a Set Data node and double click on it to open its PPG. The Set Data node can be used to set any predefined value or, as in this case, a custom value. In the Reference text box enter self.AddWeight. This will create a custom property named AddWeight. While you can set the value directly from within the PPG, using a separate node for this will make it easier to ‘read’ the ICE tree just by looking at it. So, get a Scalar node set its Value to 1 and connect it to the self.AddWeight input of the Set Data node. Get a If node and connect the Found output of the Get Closest Location node to the Condition input of the of the If node. Then connect the Set Data node to the If True input of the If node. Get a Execute node and connect it to the Port1 input of the ICETree node. Then connect the If node to the Port1 of the Execute node.

Get a Get Data node and open its PPG. Enter self.AddWeight in the Reference text box. Get a Set Data node, open its PPG and click the explore button. In the Explorer, expand the Grid > Polygon Mesh > Clusters > WeightMapCls > Weight_Map and select the Weights node. In the Reference text box, replace the word Grid with self and close the PPG. Connect the get self.AddWeight node to the self.clsWeightMapCls.Weight_Map.weights input of the Set Data node. Conclude the tree by connection the Set Data node to the New (port1) input of the Execute node.

The project files used in this tutorial can be found at:
http://www.redi-vivus.com/Caffeineabuse/ICE_WeightMaps.zip
Image 01
A weight map essentially enables you to store a weight value for each point of an object (or part of your object if you’re using clusters)...
Image 02
…which can be used to control anything from particle emission, shape animation and deformers to defining custom material properties of on object.

Quick tip
In the ICE Tree, select all but the Get Sphere and ICETree node, and from the Compounds menu choose Create Compound. Your ICE compound can now easily be saved to your library for later use.




Read the full post>>

Friday, October 29, 2010

Expanding the width of the rendered image without distorting the camera perspective

By changing the cameras position and increase the size of the output resolution you’ll obviously be able to widen the shot. Unfortunately you’ll end up with a completely different perspective. By compensating the cameras field of view angle in relation to the added pixels the expanded images will line up exactly with the original image when superimposed. The procedure will work just as well if you need to reduce the size of the image.
Step 01
Determine the scaling factor
For example let’s assume that your original rendered image is 800 pixels wide and you would like to add 200 pixels to each side making it 400 pixels wider in total. To determine the scaling factor simply divide your desired resolution with the original, which in this scenario is 1200 (800+400) by 800 which equals a scaling factor of 1.5.
Step 02
Changing the Film Aperture
In the Camera viewport, click on the Camera icon menu button and choose Properties from the menu to open the Cameras PPG. Switch to the Projection Plane tab and check the Enable checkbox. Please note that depending on whether you want to increase the width of the image or the width and the height you’ll need to check or uncheck the Lock Aspect Ratio checkbox in the Film Aperture section prior to changing its values.
Step 03
Changing the output resolution
In the Film Aperture X text box enter 1.5* (which is the scaling factor) and press [Enter] to multiply the original value. Close the PPG and press [3] to switch to the Render Toolbar. From the Render > Render menu choose Scene Options… to open the PPG. In the Scene Output Resolution section enter 1.5* in the Width textbox and press [Enter]. Don’t forget to check/uncheck the Lock Aspect Ratio here as well prior to multiplying the values.


Read the full post>>

Monday, October 25, 2010

How to fill a volume using rigid body dynamics in ICE

The rigid body dynamics in ICE does not only compute faster than the traditional RBD in Softimage, it also turns the handling of thousands of delicious coffee beans into a no-brainer.

The standalone or default rigid body dynamics engine is the preferred solution if you’re simulating few or a fixed number of objects and need high precision. If you’re on the other hand are set to take on a large number or are adding new objects to the simulation over time then ICE would most likely be the one to choose. Even as booth engine uses the physX as the dynamics engine, ICE still isn’t the answer to all your upcoming simulation struggles. And the reason for this is quite simple. Kinematics isn’t officially supported within the ICE framework yet (though it can be activated manually) and the actual shape isn’t available as a collision type.

Open the scene fill_bag.scn from this issues DVD. Press [4] to switch to the simulation Toolbar and select the bean_emitter. From the Simulate > ICE > Create menu choose Emit Particles from Selection. With the PointCloud selected, press [Alt]+[9] to open the ICE Tree. Double click on the Emit from Surface node to open it’s PPG. Change the Size to 1 (which translates to 100 percent of the instanced geometry size). Since the actual shape isn’t supported you’ll have to make do with the next best thing, convex hull. The convex hull is an approximation of the objects actual shape and thus is much faster to calculate. The drawback is that it doesn’t take any holes or dents into account, which can become a bit of a problem since you’re trying to fill, that’s right, a hole! The solution to avoid this obvious bottleneck is to break the object into a number of flat objects and use these as the obstacles.

Get an Instance Shape node, open its PPG, click the Explorer button and choose the CoffeeBean object. Close the PPG and connect the node to the Shape input of the Emit from Surface Node. As you’re merely trying to get those rich and tasteful little beans into the paper bag, a simple gravity force will do the trick. Get an Add Forces node and connect it to the Port 2 input of the ICETree. Then get a Gravity Force node and connect it to the Force1 input of the Add Forces node. Since you’ll be using RBD to compute you don’t need the Simulate Particles node so simply delete it. Instead, get a Simulate Rigid Bodies node and connect it to the Port 3 input of the ICETree node. Open the Simulate Rigid Bodies PPG and change the Elasticity to 0 to keep the beans from bouncing straight out from the bag. Press [8] to open an Explorer and drag and drop the Bean_Obstacles group into the ICE Tree. Connect the obstacles node to the Obstacles > Geometry input of the Simulate Rigid Bodies node.

The project files used in this tutorial can be found at:

http://www.redi-vivus.com/Caffeineabuse/Fill_Volume.zip

The obstacles will be used in the simulation even if they’re not visible so you can hide the obstacles group and the bag to get a clearer view of your beans.


Quick tip
While the actual shape isn’t available as an optimized one-click solution, the same end result can be achieved by extracting each individual polygon of your obstacle as a separate object. Make sure you add a bit of depth to objects as this will assist the accuracy of the simulation.




Read the full post>>

Saturday, May 15, 2010

Rigging a piston engine


Image 01
For the reason that the relation between the crankshafts rotation and the pistons y position isn’t linear, a standard position constraint won’t cut it.


The concept of a reciprocating engine, commonly referred to as a piston engine, is in fact quite simple. Petrol gets injected into the cylinder and the piston pushes upwards to compress the petrol (fumes). The spark plug sets of a spark which ignites the fumes and causes it to explode. The force of the explosion sends the piston down through the cylinder. The piston is connected to the crankshaft via a connecting rod, which transforms the up and down movement into a rotation motion which in the end drive the wheels of the car. The piston is connected in pairs so when one piston is pushed down the other is pushed up which compresses the fumes, which is then ignited by the spark plug and so on.

The problem when recreating the setup in 3D is that the piston’s y position is not linear connected to the rotation of the crankshaft. The piston will move at different speed during a full rotation. Start by opening the scene Piston_Engine.scn from this issues CD. Select the piston and press [Ctrl] + [K] to open its local transform PPG. Right click on the animation icon (the green divot) for the Y Pos and choose Expression Editor… from the menu. Since you know the length of the of the connecting rod, 11 units, and the radius of the crankshaft, 1.5 units, getting the pistons Y position is merely a task of putting your high school trigonometry knowledge into practice.

Side a is calculated by multiplying c (the radius of the crankshaft) with cosines alpha. Before you can determine side d you have to calculate side b, which is done by multiplying c (the radius of the crankshaft) with sinus alpha. Once b is known you can use the Pythagorean theorem,

d2 + b2 = e2 => d= square root(e2-b2)

The full height (h) is sum of a + d

Enter the following expression in the editing pane, press the Apply button and then close the Expression Editor.

1.5 * cos(Crankshaft.kine.local.rotz ) + sqrt( pow( 11, 2 ) - pow( 1.5 * sin(Crankshaft.kine.local.rotz ), 2 ) )

Aligning the connection rod can easily be done in the same manner as in the previous equation. Or you can simply parent the connection rod under the piston and make it point to the crankshaft by using a constraint. Select the ConnectionRod_Rotation, click the Parent button in the Main Command Panel and select the Piston with the middle mouse button to make it the child of the Piston. With the ConnectionRod_Rotation still selected, click the Constrain menu and choose Direction. Pick the Crankshaft_Center when prompted. In the Direction Constraint PPG –Y button to align the Connection Rod.

The project files used in this tutorial can be found at:
http://www.redi-vivus.com/Caffeineabuse/Piston_Engine.zip

Image 02
A quick revisit to your high school trigonometry lessons is just want the doctor has ordered.


Quick tip
All the transforms are evaluated in local space, so to move or reorient the piston simply parent all the objects under a null (or any other dummy object) and you’re good to go.


Read the full post>>

Thursday, April 22, 2010

Single axis direction constraint



Image 01
While you can’t restrict the direction constraint to a single axis per se, using an extra object as a buffer will create the desired result.




As you’ve noticed there isn’t a one click solution to limit the direction constraint to a single axis. However there’s no need to despair as we’ve supplied you with two different methods to tackle the problem.

Open the scene Surveillance_Camera.scn from this issues DVD. The first method requires two null objects, one which can be moved in any direction and one that will be used for the actual direction constraint. Create a null object, name it Direction_Cns and move it somewhat in front of the surveillance camera. Create another null object, name it LookAt and move it in front of the camera as well. Press [Ctrl] + [K] to pen its Local Transforms PPG and click the Lock icon to pin it to the screen. Select the Direction_Cns object and press [Ctrl] + [K] to open its transform PPG as well. Click and drag the animation icon (the green divot) from the X Position in the LookAt PPG and drop it on the X Position animation icon in the Direction_Cns PPG. By dragging and dropping an animation icon from one parameter to another creates an equal expression, meaning the second parameter will match the exact same value as the first. Drag and drop the Z Position of the LookAt to the Z position of the Direction_Cns and close the PPG’s. Select the Camera_Orientation and from the Constrain menu choose Direction. Pick the Direction_Cns when prompted. Select and move the LookAt object to change the direction of the Surveillance_Camera. Save your scene under a new name.

The second method uses a somewhat different approach but has the same outcome. Open the Surveillance_Camera.scn again. Create a null object, name it Direction_Cns and position it straight above the camera. Create a second null, name it LookAt and position it in front of the camera. Select the Camera_Orientation object and from the Constrain menu choose Direction. When prompted, pick the Direction_Cns. Click the Y button in the Align Axis section of the Direction Cns PPG to correct the cameras orientation. Switch to the Up Vector tab. In the Optional Up Vector Control Object section, click the Pick New button and pick the LookAt object. Select Z as the Affected axis and close the PPG. While the direction is constrained to the Direction_Cns object, the added up vector gives you the final control of the cameras orientation. Select and move the LookAt object to change the direction of the Surveillance_Camera.

The project files used in this tutorial can be found at:
http://www.redi-vivus.com/Caffeineabuse/Direction_Constraint.zip

Image 02
The other way around it is to have the constraint pointing to a dummy object and then the up vector as the actual target for the direction.


Quick tip
In addition to naming convention it’s a good practice to use different colors and/or icons on your null objects. This way you can easily tell what objects does what by just looking at your scene.


Read the full post>>

Thursday, April 15, 2010

Assigning different textures to the same geometry-instances in ICE

While you can’t assign different materials to the same geometry instances per se, you can use attributes from the pointclod to achieve the same result. Start by open the scene multiple_textures.scn from this issues CD. Select the PointCloud and press [Alt] + [9] to open an ICE Tree. With the pointcloud and the instanced geometry already in place, the only thing left to add is a random color. Get a Randomize Color by Gradient node and connect it to the Color input of the Emit from Surface node. Open the Randomize Color by Gradient PPG and change gradient to match the screenshot.

Select the can object and from the Get > Material menu choose Blinn to apply a material and then press [7] to open a Render Tree. While each particle has a random color assigned to it, the color information is not automatically passed on to the material. From the Attributes category get a Color node. Open its PPG and change the Attribute to Color.

From the Images Processing category get a RGBA Keyer and open its PPG. Set the both the Minimum and Maximum threshold color to R:0, G:1, B:0 (pure green). Set the Color if in rage to white (R:1 G:1 B:1), and the Color if outside range to black (R:0 G:0 B:0). This will create a mask where all the green particles will be output as white and everything else as black. Duplicate the RGBA Keyer node and change the Min and Max threshold color to pure blue (R:0, G:0, B:1).

In the Mixers category get a Mix 8 Colors node. Open its PPG and check the In Use checkbox for the Layer 2. Connect the Attribute Color node to the input of each of the RGBA keyer nodes. Connect the first RGBA keyer to the weight1 input of the Mix_8colors node and the second RGBA keyer to the weight2 input. Connect the Mix_8colors node to the diffuse and ambient input of the Blinn node. Add three image nodes, each with a separate texture, and connect the first to the base_color input of the Mix_8colors node, the second to the color1 input and the third image node to the color2 input. You’re now using three different textures on the same geometry-instances.

The project files used in this tutorial can be found at:
http://www.redi-vivus.com/Caffeineabuse/ICE_Textured_Instances.zip

Image 01
Using blocks of solid colors rather than the smooth gradient is a quick and efficient way to define random colors.

Image 02
The color information is then used in the Render Tree to assign a different texture to each of the colors defined in the gradient.


Quick tip
To change the balance between of the different colors (textures) simply change the markers position on the gradient.


Read the full post>>

Thursday, January 21, 2010

Water Condensation using ICE

On planet earth matter can traditionally exist in three physical states or forms; solid, liquid and gas. There are in fact a couple of more states such as plasma and liquid crystal, but let’s not get too technical. Condensation is essentially water changing it physical state of aggregation from gaseous into liquid (guess you’re glad we didn’t get in to the technical parts). One of the most common examples of this is the creation of clouds. As warm air rises to the atmosphere it cools and loses its ability to hold water vapor. The water molecules will then clump together to form cloud droplets, which then of course fall as rain (a phenomenon anyone who has visit England is far too familiar with).

This is the exact same thing that happens on a cold glass bottle on a warm summer day. Rather than forming small clouds around bottle the water vapor will form tiny droplets on any part of the surface that is colder than its surrounding air. Once the water droplets on the bottle reach a certain size or mass, gravity will grab hold of them forcing them towards the ground. As the water drop slides down the surface of the bottle it will attract any neighboring drops along its path, which creates a small water trail. The amount of water vapor the air can hold and the rate it condensate is determined by a number of factors. The characteristics of the water drops is then additionally affected by the material of the object and it’s surface.

Recreating the complete atmospheric process in real-time would pretty much be like watching paint dry (or the opposite). For your convenience we’ve speedup the course of action on the following pages, where you’ll create a complete and fully functional condensation compound using Softimage’s new interactive creative environment – ICE.

Note that covering a glass bottle with thousands of tiny water drops will obviously cost you once you hit the render button. The two most important attributes for creating a realistic glass or water material is their transparency and their reflectivity. As your entire scene is filled by nothing but the two, you will be required to crank up the reflection and refraction rays depth in the render options optimization tab. even tough the creation of these materials unfortunately falls outside the scope of this walkthrough; it shouldn’t be too difficult for you to create them on your own as ICE particles allows you to use any of the standard materials such as Blinn or Phong.



The project files used in this tutorial can be found at:
http://www.redi-vivus.com/Caffeineabuse/ICE_Water_Condensation.zip

STAGE ONE Preparing the bottle

Step 01
Start by open the scene Bottle.scn from this issue DVD. Staying true to reality means that any part of the bottle that is colder than the air surrounding it will be exposed to the tiny water drops. This would include the bottom and inside of the bottle as well. As these parts won’t be visible in your CG reproduction there’s no point wasting precious CPU resources to compute them, so you’re going to limit the effect to the outer surface of the bottle.

Step 02
To do so you’ll need to create a Weight Map to mask which area to emit particle and which will not. Select the Bottle and from the Get > Property menu choose Weight Map. Press [W] to activate the Pain Tool and with the left mouse button paint the outside of the bottle. Note that you can change the size of the brush by hold down the middle mouse button and drag to left or right and the right mouse button to erase painted area. When done, press [SPACE] to exit the paint mode.

Step 03
With the Weight Map in place it’s time to emit some particles. Press [4] to switch to the Simulate toolbar. With the Bottle selected, click ICE > Create > Emit Particle from Selection. This creates the PointCloud where all the magic will take place. If you play your animation you’ll se that particles are emitted from the entire bottle and fly off in to space. This obviously has to change, so press [Alt]+[9] to open an ICE Tree.
STAGE TWO Emitting the water drops
Step 04
There are two tabs in the Preset Manager, Task and Tools. Under the Tools tab you’ll find all the low-level nodes of ICE and under Task you’ll find low-level nodes packaged together to perform specific tasks. A far quicker way to find the node you’re looking for than browsing trough the manager is by using the Filter text box. By entering the first character (or any character for that matter) in the text box it will automatically displays all the nodes that match your filter criteria.

Step 05
Double click on the Emit From Surface node to open its PPG. While it shouldn’t take more than a couple of minutes to get condensation on the bottle in real life, it just seems a little overambitious to reproduce the effect in real-time. So to speed up the process you’ll emit a good amount of particles (which in you case equals water drops,) for a few seconds and then leave it at that. Change the Rate to 500. You will alter the size of the particles later on so just leave it for now. Change the Shape to Blob and set the Speed to 0. Close the PPG

Step 06
Get a Limit by Time Range node (by entering part of its name in the Filter textbox as described earlier). Open its PPG and set the Start Frame to 0 and the End Frame to 100. Close the PPG and connect the node to the Enable input of the Emit from Surface node. Get a Filter by Weight Map node and connect it to the Execute on Emit 1 input of Emit from Surface node. Now your particles will only be emitted from frame 0 to frame 100 and only from the area you’ve painted with the Weight Map.

Step 07
To add variety and dynamic to the water drops you are going to change their size based on how many percentage they’ve lived of their total life. By default the particles don’t have age awareness so this has to be added manually. Get a Set Particle Age Limit node and connect it to the New (Execute on Emit 1)… input of the Emit from Surface node. This will set the life of each particle in seconds.

Step 08
Your particles now have an age limit but they will all live for the exact same duration. Even though this alone should brake up much of the uniformity of the particles, it still lacks an organic touch. Get a Randomzie Value by Range node and plug it into the Age Limit input of the Set Particle Age Limit node. In the Randomize Value by Range PPG, change the Minimum Value to 1 and the Maximum to 200.

Step 09
Let’s set the size of the particles. Get a Set Particle Size node and connect it to the Port2 of the ICE Tree node. The ICE tree is processed from left to the right and the terminator (the ICE Tree node) from top to bottom. The terminal node (the ICE Tree node) is then executed from top to bottom. So the Emit from Surface branch plugged in to Port1 will be executed before the Set Particle Size you’ve just plugged in to Port2 which is executed before Port3 and so on.
STAGE THREE Changing the particle size

Step 10
The Set Particle Size node won’t do much good alone since there is no data feed in to it. Get a Modulate Value by Age Percentage node and connect it to the Size input of the Set Particle Size node. Open the Modulate Value by Age Percentage PPG. The profile will determine how the particles size will change over time based on the Base Value. Were the left keyframe represents when the particle is born and the right keyframe when it reaches the end of its life.

Step 11
So if the left keyframe is set to 0.6 it means the particles will size will be 60% of the Base Value when it’s born. Select the left keyframe in the graph, right click and choose Key Properties from the menu. Set the value to 0.6. Click on the Next Key button. Set this Value to 1 and close the PPG. Using a single value as the Base Value means that all particles will have the same size at the beginning and end of their lives, even if their age limit will be completely different.

Step 12
To get around this problem you’ll obviously need to use different Base Value for each particle. Get a Randomize Value by Range node and connect it to the Base Value of the Modulate Value by Age Percentage node. Open the Randomize PPG and set the Min Value to 0.1 and uncheck the Animated checkbox. Get a second Randomize Value by Range node and connect it to the Max Value of the first Randomize node. Open its PPG and set the Min to 0.1, the Max to 0.25 and uncheck the Animated checkbox.
STAGE FOUR Sticking to the bottle
Step 13
All the Ports of the ICE Tree node are currently occupied so you’ll need to add new Port. On the ICE Tree node, right-click on the Port3 input (currently occupied by the Simulate Particles node) and choose Insert Port Before from the menu. Add four more ports while you are at it, so you have five free ports in total. Get a Slide on Surface node and connect it to the Port3 of the ICE Tree node.

Step 14
If you open the Slide on Surface compound PPG you’ll see a number of parameters to control at which angle the particles are allowed to drip of the surface, how many particles that needs to be together, how much force will be required etc. Since you’re basically just want to stick the water drops to the surface you don’t need to pay too much attention to these. Decrease the Angle Threshold to 10 or so and the Min Neighbouring Particles to 5. Close the PPG.

Step 15
The particles don’t know which surface they are supposed to slide on, so you need provide this data as well. Press [8] to open an Explorer and drag and drop the Bottle object from the Explorer in to the ICE Tree workspace. Connect the Output value of the Get Bottle node to the Surface 1 Input of the Slide on Surface node.
STAGE FOUR Adding Gravity

Step 16
If you simply add a gravity force to the ICE Tree, all the particles would be affected and run down the bottle straight away. While you do want a gravity force, you only want the particles that are above a certain size to be affected. Get an If node and a Test Particle Size node. Connect the Result output of the If node to the Port4 input of the ICE Tree node. Connect the Result output of the Test Particle Size to the Condition input of the If node.

Step 17
Open the Test Particle Size PPG and set the Test Size parameter to 0.2. If the particle size greater than 0.2 the Condition is true, and the If True port will be executed. If the size is less that 0.2 the If False is executed which in your scenario means that nothing will happen. Get an Add Forces node and connect it to the If True input of the If node. Get a Gravity Force and connect it to the Force1 input of the Add Forces node.

Step 18
Get a Drag Force and connect it to the New (Force1)… input of the Add Forces node. This will create a flow resistance to the particle and balance the force of the gravity. To further enhance the variation of the particles motion you’ll turbulize the strength of the Drag Force. Get a Turbulize Value by Range and plug it into the Strength input of the Drag Force. Open its PPG and set the Min Value to 0.02 and the Max Value to 0.1. Close the PPG.

STAGE SIX Creating a water trail

Step 19
As the water drops run along the surface of the bottle they will leave a fine trail of water. Get a Generate Strand Trails node and plug it into Port5 of the ICETree node. Open the Generate Strand Trails PPG. Set the Max num Segments to 10. This parameter controls the length of the trail, the higher the value the longer the water trail.

Step 20
The Strand Size Profile determines the size of the trail, which in this scenario means overall shape. Select the right keyframe, right-click on it and choose Key Properties from the Menu. Set the Value to 0. This will fadeout the water at the end of the trail, giving it a more realistic shape. Set the Strand Size Multiplier to 0.5 to tone down the overall trail.

Step 21
Just as with the gravity, you don’t want to create trails on all the particles in the simulation but limit the effect to the drops that are actually moving down along the bottle. Rather than testing the particle size you’ll test the particles velocity. The particle will only leave a trail if its velocity exceeds a certain number. Get a Test Particle Velocity and connect it to the Enable input of the Generate Strand Trails node. Open the Test Particle Velocity PPG and set the Test Velocity to 1.
STAGE SIX Coagulate force

Step 22
So you have gravity, drag, water trails and the actual surface of the bottle all taken into account, but the particles still don’t have any affect on each other. The coagulate force enables you to attract particles together, creating small lumps of particles (which of course creates a slightly larger water drop) based on their distance to each other. The force can have a drastic effect on all your particles so the trick is to use small subtle values.

Step 23
Get an Add forces node and connect it to the Port6 input of the ICETree node. Get a Coagulate Force node and connect it to the Force1 input of the Add Force node. Open the Coagulate Force PPG. The Cutoff Distance determines the maximum distance allowed between two particles for the force to have an effect. Set the Cutoff Distance to 0.15. Increase the Coagulation Drag to 0.4 to slow down the particles as they get closer and set the Repellent Strength to 0.

Step 24
The very last node to add in this walkthrough is to control the amount of blending between the water drops. Get a Blobs node and connect it to thePort7 input of the ICETree node and you’re ICETree is completed. Before you apply the water and glass material to your scene elements it’s wise to do test rendering and fine-tuning of the particles using a standard Blinn shader. The number, size and characteristics of the water drops all relate to the temperature and humidity of the air as well as the surface of the bottle but perhaps more importantly, your personal taste. All the above values should be used merely as a guide in your quest for the perfect condensation.


Read the full post>>