# Normal Map
[[Normal Map|Normal Maps]] are texture images that create the illusion of depth, without affecting the geometry of the model, contrary to a [[Displacement Map]].
![[normal-map-ambience.webp]]
<font style="font-size: 10px; color: #989898;">Brick Material Normal Map (source: ==AmbientCG==).</font>
![[normal-map.webp]]
<font style="font-size: 10px; color: #989898;">Brick Material Normal Map (source: ==AmbientCG==).</font>
Normal Maps use RGB values to store the surfaces normals information, ==creating an illusion of depth==. The RGB values represent the X, Y and Z coordinates of the surface normals.
A Normal Map's base color (where all normals are perpendicular to the face) is ==0.5, 0.5, 1==. This color was not chosen arbitrarily. As RGB colors only go from 0 to 1, the normal values are remapped so that -1 becomes 0, 0 becomes 0.5 and 1 becomes 1. Thus a color value of 0.5 translates to a normal of 0.
![[normal-base-color.webp]]
A "blank" Normal Map would thus be read as having a z value of 1, with the x and y values being 0. These normal values (0(X), 0(Y), 1(Z)) translate to a color value of 0.5, 0.5, 1 (or ==128, 128, 255==).
This is also the reason why Normal Maps appear blue-ish.
## Tangent vs. Object vs. World Space Normal Maps
The orientation of the coordinate axes depends on the space used:
### Tangent Space Normal Maps
### Object Space Normal Maps
### World Space Normal Maps
## Normal Map GL vs DX
When downloading PBR texture sets from online resources such as [AmbientCG](https://ambientcg.com), you will notice that there are often two types of Normal Maps, for example:
- ScrewSet001_4K-JPG_Normal==GL==.png
- ScrewSet001_4K-JPG_Normal==DX==.png
To understand the difference, it is important to note that there are actually two standard formats for Normal Maps: ==OpenGL (GL)== and ==DirectX (DX)==. These two standards are also known as left-handed or right-handed Normal Maps.
Both are equally compatible, the only difference is that their green channel (the Y coordinate) is inverted/flipped.
In terms of the "handedness" this means left-handed correlates to -Y and right-handed to +Y.
![[normal-map-gl-dx.webp]]
<font style="font-size: 10px; color: #989898;">Normal Map GL (left) and DX (right) comparison.</font>
As of when to use what type of format, it depends on the software being used:
- [[Blender]] for example ==uses OpenGL==, which means you would use the NormalGL.png Normal Map.
- [[Unreal Engine]] on the other hand ==uses DirectX== by default.
> [!NOTE]
> You can of course also use a DirectX Normal Map inside **Blender** by simply inverting the green channel using Nodes.
## Normal Map vs Bump Map
While Normal Maps can be seen as a type of [[Bump Map|Bump Maps]] and are both used for creating the illusion of depth to a model, they still differ in functionality:
- Normal Maps use RGB Values
- Bump Maps are greyscale images
## Normal Map vs Displacement Map
Normal Maps (and Bump Maps) create a fake impression of depth, whereas a [[Displacement Map]] actually modifies the topology and its quality is also dependant on the quality (polycount) of the mesh.
You can read more on Displacement Maps [[Displacement Map|here]].
## How to Create Normal Maps
You can create Normal Maps yourself off of photographs using Normal Mappers such as [NormalMap Online](https://cpetry.github.io/NormalMap-Online/) or [GIMP](https://www.gimp.org).
As a base use a greyscale image (height map) of your desired image texture.
If your base is not an image but a 3D model you can bake the Normal Map in the used 3D software.