1
$\begingroup$

I want to make something that has a black glossy shader when a light hits it, e.g. the sun, but when no light hits it at all it turns into an emission shader. I can't figure out how to actually do this, I've tried using the Light Ray inputs but it didn't work.

$\endgroup$

marked as duplicate by Duarte Farrajota Ramos, JtheNinja, aliasguru, Mzidare, VRM Jul 20 '18 at 22:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    $\begingroup$ This is something you can do with nodes in Blender Internal, because there, a material outputs a color. You can feed the light-response of one material back in as a factor to control the mix of other materials. You can't do that in Cycles, without baking a light map to use as a factor. You will be able to do it in Eevee. $\endgroup$ – Robin Betts Jun 15 '18 at 22:47
1
$\begingroup$

I am sure Rich Sedman can figure out a mathematical way with nodes.

However I think I would just use drivers for this.

enter image description here

For your material have your glossy shader mixed in with an emission shader.

Right click on the fac of the mix node and choose single driver "set up later"

Make sure you have auto run python in the user pref.

In the graph editor make sure you have it set up like I did. You will need to set up your variable and name it correctly. Choose the spot light and rotation as the object to link the driver to.

When you move the spot light it changes the fac amount on your mix node.

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.