To use normal mapping in our application, we need to prepare an image, in which normal vectors are stored. We must load the image's contents, create an image, and copy the data to the image's memory. We also need to create a sampler that, along with the image, will form a combined image sampler:
int width = 1; int height = 1; std::vector<unsigned char> image_data; if( !LoadTextureDataFromFile( "Data/Textures/normal_map.png", 4, image_data, &width, &height ) ) { return false; } InitVkDestroyer( LogicalDevice, Sampler ); InitVkDestroyer( LogicalDevice, Image ); InitVkDestroyer( LogicalDevice, ImageMemory ); InitVkDestroyer( LogicalDevice, ImageView ); if( !CreateCombinedImageSampler( PhysicalDevice, *LogicalDevice, VK_IMAGE_TYPE_2D, ...