Ambient Lighting in Unity

I am attempting to recreate ambient light in an unlit shader to practice the process of applying light to the surface of objects. I want do do this so I can understand where and how I can make artistic changes to me shaders while being able to retain features of a PBR workflow where it suits me.

I started with the hope of trying to stylize an HDRP shader but because of the way the lighting model works, I realized that it would be quite challenging to start here due to the amount of work required to get lighting data from lights outside the main light.

I have started trying the URP instead to get started, but am having trouble when trying to get ambient lighting.

The scene is set up so that the sky ambient color is 100% green, the equatorial ambient is 0, and the ground ambient is red at 100%

This shows me there is some directionality associated with the ambient lighting. But I am not sure how that directionality is calculated.

My initial thought was to apply the “ground ambient” to my object by treating it as diffuse light.

I started with taking the normal of the surface N and take the upward vector as the light direction for the vector l

Thus I can do my diffuse calculation with N dot l for the ground directionality but this was way too strong.

Furthermore, the green (Sky color) absolutely dominates the red when the main light is turned off, and both almost totally vanish when the scene light is turned off on my shader, but can be clearly seen on the lit urp base shader.

I decided to turn to the shader graph samples for ideas.

Unfortunately when I try to use custom function nodes included in the Feature Examples, sample package for shader graph, I get the result on the right hand side.

The shaders included in the example pack appear to be totally broken, and in fact, when plugging JUST The “get ambient light” node function from the examples. I get a completely black output.

(and some of the included sub graphs appear to be giving hlsl compilation errors, though they do not appear to be the nodes that are being used in the example shader graph I put in the screenshot)

As a result these are no help in understanding what is actually being done to calculate ambient.

Further, as you can see the scene directional light properly appears to mix on the standard shader while I cannot seem to get a proper mix on mine.

My question is, what is a good way to approach this? I like the ambient directionality ,and understanding how this works would be critical for me to be able to use any ambient light with this shader.

I also feel like I need to know how this works in order to properly tackle “additional lights” in my shader when the time comes.

EDIT For Clarity:

The green light is dominant here probably because I tried a new way of “sampling from a couple vectors” from above, which gave “better” results than a single up or down vector but still failed to capture a reasonable light level. I can make the red more dominant by making the “vector” N larger but the result is still middling.

Here’s a simple example of using the Unlit Master Stack in Shader Graph together with the Ambient node to bring in the Sky, Equator, and Ground colors to make Ambient light.