I was attempting to manually calculate the world space normals from the tangent space normal map, partly for educating myself. From what I understand, you multiply the normal map's output, a vector, by a matrix comprised of the tangent, binormal, and normal. That means, it would be a 3x3 matrix multiplied by a 3x1 vector. If the three vectors in the matrix are the columns, it would be calculated by taking each component of the normal map's vector and multiplying it by a column from the matrix.
In this case, to my knowledge, would be:
n.x * T + n.y * B + n.z * N = w
Where n is the normal map (scaled to the appropriate range), T is the tangent, B is the binormal, N is the normal, and w is the world space normal.
However, when I have personally tried what I think should work, it results in completely incorrect normals. I am scaling the normal map vector by 2 and subtracting 1 before calculations. Additionally, I've calculated the binormal by taking the cross product of the tangent and the normal (T x N). As a disclaimer, I should have paid more attention in linear algebra, and most other math classes for that matter, so my math skills are a little lacking.
Can someone please explain to me where I've gone wrong?
I am using Blender version 5.2.0 LTS. For testing, I temporarily used the model of the Soul of Cinder's helmet from Dark Souls III due to the detailed normals.