award For a camera facing quad and a 2D sprite, we can assume that object space and tangent space coincide. For a 2D sprite I think the object space and camera space also coincide. But this needs to be checked.
However, when writing the normal from fragment shader, Godot expects NORMAL to be in camera space, while NORMAL_MAP in tangent space AND remapped do 0-1 range, exactly like the values that are encoded into a standard normal map texture.
Also, if you write to NORMAL_MAP, then NORMAL will be ignored.
So when you want to write your calculated per pixel normal from the fragment shader, you can do one of the following:
NORMAL = camera_space_normal;
// or
NORMAL_MAP = fma(tangent_space_normal, vec3(.5), vec3(.5));