diff --git a/data/textures/goblin_astc_8x8_unorm.ktx b/data/textures/goblin_astc_8x8_unorm.ktx new file mode 100644 index 00000000..108d9bdc Binary files /dev/null and b/data/textures/goblin_astc_8x8_unorm.ktx differ diff --git a/data/textures/particle_fire.ktx b/data/textures/particle_fire.ktx index 9f486f41..2f81b789 100644 Binary files a/data/textures/particle_fire.ktx and b/data/textures/particle_fire.ktx differ diff --git a/data/textures/particle_smoke.ktx b/data/textures/particle_smoke.ktx index 9cd67290..d508dec8 100644 Binary files a/data/textures/particle_smoke.ktx and b/data/textures/particle_smoke.ktx differ diff --git a/data/textures/trail_astc_8x8_unorm.ktx b/data/textures/trail_astc_8x8_unorm.ktx new file mode 100644 index 00000000..562b4d61 Binary files /dev/null and b/data/textures/trail_astc_8x8_unorm.ktx differ diff --git a/skeletalanimation/skeletalanimation.cpp b/skeletalanimation/skeletalanimation.cpp index f02d889f..86dfb6ae 100644 --- a/skeletalanimation/skeletalanimation.cpp +++ b/skeletalanimation/skeletalanimation.cpp @@ -645,9 +645,30 @@ public: void loadAssets() { - textures.colorMap.loadFromFile(getAssetPath() + "textures/goblin_bc3.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue); - textures.floor.loadFromFile(getAssetPath() + "textures/trail_bc3.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue); models.floor.loadFromFile(getAssetPath() + "models/plane_z.obj", vertexLayout, 512.0f, vulkanDevice, queue); + + // Textures + std::string texFormatSuffix; + VkFormat texFormat; + // Get supported compressed texture format + if (vulkanDevice->features.textureCompressionBC) { + texFormatSuffix = "_bc3_unorm"; + texFormat = VK_FORMAT_BC3_UNORM_BLOCK; + } + else if (vulkanDevice->features.textureCompressionASTC_LDR) { + texFormatSuffix = "_astc_8x8_unorm"; + texFormat = VK_FORMAT_ASTC_8x8_UNORM_BLOCK; + } + else if (vulkanDevice->features.textureCompressionETC2) { + texFormatSuffix = "_etc2_unorm"; + texFormat = VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK; + } + else { + vks::tools::exitFatal("Device does not support any compressed texture format!", "Error"); + } + + textures.colorMap.loadFromFile(getAssetPath() + "textures/goblin" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); + textures.floor.loadFromFile(getAssetPath() + "textures/trail" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue); } void setupDescriptorPool()