Yeah i see. Just for the sake of conpleteness,
So im saying theoretically the shader could get the normal back to object space with the the world_Inverse or model matrix inverse ..(or was it the inverse transpose?)
vec4 obj_normal = world_inverse * vec4(NORMAL, 1.0);
then do the same for the tangent, and the binormal, then form the matrix…
Godot reverses the direction of the B, so (T,N,B) becomes (T,-B,N)
mat3 tbn = (mat3(TANGENT , -BINORMAL , NORMAL));
mat3 ob_tbn = (mat3(obj_tangent , -obj_binormal , obj_normal));
and then for each pixel,
vec4 norm_sample = sampler2D(normal_map, UV);
norm_sample =unpack(norm_sample);
So we then could take the unpacked object space vector which is a vector on a unit sphere and change basis to tangent space …the object space tangent space …
vec3 norm_sample_tan_space=obj_tbn * norm_sample.xyz;
And
vec4 norm_sample_world_tan = mat_world * norm_sample_tan_space;
To get it to the world transformed tangent space.
and unfortunately, after all that, it might (edit: probably wont even) work.
Edit 2: im probably changing basis wrong here, rusty memory, position should not be a factor, The idea is that you could put the object space normal into the tangent basis.
So something like sample_normal.dot( vertex_normal) in the vertex normal direction, and the same for the -B and T directions.


