Using cube map textures in Vulkan
A cube map is a texture that contains 6 individual 2D textures that together form 6 sides of a cube. A useful property of cube maps is that they can be sampled using a direction vector. This comes in handy when representing light coming into a scene from different directions. For example, we can store the diffuse part of the physically based lighting equation in an irradiance cube map, which we will touch on in Chapter 6.
Loading 6 faces of a cube map into LightweightVK is a fairly straightforward operation. However, instead of just 6 faces, cube maps are often stored as equirectangular projections or as vertical or horizontal crosses. The equirectangular projection is such a projection that maps longitude and latitude (vertical and horizontal lines) to straight, even lines, making it a very easy and popular way to store light probe images, as shown in Figure 4.4 later in this recipe.
In this recipe, we will learn how to convert this cube...