Frame that is behind the head but in front of body?


I’m kind of stuck and I wonder if anyone could point me in the right direction?

I’m looking to create an effect similar to the Instagram Neon Frame filter:

But I can’t figure out how they managed to get what seems like person segmentation at the head level, but the frame is still in front of the body. I had some success by playing with a gradient that reacts to the user’s face position, but it’s not as smooth as this.

Does anyone have an idea?

Thank you so much!

I’d imagine that they divided it in half honestly, bottom half that’s in front and alphas the segmentation and the top part which is behind

Yeah, that’s what I thought as well but after trying it in a few ways it looks like it’s not that simple! :sweat_smile: Or I’m not doing the right way?

Set it up on my end and got it working more or less as I expected :

You could probably finetune the alpha to control where you want the cutoff to be, but I didn’t have to play with advanced render options or anything, just layering them correctly

1 Like

Thank you so much for taking the time to try it out! Such an elegant solution and it gets pretty close!

My main issue was that I didn’t want a cutoff point so that if the face reaches the lower half it still appears in front of the frame.

I managed to get the effect I wanted by combining the segmentation mask with an SDF ellipse tracked to the forehead, while adjusting its size based on camera distance.

1 Like

aaah ok I see what you mean. Your approach seems to be what I’d go for as well in that scenario. Glad you got it working :smiley:

1 Like

Hi Boris! I just saw this example you made and I was trying to make exactly what you did, but no success so far. Been trying to replicate your layers and patch editor, but I didn’t manage to make it work. Any way you could provide me some guidance? Any help would be much appreciated :raised_hands:

Hey, sorry for the late answer!

Opening it again it seems like they changed something in the way the alpha works, the top part remains much more visible than before… It still works though, but would require more time spent on finetuning.

Here’s my file for reference :
20 11 Neon (457.2 KB)

1 Like

I’m guessing it’s the difference between regular alpha and pre-multiplied alpha. You can change between those and maybe it will make a difference. Pre-multiplied is more accurate for color mixing, but in the end it just depends on the look you’re going for.