Announcement

Collapse
No announcement yet.

How to have a shader that is reactive to lights?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.


    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?
    Nathan Brady | colonelduck.co.uk
    Animation Artist | contact us

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

    Comment


    • #3
      Originally posted by super gnu View Post
      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.
      Nathan Brady | colonelduck.co.uk
      Animation Artist | contact us

      Comment


      • #4
        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

        Comment


        • #5
          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.

          Comment


          • #6
            Agree, I would also try with a surface luminance, makes much more sense.
            My Artstation
            Whether it is an advantageous position or a disadvantageous one, the opposite state should be always present to your mind. -
            Sun Tsu

            Comment

            Working...
            X