Having Lighting Affect Alpha / Transparency

Hello, I’m fairly new to ShaderLab and shaders in general so I’m not sure if what I want to do is even possible. The effect I want to achieve is to have a mostly opaque overlay on top of the screen and have a spot light shine on it, but instead of affecting the RGB of the object I want the light to change the alpha based on the luminosity (not just cut out, but create a gradiented effect). I’ve tried playing around with Strumpy based on the RimLight example but haven’t had any success so far.

Does anyone know if this is possible and if so how to go about making it? Any help is greatly appreciated!

i am not sure if i catch what you try to archieve. For me it sounds like you want to make an vignette effect like that

So combining the vignette effect with an bloom shader(get the brightest parts of the image) and blur the result might give you the result you want to archieve.

Attached is a reference of the effect I’m trying to achieve. Basically I want to create an area around the player and other light sources that will cut through the overlay. I tried achieving this through alpha masks but I was not able to get the cutout to look smooth (adding a gradiented overlay on top of the cutout created some pixelation around the border) so I thought this might be a better approach. The effect is similar to a vignette but I want it to have a much smaller area of effect than just the corners of the screen.

Also it’s worth mentioning that the game is in 2D and I am targeting iOS. I don’t know much about the limitations of the iOS graphics but I would think bloom shaders would be rather expensive.