Unleash your inner Jedi (or Sith) with this quick guide to creating a lightsaber in After Effects.

Image above from Star Wars: The Force Awakens

If you’ve used After Effects for any amount of time, chances are you’ve wanted to create a Star Wars effect at least once or twice. Let’s take a look at how to create your very own lightsaber in After Effects using 100% native plugins. (Subtly waves hand.) This is the tutorial you’re looking for.

Step 1: Create a Solid

Creating a Lightsaber in After Effects: Create a solid.

The first thing you need in order to create a lightsaber effect is some great footage. In this tutorial I’m using a clip from Shutterstock. Once you’ve imported your footage into a new After Effects composition, create a new white solid. The label I chose for my solid: Purple Lightsaber.

Step 2: Mask and Keyframe

Creating a Lightsaber in After Effects: Mask and keyframe.

Next, mask and keyframe the solid so that it surrounds the motion blur of the lightsaber from your reference footage. Try to keep your mask to only four points. If you use more than four, you might begin to get confused about which part is supposed to be at the base of the lightsaber and which part is supposed to be at the top of the lightsaber. By using four mask points, you can keep the exact same points at the top and bottom throughout the entire animation.

Step 3: Create an Inverted Alpha Mask

Creating a Lightsaber in After Effects: create an inverted alpha mask

Next, create a mask so your lightsaber will not cross in front of your subject if it’s actually supposed to be behind your subject. To do this, create a new solid and mask out the areas where your lightsaber should be behind your subject. Our example above is fairly easy; we’ll just have to  mask out our subject’s head.

Quick Tip: Make sure to trim your mask layer so that it doesn’t accidentally cover up your lightsaber in any other parts of your composition.

After you mask and keyframe your alpha mask, it’s time to set your track matte. Position your masking layer above your lightsaber layer and change the track matte to Alpha Inverted. This will automatically hide your masking layer in your timeline and create a hole where your subject should be.

Creating a Lightsaber in After Effects: alpha matte example

Step 4: Add Stylization Effects

Creating a Lightsaber in After Effects: final composition

Precompose both your alpha mask and your lightsaber layer. Now it’s time to add a few quick stylization effects. The two that I use every time are Fast Blur and Glow. The Fast Blur effect makes your lightsaber seem a little more organic, while the Glow effect adds color to the white layer if you’ve set the Glow Colors to A&B Colors. After you add your stylization effects, simply turn your transfer mode to Screen and adjust any of your effects as needed.

Creating a Lightsaber in After Effects: adjust effects

Here’s what our final result looks like.

Creating a Lightsaber in After Effects: results

Want to see a step-by-step tutorial about how to create this cool lightsaber effect? Check out this great tutorial by Legacy Entertainment that uses the same layer technique outlined in this blog post.

This is just one of the many different ways you can create a lightsaber in After Effects. Another popular method is to use the lightsaber preset designed by Andrew Kramer of Video Copilot. I highly recommend checking out their tutorial.