Search Unity

Diffuse lighting input, Ambient output

Discussion in 'Shaders' started by Satoh, Apr 17, 2011.

  1. Satoh

    Satoh

    Joined:
    Feb 17, 2011
    Posts:
    56
    I get the feeling what I need is something really simple, but I really don't understand shaders...

    To put it simply, I want to take the average amount of light being cast on my material, and output it as the overall ambient light of the material... (Taking into account texture color, alpha testing, and no face culling)

    In other words, if there is no light shining on the mat, it should be black (or very darkly colored), if the mat is in direct, bright light, it should be the the full color of the texture applied.

    I have downloaded Strumpy, but I still have no idea how to actually deal with all this shader property stuff... I've looked at a few of the default shaders, and they make absolutely no sense to me...

    To clarify, I don't want to use the 'ambient' property of the light, but the diffuse property, to light the entire material evently, regardless of normal angles and such... Or simply put, to darken the entire texture color depending on the amount of light hitting the material/object.

    What are the properties I need to be concerned with here?
     
  2. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    You'd need to perhaps do a simple NdotL, grab pass, blur that a *lot*, then multiply the diffuse by the results of the blurred grab pass.