Combining two Node Trees (Basic)

As shown in the screencap below, I have two lightsabers and I’m using Nodes to make them glow. One is green, the other is blue.

So, I first set up the green Nodes, then just Shift+D copied them and tweaked it to make the second lightsaber blue.

However, now I can’t combine the two of them. Can anybody instruct me what to do?

http://www.pasteall.org/pic/show.php?id=30264

Combinations are (almost) always achieved through transparency (i.e. alpha over nodes) or blending (mix nodes).
In this case, an alpha-over node is needed. Add an alpha-over node to lay one image on the top of the other.

Thanks for the tip, BlenderComp. The Alpha-Over Node did work, but there was a serious problem: it applied the preceding effects to the entire image, not just the Alpha Channels (from the Pass Index) that I wanted it to.

So, I played around with things and it appears that the Lighten Node rather than the Alpha Over worked perfectly.

Thanks to BlenderComp and Chipmasque for their help (although Chipmasque had LOTS of suggestions to improve the Node tree, and I don’t think I can go through all of them).


I thought about suggesting the Add or Lighten modes for combining the last imagery, but thought that that might let the star field burn through parts of the saber(s). But if it looks good to you, that’s what counts.

A tip on using Alpha Over – you don’t have to rely on only the alpha from the input imagery. The Factor input on the Alpha Over node (and many other nodes as well) is used to modulate how the node works, so you can plug in an alpha channel or some other source there and it will determine how the imagery is masked. You can even combine masking sources and plug them in for a composited mask. Perhaps something to use next time 'round.

Dave I didn’t really look at your nodes very carefully. Chip already covered this but let me add that you could use the alpha channel of individual layers to mask anything you need (or don’t need). Manipulating the alpha channel will allow you to mask a selection (e.g. an object) to apply effects to it or its inverse to apply effects to everything but it. If fact, having used an ObjectIndex pass makes all this it even easier.

What is complicated in such a setup is the blur nodes as these extend beyond the object geometry and are kinda hard to use in alpha over nodes because of the semi-transparent pixels involved.
So, ideally, in such a setup it would be a good idea to put each item (lightsabers, text, background) on a separate render layer and use successive alpha over nodes to combine everything.

Thanks for the suggestion, guys. I’m watching some Node tutorial videos now and trying to understand Render Layers and all the rest. Most of what you’re saying is, at this point, very challenging for me (especially if it would involve drastically redoing this whole thing again!) But I’m getting it bit by bit.

David, take your time, eventually all that will make sense. As for my proposal, it doesn’t actually involve “more” work. It should take a few seconds to move each object to each own layer and set up a new noodle.