Sharp Normal Generation

About Sharp Normals
ShaderMap can generate what we refer to as "Sharp Normals". This normal generation method provides a more "detailed" representation of displacement data. Standard normal generation uses a 3 x 3 pixel kernel to represent a single point of displacement. By using sharp normals we can reduce this kernel size to 2 x 2. This is technically less accurate but it produces a better visual end result.

An Simple Example

A simple displacement map with a 1 pixel black line on a white background. Imagine that it is a deep trench running through a flat landscape.

The standard method uses 3 pixels to store normals which represent the trench. This produces a smooth visual.

The sharp normal method uses 2 pixels to store normals, ignoring the inner normal and storing the outer normals.

At this point both methods are working with the standard algorithm producing a slightly smoother visual result.

Why Use Sharp Normals?



In this next example we'll use 2 single pixel black lines with a 1 pixel distance. Think of them as two trenches running down a flat landscape.

What do you think will happen when the standard normal generation is applied to this displacement map? Remember it uses 3 pixels (normals) to represent a single displacement pixel.



When the standard algorithm is applied, the displacement that runs along the inside of the 2 trenches is blended out.

This happens because both trenches share a pixel to store a normal. When these 2 normals are combined they cancel each other out producing a normal facing "up" which represents neither of the trenches.

The resulting normal map, when applied to geometry, will produce 1 wide trench rather than 2 unique trenches.



When the sharp normal algorithm is applied no pixels are shared. This means that each displacement, no matter how small, is represented in the final map.
The Standard Normals Applied


The Sharp Normals Applied