Search Unity

exclude ambient light

Discussion in 'Shaders' started by topofsteel, Oct 23, 2012.

  1. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    Is it possible to set a shader up to exclude ambient/sky light? I model buildings and bake daylight into the scene. But the exterior of the building glows at night. Thanks.
     
  2. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    That's not the ambient light. You need to make a day lightmap, and a night lightmap, and blend between the two.
     
  3. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Like Fishman said, it isn't ambient light that does that, it's your lightmap.

    But if anybody wants to ignore ambient light, simply use the noambient flag in your shader:

    Code (csharp):
    1. #pragma surface surf BlinnPhong noambient