Hi, Im trying to find out if this is currently possible with shaders or at least doable.
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.
Well, for starters, you could simply switch from the standard sprite shader (which ignores lights) to the default shader (which applies lights), and then put some spotlights into your scene.
Yes it’s doable.
You could use lights, from your question you probably don’t have much shader experience so that could be the simplest if you can get the mask detail you want.
Otherwise you just need the mask texture, a way to look up in that mask texture the correct uv for your sprite.
Read the value and then do some extra math in the shader to adjust the color value.
A lot will depend on how your mask is generated and in what space it exists to get the correct uv coordinates.
is the mask fixed on screen? (camera wont move)
if fixed, then could try using screenspace texture, and add/blend that to sprite… (with custom sprite shader or maybe modifying sprite mask shader)
there is example with screenpos how it would look, see that grid: