Creating a blacklight (invisible ink) material

I’ve been messing with making physically accurate blacklight neons and fluorescent materials. I got the hang of it for the most part with a few simple node tricks, may post them on Blendswap sometime later. There is however one thing I can’t figure out how to do, I’m actually assuming it’s impossible, but just in case I wanted to ask here how I could even hope to achieve it.

So you know how in real life there exists a thing called invisible ink. It’s a substance that normally can’t be seen but will show up if you shine a UV lamp on it.

I was thinking how to do something similar in Blender. Essentially I want a hidden material or (even better) a texture on a material, which becomes visible and blends over the surface based on the color and amount of light it receives. Thus when a normal light shines on the surface it will not show up… it will once within radius of a light source matching a pure blue color.

The part I’m stuck at is finding a way to extract the light hitting a surface from within its material nodes: You can’t even identify the intensity let alone color! I tried all options in the Light Path node but those are for other things and can’t be accurately used to extract the light received by a material. Does at least Cycles offer a way to properly detect incoming lighting and use it as a texture mask?

I found this on Google: How do I create a material that is only visible under one specific light? - Blender Stack Exchange

This is my Eevee solution: EeveeInvisibleInk.blend (796.1 KB)

The invisible red will appear when you decrease blue and/or green, or increase red of the light.

I asked this very question a while back. I don’t think t here is a way to do it currently “out of the box”.

The reply I got was that ‘light linking’ may be the solution, but cycles doesn’t currently have that.

This should work in both Cycles and Eevee: InvisibleInk.blend (839.2 KB)

SecretColor = TriggerColor
offset = DetectRange
BaseColor = PaperColor

Adjust the light color to see the ink

With any light color outside of the DetectRange, the ink is not visible:

Of course there is transition, the closer the light color to the TriggerColor, the more visible the ink is, and vice versa.

Thanks! Shows that no matter how complex a problem Blender always finds a way around it :slight_smile:

Out of all methods I prefer this one the most. Simplest and with the fewest nodes, implemented in a smart and controllable way which does exactly what I wanted: You use a plain diffuse material to extract the light received then operate based on that. The existence of the “Shader to RGB” node slipped my attention… now that I see how it’s used the pieces fall into place!

Only issue I’m seeing with it is that it works in Eevee but not in Cycles. Quite ironic considering material issues are almost always the other way around :smile: I’m going to try my own implementation using this idea and see how I can fix that.

Edit: I can see why it only works in Eevee. For some reason the Shader to RGB node wasn’t implemented into Cycles yet. So in Cycles there’s still no way to extract the light being received in order to use it as a color… that’s where the main blocker is in doing this right.

Have you checked the other file I uploaded? It works for both Eevee and Cycles.

Yes. I noticed it uses a far more complex setup which also requires drivers: If nothing else works I might try something inspired by it in the end.

[lehuan5062]

to work the light color should not be at 1
or won’t work

but it is an interesting way to show some color band!

happy bl

For reference: Here are two Blender Stackexchange threads I used for inspiration in making a physically accurate blacklight neon. They are quite handy!

https://blender.stackexchange.com/questions/166425/blacklight-cfl-bulb-effect
https://blender.stackexchange.com/questions/131968/ultraviolet-light-material

I already have the blacklight neon shader for Cycles (Eevee too for irradiance probe). That’s very easy to do: Give it a your desired emission shader with a blue color, then use the “Is Diffuse Ray” filter to further amplify the emission, allowing the neon to shine more light on surfaces without also appearing brighter when viewed directly.

I also made fluorescent materials that will glow more than normal. The trick is even simpler: Just use a Glossy BSDF with a color intensity above 1 (eg: RGB 8,0,0) then use Add Shader to blend it over the normal surface! This will cause whatever is reflected to be amplified, similarly to some road signs which will glare in the dark when in contact with your car’s headlights for instance. Since it can’t distinguish between light sources, this will make the sign easily glow (as if emissive) in contact even with a little environment light… when used lightly it gives off a good balance still.

1 Like

It should work at 1 if the paper color is not white. We can also try to trigger more glossy (or other visual properties) from the logic group to make the ink stands out if the paper is white.

Thanks for the links. If you have any solution, please share it here!