Post-processing Lightsabers in Blender I've been studying JamesVillanueva's lightsabers for a while now, and have tried to recreate the effects in Blender.  The trouble I'm having is with the blade in the compositor.  Keep in mind that I'm also trying to animate it.


First off, this is the lightsaber I've created with help from Williamson's lightsaber tutorial.  Obviously the color of the glow needs a little more work to be accurate, but that's not what I'm worrying about at the moment.  This is also rendered in Blender Internal, but I'm going to switch to Cycles when I got everything prepared.  The blade model is totally transparent, but its index is fed into the ID mask node.

I'm using two versions of Blender's Gaussian glow.  The glow it creates is, unfortunately, omnidirectional.  This is different than the glows Villanueva puts on his, where the white core continues into the saber emitter.  Also, unlike his, my glow flows over and obscures part of the emitter.  This also means that if prongs were placed on the emitter and closer to the camera than the blade, the glow would engulf them.  What I'm looking for is something like this:


(source: James Villanua)  

Where the parts of the model that are closer aren't affected by the glow, while those that are farther are.

Second, I'm trying to improve on Villanueva's method by having the glow applied to the reflection as well.  A method to have the glow applied to the blade if it's covered partly by glass would be nice, too.

Anyway, help is appreciated for any of these questions.  If there is a different way of going about this and getting the glow, like with Cycles materials, I'd be happy to know.
Here is what I came up with:

Adding a glow without affecting close parts of the handle:


The handle mesh is on scene layer 6
The  blade and other objects are on scene layer 1





Create a material for the blade:


Enable Transparent in Render settings > Film:


Create two renderlayers, one for the handle and one for the blade:

 

By setting the handle layer to be masked by the blade, we get the glow to be added behind the nearer parts of the handle.
Enable the Object index pass for the blade renderlayer, and set the Pass index of the blade to 1 in Properties > Object > Relations.
Composite nodes: (click for full size)




Result:



Reflections and refractions:

Technique one:

Without and with reflections and refractions blurred: (click for full size)

 

Limitations:


Reflections of reflections of the blade will not have glow applied. (likewise for refractions)
The glow on reflections and refractions will be applied on top of reflections/refractions of the handle.


Here is a Blendfile for you to inspect.

Technique two:


All objects except for the handle and the blade are visible on layer one
Refractive or reflective objects are visible on layer 7 as well as layer 1
Objects that are not refractive or reflective are visible on layer 3 as well as layer 1
The blade is on layer 2
The handle is on layer 6





Enable Transparent in Render settings > Film:


Create four renderlayers: (click for full size)

 

 
Composite nodes: (click for full size)




Here is a blend for technique two

Advantages:


Applies glow to inter reflections/refractions


Limitations:


Materials that are both reflective/refractive and something else (e.g. diffuse) will be blurred. The only way to really solve this with compositing is to put each partially diffuse/reflective object on its own renderlayer.



You could fix this particular example by adding separate materials for the glossy/diffuse aspects of the shader and separating with the Material index pass.
The glow on reflections and refractions will be applied on top of reflections/refractions of the handle.



You could fix this by adding another renderlayer, but this will use up more render time and it may not be worth it for such a small detail.