There appears to be either a bug with the Time node, or some inconsistency in the implementation or documentation.
The documentation for the Time node shows the following (Time Node | Shader Graph | 7.3.1):
The right-hand values for all of these appears to be coming from the “Built-in shader variables” (Unity - Manual: Built-in shader variables), which states the following (emphasis mine):
So, this is telling me that the Time value coming out of the Time node should be equal to Time.timeSinceLevelLoad. However, it’s easy to confirm that the value is actually equal to Time.time, not Time.timeSinceLevelLoad.
This isn’t the end of the world; I can adjust my shader usage to account for this. But I’d like to know if this is considered a bug, or incorrect documentation, or whether I just don’t understand what’s going on here.
This is easy to verify using a shader like this:
And then use a script like this in your scene:
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.KeypadEnter))
{
Debug.Log("Reloading scene.");
SceneManager.LoadScene("SampleScene");
}
Debug.Log($"timeSinceLevelLoad: {Time.timeSinceLevelLoad}; time: {Time.time}; unscaledTime: {Time.unscaledTime}");
}
The object you put this shader on should appear to gradually rise. But if you reload the scene (Enter key), such that timeSinceLevelLoad resets, the object’s vertex position won’t reset. It will keep going up. And it will go up by an amount consistent with Time.time. For example, the nearer cube is rising up 2 additional meters compared to its proper position, because Time.time is 20. (The cubes behind it are just there to show the measurement)