Normal Mapping
Normal Mapping In Unity

Normal Mapping

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 mode

Source: LearnOpenGL


Normal Mapping can be described simply as creating a set of normal vectors for every pixel to manipulate the view of an object in the lighting model.


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: https://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: https://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.

Taras Klymenko

Unity Game Developer

5 年

Побольше бы таких статей!

要查看或添加评论,请登录

Ahmed Schrute的更多文章

  • Genetic Evolution (Behavioral Traits) Simulation using Unity3D

    Genetic Evolution (Behavioral Traits) Simulation using Unity3D

    This is a simulation of Genetic Evolution with a focus on Behavioral traits passed between generation, In this…

  • Vertex Fragment Shader Structure

    Vertex Fragment Shader Structure

    This article is a continuum of shader coding articles using Shader lab in Unity, I highly recommend you visit my two…

  • Rendering Queues in Unity

    Rendering Queues in Unity

    A lot of times, we need to render certain objects(Player, Gem …etc) to the front even there is an object overlaying our…

  • Light in Unity?2

    Light in Unity?2

    Intro to Blinn Phong Lighting model In the previous article, We have been through Lambert Lighting Model and how it…

  • Light in Unity?1

    Light in Unity?1

    Introduction to Lighting in Unity and Lambert Lighting Lighting in Computer Graphics is all about calculating the Pixel…

  • Shader Variables Data?Types in Unity

    Shader Variables Data?Types in Unity

    Why we use different variable types when writing shaders? Shader code is for every pixel(or vertex), therefor efficient…

  • Understanding Mesh Anatomy in Unity

    Understanding Mesh Anatomy in Unity

    In order to shade a model we need to understand its geometric structure Let’s take a cube as an example of a mesh model…

  • Rendering Pipeline In Unity

    Rendering Pipeline In Unity

    Introduction to Rendering Pipeline in Unity Rendering Rendering is the process of drawing a scene on the computer…

  • Unity CPU Profiling

    Unity CPU Profiling

    Enhancing unity CPU performance I usually have a routine before I start inspecting the CPU usage tap which is opening…

社区洞察

其他会员也浏览了