Announcement

Collapse
No announcement yet.

Material help - Glowing night sights semi working

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

    Material help - Glowing night sights semi working

    I am trying to make a weapon night sight that glows in the dark, but doesn't when in light. I have a material setup that sort of works at this point, but hit a dead end to get any further. What I have now operates backwards to what it should..... It gets more glowy in light and less glowy as it moves away from a light. Current material setup attached.

    Anyone have any ideas how to make this work?
    Attached Files

    #2
    Multiply everything by -1 or maybe just the part the 'senses' light.

    I'm getting at making it output the opposite result, what I have above might not work at all.

    Comment


      #3
      Um... Shouldn't that chain go to the "Emissive" channel?

      Comment


        #4
        Yeah you seem to have gone about this in a needlessly complicated way. You should just link up a Diffuse (not necessarily though), Opacity and Emissive

        Comment


          #5
          Did some more testing and a couple things became apparent.....

          I should have known this, but the LightVector node is only evaluating if the material is facing a light source, and really doesn't take into account the amount of light it is in. If I rotate the object with the material around the effect works by fading between the 2 Lerp inputs. But it's still backwards. It glows if facing the lightsource and doesn't glow if facing away. If I swap the inputs nothing changes. If I add a OneMinus after the last Lerp it just inverts the colors of the texture.

          As for using the Diffuse input rather than the Emissive, I do that because Emissive doesn't utilize lighting info and therefore wouldn't take any lighting evaluation into account.

          @Shindawg: I don't know of a simpler way to attempt it. I'd take a more complicated way if it worked, but maybe you aren't understanding the desired end result. I don't want just a simple material that is emissive. I want that glowy part to show up when in dark areas but go away when in light areas. Same as anything that "glows in the dark" does.

          Comment


            #6
            Ok, got it to work. Attached is my final material setup... very close to what I had before.

            However, once thing that is required to make it work is the map must have a Skylight present. It can be almost black and0.1 in intensity, but it needs to be there and have some value. I have absolutely no idea why this is the case, but after lots of research this point came up as a requirement.

            This isn't going to work for glow in the dark material because it only takes the direction to a light source into account. So you can have a sphere with the material on it in a full lit map and the backside of the sphere (away from the lightsource) will glow.

            A neat material that has some interesting uses, but I'm still looking for a way to do a true glow in the dark material. I'm starting to think I need to use a SceneTexture, desaturate it then figure out a way to sample that somehow to figure out if I am in light or dark areas. Complicated!
            Attached Files

            Comment


              #7
              Ooh I see what you mean now a bit of an undertaking, but you really gotta put up a video or something when you get it working!

              Comment

              Working...
              X