How to Create Normal Maps in Affinity Photo

How to Create Normal Maps in Affinity Photo from Photographs

Affinity Photo Workbook

This article will teach you how to create normal maps in Affinity Photo from photographs. I had originally created the normal maps for my previous tutorial, How to Create Normal Maps from Photographs, in Adobe Photoshop (CS4). Adobe had subsequently moved to a subscription only licensing model that forces the users to keep their software, OS and hardware, all updated to the latest versions. Such subscriptions don’t allow running older software versions on older systems, which I sometimes need to do in order to access older projects. So, I had subsequently switched from Adobe products to Serif’s excellent publishing software suite that allows traditional non-subscription based licensing; Affinity Photo, Affinity Designer and Affinity Publisher.

I was recently contacted by a client who also uses Affinity Photo and was having difficulty duplicating my previous normal map construction steps from Adobe Photoshop in Affinity Photo. So, as part of a consulting project with them, I have re-created the manual normal map construction tutorial adjusted for Affinity Photo.

Camera and Light Setup to Photograph Normal Map

Before proceeding to the following tutorial, it would be useful to first review my previous tutorial, How to Create Normal Maps from Photographs. The first two sections of that article explain how normal maps are composed and how to take directionally lighted photographs that may be used to construct normal maps. Those same photographs may then be used to create normal maps in Affinity Photo with the following tutorial.


Create the Blue Layer in Affinity Photo

The trickiest channel to create is the blue channel. This represents Z vectors from blue = 128, Z = 0, laying on the polygon plane (in any circular direction indicated by the red/green amount) to blue = 255, Z = -1, pointing outward perpendicular to the plane. The completed blue layer may also be used as the basis to simulate an ambient occlusion map and specular map because vectors pointing perpendicular to the image would normally also be those that are less occluded and more specular.

You could just take a fifth photograph with the light directly perpendicular to the object, but I couldn’t get the right angle due to the size of my camera and the close proximity didn’t allow the light to be placed at the proper angle. So I figured I would construct it by compositing the four side lighted photographs instead. I had initially used the shadows from each of the side lighted images to make the composite blue channel but that ended up looking a little rough and splotchy. The highlights are smoother than the shadows so I instead used the inverse of the highlights rather than the shadows as follows.

Blue Layer group blend mode Lighten

  • First import all four original directionally lit photos into Affinity Photo as separateimage layers. Be sure they are properly cropped and all exactly aligned. Name each layer based on the direction of the light: Top, Left, Bottom, Right.
  • Select all four image layers in the Layers Panel and create a Group Layers. Name the group: Blue Channel Z.
  • Select all four image layers and set the to the Lighten blend mode. This will composite all the highlights together as if the image were lighted by all four lights at once.

Four lighted photographs combined


HSL Adjustment Layer

  • Next add an HSL adjustment layer above the Left layer, so that it will affect all the layers below it.
  • Set the Saturation Shift to -100% to create a grayscale version of the composited highlights. It is not absolutely necessary to convert it to grayscale because when we copy and paste the final composite into the blue channel it will automatically convert to grayscale. But converting it first makes it easier to judge and adjust the gamma without being distracted by the color.

Curves Adjustment Layer

  • Add a Curves adjustment layer above the HSL adjustment layer, so that it will affect all the layers below it.
    [NOTE: In Adobe Photoshop I used a Levels adjustment layer here. Unfortunately, the Levels adjustment layer gamma control doesn’t appear to work correctly in Affinity Photo when the outputs are reversed to invert the image. So, we’re using a Curves adjustment layer in Affinity Photo instead.] 
  • With the Master curve selected drag the left node from the bottom to the top and drag the right node from the top to the bottom to invert the image. This turns the highlights into shadows.
  • Click in the middle of the white curve to add a node near the middle. Adjust this node upward as necessary so that you get a mostly bright image without clipping too much to white.
  • This results in an image where all the areas facing the viewer are light with smooth shadows for all areas tilting away from the viewer.

Blue layer inverted and brightened. Blue Layer Group final Layers


Create the Normal Map Layers

At this point we have all the necessary ingredients. We have the photographs that capture the lighting from the four sides; top, right, bottom and left. We also have an image composited from those four photographs that simulates light perpendicular to the image. Now it’s time to put the separate photographs into the appropriate color channels and adjust those channels to create the composite normal map.

[NOTE: In Adobe Photoshop you are easily able to directly copy/paste grayscale images in and out of any channels at will because channels are really nothing more than grayscale images. Affinity Photo also has full support for channels, but even though they are nothing more than grayscale images, you can’t directly copy/paste to manipulate them. Instead, you must use Affinity Photo’s specific channel commands from the right-click context menu on the specific channels listed in the Channels panel to move the grayscales through temporary spare channels to swap them in and out of specific channels. So, there are a few more steps to load all the images into the specific channels to composite our Normal Map in Affinity Photo.]

Create a Set of Spare Channels with all the Grayscales for the Normal Map

Blue layer create spare channel

  • Select the Blue Channel Z layer group in the Layers panel.
  • Right-click on any of the channels; Composite Red, Composite Green or Composite Blue (they are all the same in this case) in the Channels panel and select the Create Spare Channel command.
  • Right-click on the newly created Spare Channel in the Channels panel and rename that channel Blue Grayscale.

Create Left channel

  • Expand the Blue Channel Z group in the Channels panel and select the Left layer.
  • Right-click on the Left Blue channel in the Channels panel and select the Create Spare Channel command.
  • Right-click on the newly created Spare Channel and Rename the channel: Left.
[NOTE: We’re using the Blue channel from each of these lighted photographs because that channel shows the greatest tonal range in this particular case of a gold coin. In other cases where photographs are colored differently you may use one of the other channels, or you may first desaturate the images so that they are reduced to grayscale images, in which case you may then use any of the channels.] 

  • Repeat this process for the Bottom, Right and Top Layers, creating a new Spare Channel for each of their Blue Channels, and rename each Spare Channel appropriately.

 

Spare channels


Create the TopRight Composite Layer

Fill Alpha

  • Create a new pixel layer named TopRight.
  • In order to see the contents of the RGB channels in the new layer, we first need to fill the alpha channel or the new layer will remain invisible. So, with the TopRight layer selected in the Layers panel, right-click on the TopRight Alpha channel in the Channels panel and select Fill to fill the alpha channel. This will make the TopRight Alpha channel appear white.

Load TopRight Blue

  • With the TopRight layer selected in the Layers panel, right-click on the Blue Grayscale spare channel in the Channels panel and select Load to TopRight Blue to load the grayscale into the blue channel.
  • Repeat with the TopRight layer selected in the Layers panel, right-click on the Top spare channel in the Channels panel and select Load to TopRight Green to load that grayscale into the green channel.
  • Repeat with the TopRight layer selected in the Layers panel, right-click on the Right spare channel in the Channels panel and select Load to TopRight Red to load that grayscale into the red channel.

TopRight Layer
Notice the TopRight layer highlights on the top are green and highlights on the right are red.

TopRight Channels


Finished Blue LayerTopRight Levels

  • Add a Levels adjustment layer and drag it onto the TopRight layer so it only affects that layer. Set the Output Black Level to 50%. Leave the Output White Level at 100%.

Create the BottomLeft Composite Layer

Bottom left fill.

  • Now create a new pixel layer named BottomLeft.
  • As we did with the TopRight layer we need to fill in the Alpha channel. So, with the BottomLeft layer selected in the Layers panel, right-click on the BottomLeft Alpha channel in the Channels panel and select Fill to fill the alpha channel. This will make the BottomLeft Alpha channel appear white.

Load BottomLeft Red

  • Now to load up the BottomLeft layer’s channels. With the BottomLeft layer selected in the Layers panel, right-click on the Bottom spare channel in the Channels panel and select Load to BottomLeft Green to load that grayscale into the green channel.
  • Repeat with the BottomLeft layer selected in the Layers panel, right-click on the Left spare channel in the Channels panel and select Load to BottomLeft Red to load that grayscale into the red channel.
  • Leave the BottomLeft Blue channel empty (black).

BottomLeft highlight
Notice the BottomLeft layer highlights on the bottom are green and highlights on the left are red.

Spare channels

Bottom Left Levels

  • Create a Levels adjustment layer and drag it to the BottomLeft layer so that it only affects that layer. Set the Output Black Level to 100% and set the Output White Level to 50%. This will invert the colors and shift them into the upper half of the color gamut range. This is important so that it may be combined with the TopRight layer.

Composite the TopRight and BottomLeft Layers Together

Final Normal MapMultiply Layers

  • Now to combine the TopRight and BottomLeft layers simply set the blend mode of the BottomLeft layer, which is above the TopRight layer in the layer palette, to Multiply. This will composite the two layers together.
  • Export this finished normal map as a png image for use in your favorite 3D software.


If you enjoyed this tutorial please consider making a donation to fund more!



DreamLight Constellation Network Render Controller

DreamLight Constellation 3D Icon LogoDreamLight® Constellation is our cross-platform network render controller that combined with DLI_SNUB-Launcher™ makes configuring, launching and controlling LightWave 3D ScreamerNet LWSN for standalone, batch, network and internet rendering, drag-and-drop-dead-easy™.

Created by Michael Scaramozzino - LightWave 3D Artist Profile
Author of Creating a 3D Animated CGI Short & Mastering LightWave ScreamerNet


DreamLight wrote the book: Creating a 3D Animated CGI Short. See what we can do for you.

2 Responses

  1. Dan Burke
    | Reply

    Thanks! Just what I was looking for! I suppose an application of these techniques could work for combining normal maps?

    • You are very welcome! Sure, once you understand exactly how they work you can manipulate them any way you wish.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.