internal NORMAL_MAP handling after vertex displacement

Godot Version



Hey, quite new to GODOT shaders, but i think i got the (linear algebraic) basics now.

But i have a question regarding the NORMAL_MAP variable, from the fragment shader, that i can not find no answer to.

I have understood, that i can modify this variable to modify the objects normal at the position, corresponding with the current fragment, and that therefor i have to pass a tangent-space-vector to NORMAL_MAP. (which also, i have to scale to [0,1] in all components.)

Than, my understanding is, that later down the pipeline this NORMAL_MAP value is interpreted together with the objects geometry at that point (its Tangent space and normal at the point), so the actual Normal direction can be computed.

What i dont understand, is, what happens if i displace the VERTEX (in the vertex shader), before assigning the NORMAL_MAP. For example, if i operate on a sphere and i do not only displace along the local normal (so not only “up”). Which tangential space / normal base is than used to interprete the NORMAL_MAP value of that value, when i change it. Is it just the tangential space of the displacement origin?