Add Saturation to a Specific part of a Material?

Hi everyone!

I’m trying to create a material that allows me to add saturation to a part of the material when hit by a line trace. I have gotten it working where I can change the saturation of an entire material when hit, but the problem is that I would like to use a mask of sorts to “paint” the saturation back into the material when hit by a line trace. I’ve been looking at a lot of documentation and other questions around the forums and I’m not sure if this is possible, but if anyone had any insight I would really appreciate it. Here is an image (it’s terrible I know) specifically showing what I mean. As you can see, the tree is desaturated, but inside the star, it has full saturation. So that’s what I’m going for. Anyways, if anyone can help me that’d be great! Thanks.

If you want to show saturated colors only where trace hits in realtime, you could use material instance dynamic
You can pass coordinates of trace hit into the material, and use a Sphere Mask material expression.
You would then control desaturation value based on the sphere mask output.

However, if you need the player to repaint the saturation back and keep it there, things get a bit more complicated.

Use 2d Render target. You can paint saturation weight to render target with blueprints. You need unique uv’s for mesh. Lightmap uv’s are usually good choise for this.