Local Desaturation

For a school project we are creating a game in Unreal 4 but we ran into a problem.

Our game revolves a lot around (movable) light which are save places. In order to clearly show that we want the materials within the light to have a high saturation and everything outside the lights to be desaturation and in the dark (similar to a fog of war) but can’t seem to make it work.

We tried various of things such as:

  • Post Process Effects (which doesn’t
    work as everything will be
    disaturated),
  • Dynamic materials (which doesn’t work
    as within every material the colour
    needs to be desaturated and this also
    means that in order to get a “bleed”
    effect from saturated to desaturated
    looks weird as well as having to make the ground and such in chunks)
  • We also look at multiple fogs of war but using that would over scope our project

The best thing would be for us to be able to create masks or the likes that we can attach to lights.
Location Based Opacity (- YouTube) seems to be a nice solution but we can’t figure out how to link it to saturation or a fog of war effect.

So my question if someone knows a solution which would work best in this kind of situation. (We are able to work in both C++ as well as Blueprint.)

Any help would be much appreciated.

What might work best is set up some spheres and render them onto the custom depth buffer (renderable components and actors have a “render custom depth” option).

You can then sample that custom depth in the post process chain using a blendable and desaturate based on what you throw into that custom depth buffer.

Basically, using custom depth is a way to get the mask you want to create. What you put in that mask and how you use it is up to you.

1 Like

Thank you, would this also work with multiple lights (which I was forgot to mention)

This would work with pretty much any number of things you send to the custom depth buffer.

Thank you very much