Height based material blend

Hi guys, I’m just wondering if its possible to blend or fade a material based on the height of the map?

so I have a caustics light function material for an underwater level, and i want this to fade out in the deeper ares of the map, where the light wouldnt reach, and be stronger in the shallower areas. I’m not sure how to go about this, I’ve tried a few things i thought might work, but to no avail :frowning:

possibly using the level heightmap as a mask? if so, how would i go about doing this?

thanks in advance guys, Josh

nobody have any clues? :frowning: