How to convert object space normals to tangent space? I'm trying to experiment a workflow where I can manually paint normals to create stylized shading for a model.
Painting on the model, I want to use object-space normal, as it's easier to work with, but it's a problem that I end up with tangent space normals. Ideally I would want to just convert it back to tangent space in the shader.
At the very least I have to know whether or not it's possible to do what I'm trying to do?
The simplest way to do such a conversion is to calculate the dot products between the Object_Space_Normal and the Tangent plane, and then 'normalize' the result to RGB.
$\vec{Tg}_N = 0.5 +
\begin{bmatrix} \vec{Tg} \cdot \vec{N}_{obj} \\
(\vec{N} \times \vec{Tg}) \cdot N_{obj} \\
\vec{N} \cdot \vec{N}_{obj} \end{bmatrix}
/ 2 $
And with nodes:

This is the main process when working with vectors in World space.
In the case where your Normals are Object normals encoded into RGB, then you need to convert them first to world as in the following example: