CodeBlanks Logo Icon CodeBlanks

Normal map

Learn that a normal map fakes bumps on a surface.

What is a Normal map?

A Normal map is a specialized texture map creating optical illusions of micro-cracks, bevels, and brick relief without inflating 3D polygon counts. It functions by perturbing surface normals per pixel.

// Enabling Normal map keyword and assigning texture
mat.EnableKeyword("_NORMALMAP");
mat.SetTexture("_BumpMap", normalTexture);

This produces rich surface depth without the performance cost of millions of polygons.

Tangent Space and Blue Tones

Normal map images characteristically exhibit blue and violet hues. In tangent space, the Z axis pointing directly outward matches the blue channel (0, 0, 1) in RGB space.

// Adjusting relief strength (Bump Scale)
mat.SetFloat("_BumpScale", 1.5f);

As light angles shift, slopes encoded in X and Y channels realistically cast shading across indentations and bumps.

Practice Print Normal map profile

Assign "NormalMap" to mapType and "TangentSpace" to space. Print Map: NormalMap | Space: TangentSpace to the console.

Starter code

Player.cs
using System;

class Program
{
    static void Main()
    {
        // mapType ve space değerlerini tanımlayıp yazdır
    }
}

Sample solution

Player.cs
using System;

class Program
{
    static void Main()
    {
        string mapType = "NormalMap";
        string space = "TangentSpace";
        Console.WriteLine("Map: " + mapType + " | Space: " + space);
    }
}

Expected output

Map: NormalMap | Space: TangentSpace

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which texture map is used to impart stone and brick relief without increasing polygon count?

  • Font Texture
  • Lightmap Texture
  • Audio Waveform
  • Normal Map Correct answer

Explanation: A Normal Map simulates fake surface relief and depth by perturbing per-pixel lighting normal angles.

2 Assign normal map texture

Question
mat.SetTexture("____", normalTexture);
Answer
mat.SetTexture("_BumpMap", normalTexture);

Explanation: In Unity's Standard Shader, the normal map texture is assigned through the '_BumpMap' property.

3 Normal map concepts

Term Meaning
Normal Map Texture creating fake surface relief
Tangent Space Local space relative to surface tangent
Bump Depth illusion of surface bumps
Mavi Ton Color for outward-pointing Z normal

All lessons in Intermediate