How to do it...

  1. Prepare Vulkan resources as described in the Rendering a geometry with a vertex diffuse lighting recipe.
  2. Load texture data from a file with a normal map (refer to the Loading texture data from a file recipe from Chapter 10, Helper Recipes).
  3. Create a two-dimensional combined image sampler that has a color aspect and format (in example VK_FORMAT_R8G8B8A8_UNORM) and supports VK_IMAGE_USAGE_SAMPLED_BIT and VK_IMAGE_USAGE_TRANSFER_DST_BIT usages (refer to the Creating a combined image sampler recipe from Chapter 5, Descriptor Sets).
  4. Copy data loaded from a normal map into the created image using a staging buffer (refer to the Using staging buffer to update an image with a device-local memory bound recipe from Chapter 4, Resources ...

Get Vulkan Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.