Glare node, why is the glare in front of other objects? I am setting up a node tree in the Compositor for some post-production effects. I have the earth on one render layer and a UV sphere with stars and a Sun Object (emitting light) on another render layer. Now I have this effect when muting this Glare Node. The ID mask is for this Sun object.



This looks allright to me. But when the Glare Node is activated then this horizontal glare beam looks like before instead behind the earth. 



I am quite sure the sun object is behind the earth (seen from the camera position). What is going wrong here ?
Nothing is wrong, that's how glare works.

In real life, lens glare (or flare) is an effect produced by a camera or your eyes when looking at a very bright spot.  It is caused by internal reflections and defects within the lens.


Image by cmwphotography.

Those streaks are not physical things in 3-dimensional space emitting light, they are introduced by the camera, so they can't appear behind anything, they are introduced onto the image within the lens.