Search Unity

Ambient color

Discussion in 'Shaders' started by ohm, Oct 30, 2009.

  1. ohm

    ohm

    Joined:
    Aug 24, 2008
    Posts:
    88
    Hi,

    How can I get the ambient color in my pixel shader? I don't want _PPLAmbient because that isn't the ambient color but a processed value it seems. If I set the ambient color to white _PPLAmbient doesn't get white.


    Thanks,
    //ohm
     
  2. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    _PPLAmbient should be the global ambient lighting colour as set in Render Settings. Can you perhaps post the code where it's not working?
     
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Actually, if I recall correctly, _PPLAmbient is pre-multiplied by 0.5 due to the doubling performed in Unity's standard lighting equation.