Shader script Input struct vars to Shader graph

Hello there !

I have another question about shader graphs !
I’m trying to transform an old shader script in the URP using a shader graph.
The problem is that i don’t really understand how both of them works ! :smile:
What i now is that my old shader works like I want and it use an Input struct with a color parameter :
struct Input
{
float4 color : COLOR;
float3 localPos;
float3 terrain;
};
this structure get some data from the uv and local position of the mesh using it, that I understand. About the color, I don’t know where it comes from and where can I get the same field in a shader Graph. Is it the same variable than “_Color (“Color”, Color) = (1,1,1,1)” which is the color set in the inspector i think ?
I’m doubting it so I’m a little lost ! :slight_smile:

If someone can give me a brief explanation, that would be sweet, thanks !

Clément.

OK, I just found an explanation !
Turns out that unity’s documentation have a good explanation about how to do surface shader scripts :

So the float4 color: COLOR input is in fact the vertex colors of the mesh.
If you want the equivalent in shader graph, it is the Vertex Color obviously !
Sorry for the stupid question !