Download

Trying to make an ultraviolet lamp-like material

Trying to make a material, where lit part is rendering normally, and unlit part looks transparent.

Just like an ultraviolet lamp, the character is holding a special colored spotlight (means a flashlight) and there’s some clue on model that could only lit by this light.

So my problem is, how to get the lighting info in material system? Or I have to modify the shading model? Or is there some other ways to get what I desired?

This is just off the top of my head, but I think you could use a sphere mask tied to the world coordinates of your light to control the opacity on the material.

Check out this stream to get the idea: https://www.youtube.com/watch?v=GXbE0IqbA7w

The main problem with that is I don’t know how you’d get cast shadows to mask out the areas that they’re being cast on.

Thanks a lot, have implemented it with sphere mask + decal material :wink: Really helpful!:smiley:
I don’t need to mask out the shadow areas because the area lit by spotlight is certainly bright.