I believe what you want to do is change:

vec4 result = vec4(imageColor.rgb * scaleFactor, imageColor.a);

to:

if disparity < cutoff { vec4 result = vec4(imageColor.rgb, 0); }

where cutoff is the disparity(depth) that you want to stop showing.

I've been working with AVDepthData, but am not experienced with filters.

Hope that helps!