Function Kataglyphis::addTextureOrDefault

Function Kataglyphis::addTextureOrDefault#

Function Documentation#

void Kataglyphis::addTextureOrDefault(Model &model, const std::shared_ptr<VulkanDevice> &device, vk::CommandPool pool, bool created, Texture &&texture, GltfSamplerDesc samplerDesc = {})#

Appends texture when created, otherwise occupies the slot with the default texture instead. Both loaders need this: textureID is a dense index over “one texture per material slot”, so skipping a failed load would shift every later texture down one and push the last textureID past the descriptor array. samplerDesc carries the glTF sampler this texture was authored with (default-constructed for OBJ, which has no sampler concept, and for a failed load’s default stand-in texture).