I'm fairly new to using the compositor and I have this issues with having 2 renderlayers, one for the glare of the reflections. and one for the glare coming from the lights as some sort of glow basically.

now since those lights will sometimes be behind certain meshes and such, they shouldn't show through. how can I resolve this with still keeping the glare from the lights. but those little LEDS masked off by the mesh

as you can see, the practice file works great

but when I take the same steps in the actual model file I end up with this where the glare is not showing at all:

or this, this happens when I change the pass index to 1 in the ID mask node

would really love to hear what I can do next to resolve this. thanks in advance for your help!

I think you are looking for the ID Mask node. For an example, I set up a simple scene with one object inside of the other.

If you go to the Render Layers tab and check the box next to the material index pass, it will now add a pass for all of the different material indexes.

Next, you have to set the indexes of your materials. In the materials tab, go to the bottom of the material that you want to set the pass index of. In the very bottom, under settings, there is a setting that says Pass Index. You can set that to whatever number you want to use for that material. The default for the background is 0, so I set my material pass indexes to 1 and 2.

After Rendering, open the compositor and get an ID Mask node. Plug the IndexMA output from the Render Layers node into the input of the ID Mask node. Then you can connect the Alpha output of the ID Mask node into the input of a viewer node to see the result. You can then change the index value of the ID Mask node to whatever index you set your material indexes to.

You can then use the ID Mask node for what it says it is, a mask.

• Thank you for you information, I tried recreating the scene you made to practice with and I did get the result that I wanted. but when I did the exact same on the car model it still did some weird things I can't seem to post any pictures in this comment but I'll clarify myself down here somewhere. here's what I found " – Jeroen Van de Water Sep 4 '18 at 12:26
• Could you post the .blend file that you are working in? I could take a look at it later – Ben Sep 4 '18 at 12:31
• Sure @Ben, where can I drop it for you? – Jeroen Van de Water Sep 4 '18 at 12:35
• Put it in the post blender.meta.stackexchange.com/questions/658/… – Ben Sep 4 '18 at 13:34
• It's fixed now, I forgot to make the lens in front of the leds passable as well, you can't see the individual bulbs and the lining on the lens right now. but that's for another day, thank you all so much for your help! – Jeroen Van de Water Sep 4 '18 at 13:50