Added ETC2 and ASTC texture variants (Refs #174)
This commit is contained in:
parent
0389db86da
commit
7c1991830e
5 changed files with 23 additions and 2 deletions
BIN
data/textures/goblin_astc_8x8_unorm.ktx
Normal file
BIN
data/textures/goblin_astc_8x8_unorm.ktx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
data/textures/trail_astc_8x8_unorm.ktx
Normal file
BIN
data/textures/trail_astc_8x8_unorm.ktx
Normal file
Binary file not shown.
|
|
@ -645,9 +645,30 @@ public:
|
||||||
|
|
||||||
void loadAssets()
|
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);
|
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()
|
void setupDescriptorPool()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue