Hello, i need to show a texture on a wall only when the torchlight is on and lighting a particular part of this wall, plus the torchlight, which will be a spotlight, must emit a uv light, greenish, with uv effect, how can i do it?
Decals are often used for what you’re describing, at least for showing a projection on a wall. You can look on the asset store for decal assets if you’re using the built-in renderer, or you can used the decals present in HDRP if you happen to be using HDRP.
You’ll need to define what a “uv” effect means in the context of your game, but I assume that means some stuff becomes visible that wasn’t previously visible? There are various ways to accomplish that. A simple one would be to fake it, such that you just determine whether the hidden object is within a cone volume in front of the light, and if so, enable its renderer, otherwise keep the renderer disabled. A more complex approach would be to customize the shader for that renderer such that you pass in the light’s volume and only illuminate those pixels within the cone. I’d probably use the latter, where you’d just determine whether the pixel being drawn is inside the volume of the light. Then you’d get a nice effect where each pixel shines only if the light is actually on it.
Thank you, i meant a ultraviolet, but i’ve found a tutorial on custom shader which help me to gain the desided effect, just had to look for reveal light shader