P
Particles from the emitter up No shelf tools allowed, maybe just one :)
Ari Danesh
[email protected]
1
1
P
Why particles? Students often tell me that particles are out of date and they do not use them because simulations (pyro, fluids, smoke) are much more accurate. So why talk about particles?
Particles are very lightweight/fast Particles are very art directable Particles are fast to render
2
2
P
Why no shelf tools? Sometimes it is just as easy to setup without shelf tools Sometimes the network is just easier to read with out all the extra nodes
3
3
P
Agenda
Projects
Creating Emitters
Radial space explosion
Setting up particle systems
Looping particles
Rendering
Rain sliding down an umbrella Motion blur packed particles Particle sprite rendering Particle instance objects
4
4
P
Project 01 - Radial Space Blast
5
5
P
Creating the Emitter Create the basic shape of the explosion with Surface Operators Calculate the velocity that the particles should emit at birth Drop down a Circle Object Rename - Explosion Emitter Dive inside Make the Circle Surface Operator polygonal
Completed network
Append a Normal Surface Operator and make it a point normal
6
6
P
Making the emitter a ring As the explosion increases in distance we want to make sure the thickness of the ring stays the same Append and attribute wrangle You are going to use the fact the circle in centered around the origin to make the normals point inward Create the wrangle shown on the left Offset distance will determine thickness of ring Merge the outer and inner circles
7
7
P
Making the emitter a ring (cont.) Append a Skin Surface Operator
8
8
P
Creating the Emitter (cont.) Artist wants to have control of wobble and rotation in the explosion Append a Transform Surface Operator You have three choices for the wobble 1. Keyframe (personally, do not like to constantly update keyframes for changes) 2. Expressions (If you know basic math, piece of cake) 3. MotionFX (a.k.a CHOPs light) <—- Perfect place for CHOPs 4. In the X and Z rotation channels add a noise Motion FX
9
9
P
Finish the network with an Output SOP Append an Output Surface Operator and name it PUT_RING Highly recommend using an Output Surface Operator over a Null for end of chains Helps when you are debugging
10
10
P
You could have done this all in a particle simulation…. So why did we make this geometry? because it is so easy….
11
11
P
Particle creation Go back up to the Object Level Drop down a Geometry Object, name it Explosion_Particles Dive inside and kill the File Surface Operator Drop down an object merge, set it to /obj/Explosion_Emitter Set transform to Into this Object
This
is a
very
imp
orta
nt st ep
12
12
P
Need to calculate the velocity of the expanding ring Append a Trail Surface Operator Set result to Compute Velocity
Velocity Vector Added
13
13
P
Finally! Lets make particles Append a POPNet Dive Inside
basic POP network
14
14
P
Setting up source_first_input Set emission type to Scatter onto Surfaces
Velocity created in trail Surface Operator
15
15
P
Append a POP Force Want the particles to come into frame over a half second period Expression reads multiply the force by an ease curve from 0 to 1 as the particle’s age goes from 0 to 0.5 seconds.
@age is the current age in seconds. @life is the percentage of total lifespan Use @life when you want to access the percentage of the particle’s total lifespan. Useful for trails where you want to fade out as the particle starts to approach death.
16
16
P
Add another POP Force This time want to add some curl noise We will make curl noise be dependent on velocity
swirl scale += @v;
17
17
P
A couple of tips… When you are not sure of the name of an attribute use the pass-through menu item
When you are not sure of the names of global variables drop down a POP Vector Operator and dive inside to see the names
18
18
P
What we have so far…
19
19
P
Tame the simulation down Append a DRAG POP. Usually have to do this or your particles never loose momentum
20
20
P
Life is not all Gray Drop down a POP Color Color Type - Ramp ramp = @nage;
21
21
P
Final Particle Look
22
22
P
Rendering the particles as volumes Pop up one level. Out from the particle network and back into the Surface Operator network Append a Attribute Wrangle to the network We need to give the particles a scale to render at @pscale = 0.02;
23
23
P
Fill out the particles with a Point Replicate Append a Point Replicate to add more points around each particle emitted Add 5 points per point
24
24
P
before pop replicate
after pop replicate
25
25
P
Convert to a VDB This is a tricky step because you have to guess at numbers to get the VDB the right size Voxel Size - 0.02 Fog VDB - density Point Radius Scale - 2
26
26
P
Add a Volume Visualization Want to see the results in the Scene View? Density Field - Density Diffuse Field Cd
27
27
P
Add a shader and apply it to the object I used basic smoke
Dive into Shopnet and put down a basic smoke material Apply basic smoke to the Material tab of the object
28
28
P
Project done…
29
29
P
Project 02 - Looping Particles
30
30
P
Goal This is especially good for games I want to create a particle effect that loops seamlessly every n frames. We will do every 60 frames
31
31
P
Creating the emitter network Drop down a Geometry Object - name it Particle Emitter Dive inside Delete the File Surface Operator Drop down grid Size 0.2/0.2 <— It does not matter Rows/Cols 10/10 <— It does not matter Append a Scatter Surface Operator <— Here is where the magic will start Drop down a Output Surface Operator - name it OUT_LOOP_EMITTER
32
32
P
Setting the scatter Go back and select the scatter Set the Force Total Count - I chose 10 The defining parameter is Global Seed Use an expression such as: ($F-1)%60 to repeat every 60 frames or
Relax iterations does not matter
($F-1)%120 to repeat every 120 frames
33
33
P
Frame 10
Frame 20
Frame 30
Looping with ($F-1)%10
34
34
P
Time to generate particles Pop back up to the Object level Drop down a Geometry Object - Name it Looping_Particles Dive inside and kill the File Surface Operator Add an Object Merge Object1 ../../Particle_Emitter Transform - Into This Object Append a POPNET Append an Output Surface Operator - Name it OUT_LOOPING_PARTICLES
35
35
P
Creating the Particle network - Source Tab Dive inside the POPNet Select the POP Source Emission Type - All Points (Look at the Birth Tab and See what happened)
Overall network we will build
Geometry - Use First Context
36
36
P
Birth Tab Notice fields deactivated
Jitter Birth Time - This is the most parameter to set. If Jitter is activated you can not have looping particles Life variance must be set to zero
37
37
P
Particles so far….
38
38
P
Adding some noise to the motion We want to add some interest to the particle stream by adding noise to the force Unfortunately we can not use a POP Force because curl noise is not periodic
We have to create our own noise POP Vector Operator to the rescue
39
39
P
POP VOP Drop a POP Vector Operator down Dive inside We will use periodic noise…
40
40
P
Periodic Noise
41
41
P
Periodic Noise
The periodicity is equal to: Number of frames to repeat over/$FPS
42
42
P
By definition periodic noise generates noise in the range of 0 to 1 Variance is usually bot positive and negative numbers We will fit 0 to 1 to a range of -1 to 1 so the particles will move in all directions
43
43
P
Now all that is left to do is add the noise back into Force
44
44
P
Frame 60
Frame 120
Frame 180
60/$FPS
45
45
P
Project 03 - Rain and an Umbrella
46
46
P
This time we will go much faster since you know what you are doing… We need a: Umbrella collider Ground collider Rain Emitter Rain Particle Generator
47
47
P
Umbrella Collider Make sure to fuse the points Make sure to extrude tho give the umbrella some thickness for collision detection
Remember - You do not have to use this geometry for rendering. Just collision detection
48
48
P
Ground Collider Remember to put the Output Node in. Functionally it does not add any geometry but it helps if you add nodes upstream
49
49
P
Rain emitter One small grid over the umbrella to test sliding One large grid to test everything
50
50
P
Now to the meat… Rain Particle Generator
Overall Network
51
51
P
Object merge rain emitter
Append a Point Surface Operator to generate velocity and pscale
Object merge umbrella collider Velocity pointing downward
52
52
P
Creating the POPNet
53
53
P
POPNet Overview
54
54
P
Source First Input
55
55
P
POP Collision Behavior
Set the default behavior of collisions to Slide
56
56
P
POP Collision Detect
Detect collisions with the umbrella If a collision is detected set the response to slide and change its color to red
57
57
P
POP Collision Detect #2
Set the Group name to just_hit If a collision is detected set the response to dir and change its color to blue
58
58
P
If a particle hit the ground… kill the particle and replicate it many time with a velocity scalar of -1 This will make it bounce of the ground and spawn many particles where only one has dropped
59
59
P
Particle Replicate kill the particle and replicate it many time with a velocity scalar of -1 This will make it bounce of the ground and spawn many particles where only one has dropped
Key parameter set to -1 to reverse velocity
60
60
P
Project 04 - Motion blur - packed particles
61
61
P
Simplest Network Yet Emitter and Particle system in same network Just going to use a sphere as an emitter and then in the popnet add curl noise and some drag so we have something to blur
62
62
P
63
Packing the geometry and saving to disk Append a Pack Surface Operator <— All that needs to be done to pack Append a ROP Output Driver to dave to disk
If you want save some meta data in a detail attribute Append a Attribute Wrangle pack Run Over Detail
63
P
Use a File Cache to save to disk Write First, read back later
64
64
P
Blurring the particles Go back up to the Object level In the Geometry tab goto to the Sampling tab turn on Geometry Velocity Blur Drop down a Mantra node in the Out context Go to the rendering tab and turn on - Allow Motion Blur Increase the samples to Geo Time Samples to something greater then 5
Render!
65
65
P
66
66
P
Project 05 - Particle Sprite Rendering
67
67
P
Making a film strip in Compositing Operators
-7
Drop down a COPNet Dive inside
e ak
M
Drop down a File Compositing Operator Set the parameter for file - butterfly$F.pic Houdini will load all 7 butterfly images
68
s
ou y e ur
on e ar
fra
1 e m
68
P
Make a Mosaic (filmstrip) Append a Mosaic Compositing Operator
Images per line 7 Check the results
69
69
P
POPNet The Emitter is the same as the last project Dive into the POPNet
70
70
P
Crack open the POP Sprite HDA Notice there is a shop net built right into the Houdini Digital Asset We will use its material to at the object level to render the particle system
Sprite fog material inside shopnet1
71
71
P
Assign a material at the object level What material to assign? The Sprite Surface Operator and the POP Sprite have materials built in Access one of them
72
72
P
73
73
P
Project 06 - Point Instance Rendering
74
74
P
The layout
The magic happens here
75
75
P
Source Particle Network Overview
76
76
P
Here is a nice little trick to point instance particles First, I did use the particle shelf tool for this <— I was lazy Now, all the magic happens in the source particles object Remember the source particles takes the Dynamic Operators simulation back into geometry To do that is uses a Dynamics Operator I/O node
77
77
P
Creating an instance path Dive into the Source Particles Append a Attribute Wrangle to the DOP I/O operator Run over points and set the instance path s@instancepath = “op:/obj/Pighead”;
You can do a scale for good measure
78
78
P
The Instance Surface Operator Tada! That’s all there is to it…
79
79
P
End of particle webinar
80
80