lens flare - renderlayer

I’m wanting to add a lens flare to a composite i’m working on. The lens flare is made from a one-vert mesh with a halo texture. It has it’s own designated renderlayer with nothing else on it.

Problem is I need this to disappear behind other objects on another layer. That’s what i’m struggling with. I would just add that layer to the renderlayer, but then i run into a problem in the composite: I’m using an “add” node to add the flare-layer to the rest. If it has any of that ALPHA from these objects in it, then it just adds their value ontop…

I hope that made sense for someone. Any suggestions?

ALSO: I thought about taking the ALPHA of the objects and using an ALPHA overnode for masking the flare… but then that wouldn’t be realistic, because flares don’t act like that. How is this typically done?

could you not add duplicate objects to your flare layer, but give these objects a material that does not render? If I understand this correctly, you want to have the flare react to the objects, but the objects no to be rendered.

Do lens flares in Gimp…SOOOOOO EASY!!!

Of course, unless you want to animate your lens flare or objects in front of your lens flare. :wink:

I don’t think halos are properly integrated into the new render pipeline/compositor yet. In a render without the use of renderlayers, halo-based lens flares hide automatically behind objects.

Another option is just to use a time-node to fade in/out your flare ‘manually’ when the object goes in front of your flare source.

it’s a little trick, but doable using the Z buffer of the halo object. Use the Zcombine between the halo renderlayer and the other stuff. I’ve never done it, so worst case is you will have to create another layer that functions as a mask, and that layer has circles on it that mimic the halo but which have substance; using the Zvalues from that layer and the image from the halo layer, to composite via the Zcombine, with the rest of the stuff.

Cool I’ll give that a shot.

Usually this is done with a mask layer. Granted, I use a seperate post program to do it, but I’ve seen some old tips around here how to light and render a mask layer.

True, but it’s much more involved than simply masking it with the foreground objects. For example, in some situations, some flares will overlap objects while further flares won’t. Which is what’s throwing me off on how to do it.