Announcement

Collapse
No announcement yet.

Material Switch/Blend based on specific light recieved

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

  • Material Switch/Blend based on specific light recieved

    Hi all,
    Is there a method for Switching or blending a material based on how much light it receives from a specific light ?

    eg:
    Rock texture that switches to mossy rock in shadowed areas, but only from sunlight.
    Motes that switch to glowing lightMtl when caught only in moonlight
    Melting glowing metal when caught in a ray beam
    etc.

    I'm sure there's an obvious way (preferably blend material route) but it's got me stumped.


    I could do it in post using multiple renders and LightSelect of course, but it requires heavy imagination as well as multiple renders. A way of doing it directly in shader form would be superduper especially in lookdev.

  • #2
    Not that I'm aware of, for the moment.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Damn, but thank you for letting me know. It's something I've wanted and tried many times in the past. At least I can stop banging my head against the wall.

      Righto.. I'm off to the wishlist forum now

      Comment


      • #4
        Perhaps you could use a surfaceLuminance node, piped through a remapValue, to isolate the surfaces receiving the most light and use that as your blend material mask. It's not perfect but I seem to remember having used that setup for light/shadow based shading in the past.

        /Dan

        Comment


        • #5
          The surface luminance considers all lights though.

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #6
            It does, but in some cases (perhaps also the ones listed by ricoholmes) the difference in intensity between the key light and other lights in the scene will be great enough to effectively isolate the primary light source.

            Comment


            • #7
              Some of those things you could probably also do with some kind of a directional occlusion texture...

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #8
                Sounds interesting - how could this be set up in VRay?


                Originally posted by vlado View Post
                Some of those things you could probably also do with some kind of a directional occlusion texture...

                Best regards,
                Vlado

                Comment


                • #9
                  Much appreciated input
                  The surfaceLuminance route has worked for a few things in the past, but as Vlado says it has a habit of clashing awkwardly and often unpredictably with other lights. in the end it's easier to isolate via lightSelect elements.

                  Now, having said that. A directional occlusion texture sounds like a very plausible route. In words at least. I wouldn't have the slightest clue how to set that up.

                  Comment

                  Working...
                  X