Added ETC2 and ASTC texture variants (Refs #174)

This commit is contained in:
saschawillems 2017-03-17 21:43:41 +01:00
parent 7c1991830e
commit 16841bb5eb
9 changed files with 60 additions and 28 deletions

View file

@ -134,7 +134,6 @@ public:
}
}
void reBuildCommandBuffers()
{
if (!checkCommandBuffers())
@ -206,7 +205,18 @@ public:
void loadAssets()
{
models.object.loadFromFile(getAssetPath() + "models/lowpoly/deer.dae", vertexLayout, 1.0f, vulkanDevice, queue);
textures.colorMap.loadFromFile(getAssetPath() + "textures/deer.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue);
if (deviceFeatures.textureCompressionBC) {
textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/deer_bc3_unorm.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue);
}
else if (deviceFeatures.textureCompressionASTC_LDR) {
textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/deer_astc_8x8_unorm.ktx", VK_FORMAT_ASTC_8x8_UNORM_BLOCK, vulkanDevice, queue);
}
else if (deviceFeatures.textureCompressionETC2) {
textures.colorMap.loadFromFile(getAssetPath() + "models/voyager/deer_etc2_unorm.ktx", VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, vulkanDevice, queue);
}
else {
vks::tools::exitFatal("Device does not support any compressed texture format!", "Error");
}
}
void setupVertexDescriptions()