Determining if a world position is visible in a Post Process Material

I am trying to create a post process material and I have come across a problem which I cannot seem to solve on my own:

I have a mask created following this tutorial: http://oliverm-h.blogspot.de/2014/08/ue4-localized-post-process-effects.html

I am using setup #1 under the box section. However, when the bounds specified by “BoxCenter” and “HalfBoxSize” overlap something (that hides a section of the box), it still includes the hidden part in the white part of the mask.

How do I expand on that technique so that only visible areas are included and ares that are not are just black?

Thanks in advance!

PS: My material is EXACTLY identical to the one shown in the article!

Hi Zach -

We actually have made this functionality a little easier for you. In 4.9, there are now Box Masks. So, if you setup your Post Process Material like this:

You can end up with the effect you are after, like this:

Thank You

Eric Ketchum

Thanks so much! I will try it out in a half an hour or so, when I get home!

You are a life-saver Eric! It works like a charm now!

Zack