Normal Mapping

Normal Mapping can fake interesting surfaces on simple objects. This is done by simply mapping the normals of the surface differently then usual as the computations in the bsdfs depend on the shading normals to compute color.

To support this feature we simply added another Texture called normal to the instance class. If an instance is hit and this texture is provided, we then use the evaluate fuction of the texture with the uv coordinates of our intersection point to get a new direction for our normal. This direction can then be assigned to the shadingnormal that is conveniently stored in the intersection object in lightwave. It is important to do this step before transforming local frame such that the new shading normals get transformed, too.

Normal Mapping Off Normal Mapping On

The left side is simply a brown plane while the right side is the same brown plane but its normals are mapped with an image texture made by Paweł Wałasiewicz.