A [[Normal Vector|Normal]] [[Function|Map]] [[Bitmap Image|Texture]] is a type of [[Bitmap Image]] where each pixel represents a 3D normal [[Vector|vector]] Normal Maps typically represent normals in [[Surface Tangent Space]] where each normal is relative to the triangle it is being applied to. ### Lighting in TBN Space - Form a [[Surface Tangent Space|TBN]] space per [[Vertex]] & a [[Change of Basis Matrix]] - Transform geometry, light source, & viewpoint to TBN space - Compute $L,H,V$ [[Vector|vectors]] per vertex in TBN space - For each [[Pixel]], compute $L,H,V$ by [[Hyperbolic Interpolation|interpolating]] from verticies - Combine perturbed $N$ vector and use in light equations ## Methods for Construction ### Creating from a [[Bump Map]] Given a [[Bump Map]] $\beta(u,v)$, you can derive a normal map $N_{\perp}$ by taking the [[Partial Derivative|partial derivatives]] as vectors in the $u$ and $v$ directions. $\huge \begin{align} \vec\beta_{u} &= \mat{ 1\\0\\ \alpha\pa{\beta(i+1,j) - \beta(i-1,j)} }\\ \vec\beta_{v} &= \mat{ 0\\1\\ \alpha\pa{\beta(i+1,j) - \beta(i-1,j)} } \end{align} $ These two vectors are not the partial derivatives themselves, but vectors whose $XY$ coordinates point in the axis we are taking a partial derivative, and whose height represents the change in that direction ([[Partial Derivative]]) multiplied by $\alpha$. Where $\alpha$ is an 'effect' coefficient which scales how strong the normals are. You can then create $P_{\perp}$ by taking the [[Cross Product]] and then normalising. $\huge \vec P_{\perp} = \frac{\vec \beta_{u} \times \vec \beta_{v}}{\lvert \vec \beta_{u}\times \vec \beta_{v} \rvert } $ ### Baking from High-Poly Geometry - Capture surface detail from a dense sculped model - Ray casting from a low poly mesh to a high poly surface - Record the high poly surface normal into a texture - Produces realistic lighting on low-poly models ### Painting / Sculpting with Tools - Artist paint or stamp normal directions with software - Exported as 3D normal maps - Often combined with baked normals - Ideal for adding very fine & stylized surface details.