Global.position is a vertex shader input. it’s initialised with the inPosition attribute (vertex data from the mesh).
You can’t use it in a fragment shader (as you can’t use attributes).
In the second case it works because the attribute value is transferred to the fragment shader as a varying. That’s the standard way of doing it in glsl.
yes but what about global uv maps then…
in the end I feed the vertex position to the 3D noise function and it works
I just have to use a variable from the vertex shader that holds the Global.position
The thing is…you can’t pass mesh data to a fragment shader directly. Not only using shader nodes, but in glsl in general.
The only shader getting mesh vertex data is the vertex shader.
Global uv maps as you say are also passed as a varying.
Well actually VertexData is also a bad prefix. Because Global.position is actually a global variable fed with vertex data, not the vertex data attibute (inPosition). Meaning it’s valid to assign a value to it.
But the “global” here means it’s global to all the nodes in the vertex shader.
This is the yellow rail in the shaderNodes editor.
So maybe VertexGlobal, and FragmentGlobal would be better…