How to have a shader that is reactive to lights?

For Maya / Vray.

I’m trying to create a reactive material, that ‘comes on’ when it’s in the dark.

This video shows a good example, but is using a different render engine: https://youtu.be/EVtj1FV5vz0?t=1391

…

I have a model of an earth, with a light which illuminates half of it (the Sun). I want to have a texture (night city lights) to be visible when the direct light isn’t hitting it (in the shadow), Is this possible? I created a version ages ago in MentalRay using ramp shaders with a gamma correction, but the same nodes don’t seem to work in the same way in VRay.

Any help / advice would be appreciated.


[/HR]
One method I had tried exploring is by using a VRay Light Material, with the texture applied to it, and add a regular ramp node (not shader) but I’m unsure if its possible to track the rotation to the direction of light?

im not sure in maya but in max you can use a falloff map set to light/dark.. maybe there is a maya equivalent

You legend! I’ve not used this node before, it gives great results for what i’m trying to achieve.

For others trying it: link the position of a light source into the ‘Explicit direction’ of the VRayFalloff (I used a VRayLightRectshape). Then you only need to link the VRayFalloff into the diffuse of your material.

Thanks again super gnu.

great news. your method is actually a better variant of what i was suggesting, you have far more control. falloff set to light/dark in max is based on scene illumination levels, not direction to a node. however im glad i pointed you at the right map at least , i might use your method next time :slight_smile:

I think you could probably also use a Maya surface luminance node to do this, which is probably more accurate as what you are currently doing is kind of a hack based on normals.

Agree, I would also try with a surface luminance, makes much more sense.