How do you make a material that only reacts to a certain color of light source?!

Hi, tried a bunch of options and can’t find a way to implement the idea.
Let’s imagine that we have a light source (SpotLight) which has the color red. I would like to understand how to implement a material that would glow only when this material gets red light, and on other colors of the light source material would not react and remain transparent! I tried to make such a decal, but I haven’t been able to do it for a few days now (

Might that be a better thing to implement via blueprint? Doing a few raycasts and grabbing a light source color value and then having it call a material change might work better than rewriting some shader logic. Otherwise, you’d need a way to have the material specifically understand which color of light it’s receiving and non-uniformly change opacity, which could get quite interesting.

Could you show how this could be implemented with logic in Blueprint? Maybe that would be a really good solution.

I wouldn’t know how to implement it off the top of my head, unfortunately. The content examples have plenty of blueprints that do similar things, as what you’re talking about is pretty simple conceptually- the questions that I see is how you would handle transitions between the glowing and the transparent area, and how exactly you’d like it to be shaded.

Unfortunately, the physically based rendering in Unreal doesn’t have good support for this.
The challenge is that you want “transparent” other than the red channel. Unreal doesn’t have per-channel transparency.

I was thinking you might be able to do something with an Additive deferred decal, but that doesn’t work, either (decals can’t be Additive.)

I’m assuming you want something like a “UV fluorescence” or “blood finding light” type effect. To do that, I think I’d try maybe rendering the object using a custom depth/stencil map, maybe offscreen, and then composite the fluorescence into the scene.