Sunday 3 November 2013

Week_5   Particle Flow system


 
Using the PFlow particle to simulate smoke
1_Open the file pflow_start.max



 


2_In the top view zoom in to the jeep and drawout a PF Source logo, change it to circle and set diameter to 3 and the viewport quantity to 100%,  in the modify panel.
 

3_With PF Source selected rotate 180deg in the 'Y' spinner so mission is upwards.

Open the Particle View from Viewport or key 6. This show the particle maintenance elements, with two main panel upper and lower. The upper is called the events panel (the sequence of characteristics to affect the particles are placed in a list ) and the lower is called the depot (where you drag to the upper panel the next required effect)


        
Examine the two diagrams and check the additions that have been made the complete the smoke effect. As can seen from the operators on the right.  A Delete, a Shape Facing, a force(replaces shape) and a Material Dynamic are added to the original event01 list on the left diagram.  The last operator addition from the depot is the Material Dynamic that actually applies the noise and gradient maps to the final particles.
 

4_Drag each of the operators from the depot panel to the events panel, dropping the face shaping on top of the original shape operator.
 

5_Click on the birth operator in the events. It’s the original creation of the PFlow. A parameter rollout opens to the right.
Set Emit Start=-100, Emit Stop=300, Amount=2000. Scroll with the time slider and the particles are moving to fast. Check that by clicking on the Speed operator.
 

6_Set Speed=6 and variation=1. Scrub time slider. Result is smoke rises more slowly, in a dense column.
 

7_Change the display ticks from ticks to cubes. Click in events the display and the parameter rollout to the right next the Type is the dropdown with display types, select the Geometry type. Next change the size of display.
 

8_Click the shape operator and in the parameter box to the right change the size=0.2, Smaller cubes should be seen emitting from the flow.

 
Add two space warps, One to create an updraft, the other to create a wind from the east.
 


1_In the create panel click the space warp button, fifth along from create. Click the wind button and in the top view draw out at about 7’oclock a square (size not important) for the space warp. Name it ‘Updraft’
 

2_At about 3’oclock draw out another just off the ground plane. Rotate this -90deg so its arrow is pointed towards the jeep. Name it Eastwind.





3_Tie these space warps in to the particle animation via the Particle View dialogue box. From the depot panel drag up to the event01 list a shape operator. Drop it above display and below rotation. In the force parameter to the right click the ‘by List’ button. A select force space warp dialogue box opens. Use CTRL click to select both.
4_Adjust the space warp settings from the modify panel.
With Eastwind selected:
parameters/force: set strength=0.01, decay=0.025 in the wind section
parameters/force: set turbulence=0.01, frequency=3.0, scale=0.1
With Updraft selected:
parameters/force: set strength=0.0, decay=0.0
in the wind section
parameters/force: set turbulence=0.005, frequency=6.8, scale=0.2 drag time slider to see the smoke drift upwards and to one side.




5_In the Particle View click Birth and in the parameters set amount=250
6_Change the cubes for plane camera facing squares. Drag a Shape Facing operator from the depot and drop it onto the Shape operator. Set the Shape Facing to use the camera as its point of reference. With Shape Facing selected in the parameters section click the button that below ‘Look at camera/object’ set the camera. Move the time slider back and forward and see the faces. In the shape facing parameters set the size to=4.






7_Drag a scale operator from depot to event01. and drop it between the Shape Facing and Force operators.
 

8_Click the Scale operator to highlight it. In the Scale parameters, choose Relative Successive from the Type drop-down list. Make sure Constrain Proportions is turned on, then change the value of Scale Factor X % to 100.2 The factor by which the particles grow doesn’t need to be great. Even two-tenths of a percent increase at each frame adds up quickly.

Create a dynamic material for the particles:
The next step is to create a material that changes over time while the particles change in size.
 

9_Open the Slate Material Editor.  locate Materials/ Standard/ Standard, and drag the Standard material entry into the active View. Double-click the Standard node so you can see its parameters on the Parameter Editor panel to the right. Name the new material Smoke.

10_ Next connect a map to this material. In the Material/Map Browser panel, locate Maps/ Standard/ Particle Age, and drag the Particle Age entry into the active View.
In the active View, wire the Particle Age map output to the Standard map’s Diffuse Color input. You should have the following



 





11_Double-click the Particle Age map node to display its parameters. Change the 3 default clours to colou1=yellow, colour2=green and colour3=blue. These are arbitary     colour soley for recognicion in the age effect.
12_In the Material/Map Browser panel, scroll so you can see the Sample Slots group. Drag from the output socket of the Smoke material node (at the right), and drop it on an unused sample slot. In the Instance/Copy dialog, choose Instance, then click OK.







13_Add the new material to the particle system:
Minimize the Slate Material Editor and restore Particle View (6).
  14_ Drag a Material Dynamic operator from the depot, and drop it on Event 01 between the Force and Display operators.



 In the Material Dynamic parameters assign the smoke material. Activate the Camera01 viewport, click (Go To End), and then click (Render Production). NoteThe Particle Age effect doesn’t appear in viewports, so when you use this map, you have to render to see the result.


 

Define the life span of particles:
 
15_Restore Particle View (6). In Particle View, drag a Delete operator from the depot, and drop it on Event 01 between the Birth and Position Icon operators. In the Delete parameters, choose Remove By Particle Age and Change the value of Life Span=350 and the value of Variation=50. The Variation setting introduces a random variation in the life span of particles, so the system doesn’t appear too uniform. Render frame 300 once again.




Next stage is the all important step which is the same maps for smoke or fire using a combination of noise and gradient maps to allude to the turbulence required.
First 3 noise maps are allocated to col1,2 and 3 of the present Particle Age Map. finishing as below. That puts a noise into the red, green and blue setup earlier. FIrst one noise map and its parameters are constructed then  it is copied to col2 of the Particle Age where its parameters are altered then again its copied to col3 of Particle Age.



16_Double-click the Particle Age map node to display its parameters.  Drag a Noise map from the Browser into the Active View and Wire the Noise map to the Color 1 component of the Particle Age map. (top part above)
17_Double-click the Noise node (in an area other than the preview) so you can see its parameters. On the Noise Parameters rollout, choose Fractal as the Noise Type and change the value of Levels to 10.0 (increases the complexity of noise pattern)
18_Change the value of Noise Threshold High to 0.65 and Noise Threshold Low to 0.35.
19_Click the Color #1 color swatch. In the Color Selector, set V=29.0 (a very dark gray; the RGB values change to equal 29.0 as well), and then click OK.Click the Color #2 color swatch. In the Color Selector, set V=86.0 (a moderately dark gray), and then click OK. The smoke in its initial stages will be very dark, nearly black.
 

20_Change the value of Size to 4.0. The noise parameters dialogue box should be as such:


When you copy the map you are mimicking the aging of the particles so Vary the map as particles age:
21_Hold down the Shift key, and in the active View drag the Noise map node to create a clone of the node. Wire the second Noise map to the Color 2 component of the Particle Age map.
22_Double-click the new Noise map node to see its parameters. By the Noise color swatches, click the Swap button. (The col2 of map1=col1 of map2. So swap) and setup a new set of parameters for col2.
Double-click the new Noise map node to see its parameters.
By the Noise color swatches, click the Swap button. Also on the Noise Parameters rollout, change these settings: Noise Threshold High = 0.8 Noise Threshold Low = 0.2,  Size = 5.0. The noise map wired into node 2 of particle age should look as below



23_Hold down the Shift key and drag the second Noise node to make a clone of it. Wire the new, third noise node to the Colour 3 component of the Particle Age map. Again swap the col1 and col2 swatches.
24_ Again alter the parameters for col2. Click the Col2 color swatch. In the Colour Selector, set V=220, and then click OK. Also on the Noise Parameters rollout, change the value of Size to 4.. Again render the last frame. Should be as such:








The next step is to make the particle edges transparent, so they blend together more naturally, and don’t have sharp edges against the terrain or the sky. That is usually done via gradient maps on the opacity map.
Add an Opacity map to hide particle edges:
25_Drag a new Particle Age map from the Browser to the active View. Wire the new Particle Age map to the Opacity component of the Smoke material.




To colour1 of the New Particle Age create a Gradient Map and to the Gradient add a Noise Map to colour2 as below, showing the output of gradient going to input of col1 node on the new Particle Age.


26_In the Gradient parameters set gradient type as radial and in the noise group set to fractal and the others as seen below:

 



 the opacity pattern appears more natural, but retains the opaque center and transparent edges.
27_Drag a Noise map from the Browser to the active View, as above wire the new Noise node to the Color 2 component of the Gradient map node. Set its parameters as below



28_Drag a second wire from the same Noise map, and wire it to the Color 3 component of the Gradient map.



Decrease opacity as the particles age:
29_Click and Ctrl+click to select both the Noise map and the Gradient map, then Shift+drag to clone both nodes. Wire the new Gradient node to the Color 2 component of the Particle Age map.
30_Clone the Noise/Gradient node pair again, and wire this new combination to the Color 3 component of the Particle Age map.



the combination should look as above. Double-click the Particle Age map node (for Opacity) to see its parameters .Now all three particle ages have a Gradient map with Noise.
31_Double-click the Noise map node connected to the Gradient map that is connected to Color 2.In the Noise Parameters rollout, click the Color #2 color swatch. In the Color Selector, change V=161, and then click OK. The darker color makes particles more transparent in midlife.
32_Double-click the Noise map node connected to the Gradient map that is connected to Color 3. In the Noise Parameters rollout, click the Color #2 color swatch. In the Color Selector, change V=64, and then click OK. The new Color #2 value makes the particles even more transparent as they near the end of their life.
33_Render the last frame and it should be as follows


 -
34_ Add a shadow via the Direct01 light. Select from scene and in the modify panel turn on shadows and render last frame again


 
















No comments:

Post a Comment