- Home /
Shader for revealing an object when lit
Hello, I am currently trying to create a shader which makes an object visible only when it is directly lit by a spotlight or other light source.
I have done a fair bit of looking around and the solutions I find seem to be reveal shaders that only take into account the position of the player, or a sphere/cone object. What I am looking to do is actually use the lighting data (including any shadows cast on the object) to determine whether it is visible or not.
I mainly just would like to know whether this is actually feasible, and if so a rough idea of how I might go about it would be very appreciated.
Many thanks.
Your answer
![](https://koobas.hobune.stream/wayback/20220612230926im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Advanced Shader Help 0 Answers
Receiving Shadows On a Tranparent Shader 1 Answer
Point Lights only displaying in editor on custom shader 0 Answers