GLSL Normal Map
shader
This shader is used to render a bump mapped surface.
This shader is used to render a bump mapped surface. Surface normals are supplied to the shader in a normal map. The coordinates of the normals are interpreted relative to the target geometry’s local coordinate frame.
Object space normal maps should only be used with rigid meshes (i.e. meshes that won’t be deformed through animation). Object space normal maps remain valid, and will render correctly, when the target geometry is rotated, uniformly scaled, or translated as a whole. Object space normal maps will become invalid if, for example, the target geometry is animated using some non-trivial skeleton. Tangent space normal maps are more flexible in this respect but are computationally more expensive.
Since different software packages may not be consistent in the way they encode normals as colors, three toggles are available for tweaking the way the shader interprets color values. These toggles flip the signs of the x, y, and z coordinates of each normal. When using ZBrush normal maps with this shader, flip the y and z axes.
Usages in other examples
| Example name | Example for |
|---|