Download

UV Lamp and Hidden Text

Hi everyone. So I have a feature I would like to add in a project - a UV light that reveals text on surfaces… however I’m having trouble figuring out how to exactly implement the revealing of text when the UV lamp pans across the hidden text.

First off I was going to just attach a purple light to the light model - that’s the efficient way to go about it, and quickest. I may be thinking too much in depth, but I had the crazy theory that manipulating
the ray tracing would give me the proper fading in and out as the light pans across the the text.

Another theory was to have a masked emissive (with a gradient) and line it up somehow with the light…not exactly sure how that would be constructed haha. I would use decals to drive the text by the way.
But any who - all of your wisdom and guidance would greatly be appreciated! :slight_smile:

If you have no other source of purple light that might cause issues, you could make your text translucent and then read the SceneColor node. Then you could use the “Chroma Key Alpha” node to extract a mask based on the purple color and use that to reveal the text. The materials where this text appears may have to be fairly desaturated for this to work.

You could also just do it using a spheremask from the light position by setting that using a material instance dynamic parameter, but that method will not support shadow casting which is why I would maybe try the first one.