Search Unity

Help Wanted Update Ambient node at runtime?

Discussion in 'Shader Graph' started by sevensixtytwo, Jan 24, 2020.

  1. sevensixtytwo

    sevensixtytwo

    Joined:
    Apr 5, 2013
    Posts:
    19
    Hello, is there any way to force the Ambient node to update at runtime?

    I have a custom-lit shader that uses two color inputs for lit and shadowed faces respectively. I want to be able to manipulate them depending on the scene's lighting scheme without having to changing the material. I can easily plug in the main light's color value for the lit faces and thought that I could do the same with the Ambient color for the shadowed faces. Unfortunately, it doesn't work, and I read that the Ambient node only updates when entering Play Mode or when saving the project.

    For more context, I generate a level from user-selected variants so a base scene will have its directional light and ambient lighting changed when loading the scene and I want the objects using my shader to conform with that.

    Ideal result:


    Ideal graph


    I'd really like to know if there is any way I can get this to work properly. Failing that, if the team has any plans to address this soon or reasons to implement it as such.

    Thanks.
     
unityunity