Can I apply post processing only to areas lit by a specific light source?

I’m trying to post process (saturation specifically) only the parts of the world that are lit by a light source like a flashlight or a spotlight. Is there a way to get a mask of only the light source, or get at this info is any other way to use in post processing?

Most of the information I found was dealing with custom stencils which as far as I understand apply to whole objects. Or custom depth which doesn’t seem like it helps since its applied the whole scene.

I basically want to post process only the area of the scene that is lit by a specific light source.

Any advice would be awesome, thanks!

Try color correction regions

at least is designed to focus on one area.

It is also totally possible to code a PP material to work ‘back to front’ and also only focus on one area

Deferred rendering doesn’t have individual light data that can be exploited within buffers.
You could make a mesh in the shape of the lights cone and use a custom stencil with that.
Or, you could use the world position and compare it to a manually provided light position/vector to manually recalculate the lighting in the post process based on the length and direction of that vector.