Implementing automatic material conversion
In the previous recipe, we learned how to create a runtime data storage format for scene materials and how to save and load it from disk. In the recipe Implementing the glTF 2.0 metallic-roughness shading model in Chapter 6, we explored how to load PBR material properties. Now, let’s do another quick intermezzo and learn how to extract material properties from Assimp data structures and convert textures for the demo applications in this chapter.
Getting ready
Refer to the previous recipe, Implementing a material system, where we learned how to load and store multiple meshes with different materials. Now, it’s time to explain how to import material data from popular 3D asset formats.
How to do it...
Let’s take a look at the convertAIMaterial()
function from Chapter08/VKMesh08.h
. It retrieves all the required parameters from Assimp’s aiMaterial
structure and returns a Material
object suitable for...