Does this shader exist? A depth -mask like shader?

Hi, Im trying to find out how I can go about doing this.

Ill try and explain as simple as I can. I basically want to have a moving 2d sprite or image where the brightness of individual pixels are decided by a mask or black and white image thats not visible to the screen.

So to further explain, if the mask is full screen half white half black, and I then have the moving image in the white, as I move it over to the black all the pixels that are over the black part of the mask will be brighter.

Thanks

is this what you want?