Desaturate effect in shadow of certain lights

I want to create an effect where everything that’s in the shadow of a moving light gets desaturated or maybe some other effect. I’m no graphics/ue4 expert so I’m not sure on how to achieve it:



I guess either:

  1. Add a “normal” light and somehow change how it affects the pixels in the dark.
  2. Do tons of line traces and create a texture based on the results (similar to the fog of war tutorial posted on these forums) and use that in a custom post-process step.
  3. Render the black objects to a texture, do collision checks on the 2d grid and use that in a post-process step.

Any other ideas or how to actually do this?

You could maybe also use a post-process material which acts kind of like a bright-pass filter (there’s algorithms around the internet), then invert it to instead mark pixels that are dim, and then use some trickery to desaturate those pixels. I presume you’re not using GI or a sky light, so those pixels are pitch black. You could instead read off the scene’s diffuse texture (which is unlit) and desaturate that texture, then wire that into the emissive material input.

Or, you can just convert the scene to greyscale, then use a lerp node to lerp between the scene texture and the scene’s diffuse texture (which has been desaturated) subtracting from the diffuse texture to darken it a bit. I used this method to make a fake night-vision-esque effect for a project I was working on, turned out pretty well I’d say.