Creating Custom Particle Effects Using Alphas In Nuke

Spawning particles using alpha masks in order to create bespoke effects…

Creating Custom Particle Effects Using Alphas In Nuke

Spawning particles using alpha masks in order to create bespoke effects… 

Controlling The Emission Rate

There is a great feature in the ParticleEmitter node’s settings which many people don’t know about, or use very often. 

It’s the rate channel knob, which lets you constrain the emission rate of the particles by using a mask. For example, by using the alpha channel that flows into the emit input of the node. 

💡
Where the alpha mask is white (value of 1), particles will spawn from the respective part of the geometry. Where the alpha mask is black (value of 0), no particles will spawn from the geometry. And where the alpha mask is grey (value between 0 and 1), there will be a proportionally reduced emission rate. 

You can for instance project an alpha mask onto a Card or other geometry, and use that mask to limit the parts of the surface from which the particles will spawn from that geometry. 

This can be used to create all sorts of interesting effects. 

Most obviously, perhaps, to spawn particles in a specific shape or pattern:

Using input alpha masks to constrain particles to spawn in specific shapes. 

This is useful for when you need to constrain the particles so that they only spawn from very specific areas, such as vents, grills, or exhaust pipes. 

And, it can be used to shape the flow of the particles into a specific formation. Like a tube of particles shooting towards the camera, for example; emitted from a ring shaped alpha, like in the first example above. 

However, the technique becomes even more interesting when you start to animate the alpha mask that’s constraining the particle emission. 

Let’s say that you wanted to create a trail of magic dust from a wand being waved, for example. 

You could draw the exact path that you want the magic dust to follow using a RotoPaint brush stroke, and then animate the write on start and write on end knobs in the Stroke tab to create an alpha shape that moves along the path, spawning particles. 

💡
See Animating Paint Strokes In Nuke for more information on how to animate paint strokes. 

Here’s a pretty crude example that should give you a good idea: 

The effect above was created simply by spawning particles using this alpha mask: 

To create the mask, I first drew a spiral shape in a single brush stroke. You don’t have to get it perfect, because as described in the article linked above, you can go in and adjust and/or delete points on the spline of the brush stroke afterwards. 

Here, I deleted a bunch of points and smoothed out the rest to get roughly the shape I wanted:

The spline of the spiral brush stroke. 

Then, I animated the write on start and write on end knobs from 0 to 1 to get a shape moving along the spline. I also animated the brush size to go from a relatively thin brush at the start to a thicker one at the end – spawning particles in a wider area as the effect progresses. 

💡
Make sure to set the Lifetime of the brush stroke to All frames when you animate the brush stroke settings. 

Animating the write on start, write on end, and brush size knobs. 

For the write on end knob, I simply animated it from 0 to 1 over the course of the shot. 

In order to have the tail follow the head of the animated shape, I used this expression in the write on start knob – which kept it 20% of the stroke length behind the head throughout the shot:

Expression for keeping the tail 20% of the stroke length behind the head. 

clamp(RotoPaint1.curves.Brush1.writeon_end-0.2)

(You could just manually animate the write on start knob as well).

Then, I put the resulting alpha mask on a Card, and used it to spawn some particles (just basic Spheres): 

The particle setup. 

💡
The Multiply node is just animating the alpha channel to 0 at the end of the shot, to stop any more particles from spawning. 

In the ParticleEmitter settings, notice that the rate channel knob is enabled and set to rgba.alpha:

The settings of the ParticleEmitter node. 

💡
The Card should have a high density of polygons/vertices to spawn particles from, to ensure an even spread within the alpha mask. To even out the density of the particles spawning (and fill out the area of the mask), I increased the rows/columns of the Card to 100/100. 

By animating the alpha channel, you open up a ton of opportunities to create different effects. 

Anything from magic, glitter, or fireworks, to rocks or debris shooting up from a fissure (e.g. when a superhero smashes the ground). 

– You can control precisely which path the particles should take. 

💡
You could even use particles as a reveal ‘mask’, and control the reveal by animating the alpha mask.

I hope you found this tutorial useful. For more Nuke tips & tricks, see Nuke.