Thursday 15 April 2010

Lightsaber Effects

Being a Star Wars fan, one of the first thing I looked at doing when I started editing video was to create some lightsaber effects.

I trawled the internet for some examples and tutorials and found this excellent one from videocopilot.net. I tried it out on a simple animation I was working on at the time and was very impressed. Having got it out of my system, I left well alone and got on with other, more serious, bits of work.

While putting together the DVD for the latest show by my drama group, the Appleton Players, I took the opportunity to recycle some footage of a rehearsal of a sword fight and add the lightsaber effects for the amusement of all.

The clip I used was only just over 30 seconds long, but there was no way I was going to manually track both ends of two swords for the 900+ frames, so I decided to make things a little easier with motion tracking and expressions in after effects.

I followed the tutorial to set up the lightsabers and get the look that I liked, then I set about creating 4 trackers, one to track the tip and base of each sword. This was the time consuming bit. While the motion tracking tool in After Effects is OK, when you have fast moving items or light coloured items against a light coloured background, it has some difficulty. These swords were both fast moving and light against light (sigh). So, after many hours of correcting the motion tracking, I had my points plotted. By using expressions similar to the following I set the start and end position of each of the lightsabers to use these tracked points.

comp("mycomp").layer("clip.m2t").motionTracker("Tracker 1")("Track Point 1").attachPoint


With these expressions plugged in, my effects followed the action in the clip as expected. Unfortunately, I had to manually mask out items as they passed in front of the lightsabers, as shown in the tutorial, however I am hopeful that the new Roto Brush in CS5 will automate this too.


So I have my video, but a lightsaber just isn't right without that sound. So I went trawling again. I found a number of samples of lightsabers (and I already have some myself), but I was after a "clean" sound so that I can modify it as required. Eventually I found this site describing how to create you own sounds in a similar way to the way Ben Burtt did for the original film. While this is a bit too technical and long winded for what I was after, there was a download of a premixed lightsaber hum, so I grabbed that instead.


As I was using two lightsabers, I pitched one up slightly (the green one) and both slowed and pitched down the other (red), so that each had a unique sound.


The final part was to adjust the volume of the lightsaber as the sword was moved on screen so that the faster the blade is moved, the louder the buzz.


After some experimentation and research I created the following expression for the audio level of the lightsaber.


// Use the combined speed of both the tip and base of the lightsaber
totalSpeed = thisComp.layer("Green Saber").effect("Saber_Controls")("Start Position").speed + thisComp.layer("Green Saber").effect("Saber_Controls")("End Position").speed;
// Convert the speed to a volume, maximum volume of 2.5dB
vol = Math.min(totalSpeed * 0.05 - 12, 2.5);
// return the volume for left and right channels
[vol,vol]


My short clip, "Darth Mo", was finally complete.



No comments: