Normal Maps

About

This article describes how to create correct normal maps in different situations, and potential problems while generating or importing them ingame.

Generation

Before you decide if you need to invert one of the normal map channels, you need to make sure the normal map generator you are using isn't inverting it by default. Some normal map generators have settings for inverting the red(x) and green(y) channels, but some of them invert the red channel by default.

A regular normal map with no inversions looks as if it's lit from the top right - that means the red channel looks as if it's lit from the right, but the green channel looks as if it's lit from the top. That means it appears to be lit from the positive x and y directions which is the normal map standard .

A regular normal map without any inverted channels

A regular normal map without any inverted channels and its red and green channels shown separately. The letters are supposed to look extruded in this example.

Mesh Import Rotation

The rotation feature in the asset editor mesh importer is broken - it produces incorrect tangents, which will make normal maps appear incorrectly or not at all depending on the orientation and uv mapping of each face.

If you would like to use the rotation feature without breaking the tangents and normal maps, use the Mesh Import Rotation Tangents Fix mod .

Assets

For regular assets such as buildings, props, vehicles, trees, and citizens, the normal map works correctly with no inverted channels, according to the standard described above.

Networks

For faces which are vertex painted magenta the normal map always works just like for any normal asset, as described above.

But for faces which are not vertex painted magenta (that means they use the automatic tiling as networks usually do) the green channel usually needs to be inverted.

If you are creating a network using an asymmetric mesh, you would use the invert flag for the segment mesh to appear continuous and not flip every other segment, this will result in the normal map green channel being inverted for every other segment. The solution for that is to have 2 different segment meshes, one of which would have a flipped mesh or a flipped normal map, depending on the flags it has.

Map Themes

Map theme sand and cliff normal maps require an inverted green channel to appear correctly.

The water normal map is animated ingame and constantly fades between a regular and an inverted version.

A normal map with an inverted green channel

A normal map with an inverted green channel and its appearance ingame.