Normal Mapping

Normal Mapping in Unity

If you have read the Lighting in Unity 1 and Lighting in Unity2, you have seen how important normal vectors are for calculating brightness or reflection of a surface in Lighting models.

Normal Mapping is an implementation of Bump Mapping created by (James Blinn).

Normal Mapping is creating a set of normal vectors for every pixel to manipulate the view of an object in the lighting model.
Source: LearnOpenGL
Normal maps manipulate normal vectors, so the model will have more or less depth
Normal maps manipulate normal vectors, so the model will have more or less depth, Source: Unity Manual
It’s important to remember that those effects using normal maps are only rendering effects and have no effect on the Geometry
[CENTER]the Geometric Model with texture applied,[RIGHT] the normal map,[LEFT] the generated view after applying the normal map to the center picture, Source: http://wiki.polycount.com/

It's important to remember that those effects using normal maps are only rendering effects and have no effect on the Geometry of the model.

It’s important to remember that those effects using normal maps are only rendering effects and have no effect on the Geometry
Source: Unity Manual
It’s important to remember that those effects using normal maps are only rendering effects and have no effect on the Geometry
Left: without Normal Map, Right: Normal Map added, Source: UnityCoder

Normal maps can be added to a standard shader using Unity Editor.

Adding a normal map to a standard shader
Adding a normal map to a standard shader, Source: Unity Manual

Normal maps are popular with their blueish color, here is why they have this look.

For every Normal map pixel, it’s represented using the RGB model then transformed to x, y, z values.
Source: http://www.mousta.ch/

For every Normal map pixel, it’s represented using the RGB model then transformed to x, y, z values.

Red: (0 to 255) transformed to x (-1 to 1)

Green: (0 to 255) transformed to y (-1 to 1)

Blue: (128 to 255) transformed to z (0 to -1)

X, Y values represent the width and the height of the screen, where z represents the depth into the screen.

For any negative Z values, it represents if the pixel is coming out of the screen.

The bluer point is a brighter point for the user whereas other points appear duller and give the illusion of being away or being shaded.

Normal Mapping is used a lot for skin and the clothing of avatars
Normal Mapping is used a lot for skin and the clothing of avatars, Source: 3dKingdoms

Normal maps allow us to show details of Game objects using textures where no details exist geometrically.

Normal Mapping is used a lot for skin and the clothing of avatars
Normal Mapping is used a lot for skin and the clothing of avatars, Source: esoteric software

You can transform textures yourself using transform equations, usually, I use this amazing Github project by Christian Petry which is a free tool to create normal maps from textures.

--

--

Software Engineer @ MobiledgeX

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store