Added ETC2 and ASTC texture variants (Refs #174)
This commit is contained in:
parent
7b2dceebab
commit
35b9912fd8
7 changed files with 24 additions and 4 deletions
BIN
data/textures/round_window_astc_8x8_unorm.ktx
Normal file
BIN
data/textures/round_window_astc_8x8_unorm.ktx
Normal file
Binary file not shown.
BIN
data/textures/round_window_etc2_unorm.ktx
Normal file
BIN
data/textures/round_window_etc2_unorm.ktx
Normal file
Binary file not shown.
BIN
data/textures/skysphere_astc_8x8_unorm.ktx
Normal file
BIN
data/textures/skysphere_astc_8x8_unorm.ktx
Normal file
Binary file not shown.
BIN
data/textures/skysphere_etc2_unorm.ktx
Normal file
BIN
data/textures/skysphere_etc2_unorm.ktx
Normal file
Binary file not shown.
|
|
@ -826,8 +826,6 @@ public:
|
||||||
|
|
||||||
textOverlay->addText(deviceProperties.deviceName, 5.0f, 45.0f, TextOverlay::alignLeft);
|
textOverlay->addText(deviceProperties.deviceName, 5.0f, 45.0f, TextOverlay::alignLeft);
|
||||||
|
|
||||||
textOverlay->addText("Press \"space\" to toggle text overlay", 5.0f, 65.0f, TextOverlay::alignLeft);
|
|
||||||
|
|
||||||
// Display projected cube vertices
|
// Display projected cube vertices
|
||||||
for (int32_t x = -1; x <= 1; x += 2)
|
for (int32_t x = -1; x <= 1; x += 2)
|
||||||
{
|
{
|
||||||
|
|
@ -860,6 +858,7 @@ public:
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
// toto
|
// toto
|
||||||
#else
|
#else
|
||||||
|
textOverlay->addText("Press \"space\" to toggle text overlay", 5.0f, 65.0f, TextOverlay::alignLeft);
|
||||||
textOverlay->addText("Hold middle mouse button and drag to move", 5.0f, 85.0f, TextOverlay::alignLeft);
|
textOverlay->addText("Hold middle mouse button and drag to move", 5.0f, 85.0f, TextOverlay::alignLeft);
|
||||||
#endif
|
#endif
|
||||||
textOverlay->endTextUpdate();
|
textOverlay->endTextUpdate();
|
||||||
|
|
@ -867,9 +866,30 @@ public:
|
||||||
|
|
||||||
void loadAssets()
|
void loadAssets()
|
||||||
{
|
{
|
||||||
textures.background.loadFromFile(getAssetPath() + "textures/skysphere_bc3.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue);
|
|
||||||
textures.cube.loadFromFile(getAssetPath() + "textures/round_window_bc3.ktx", VK_FORMAT_BC3_UNORM_BLOCK, vulkanDevice, queue);
|
|
||||||
models.cube.loadFromFile(getAssetPath() + "models/cube.dae", vertexLayout, 1.0f, vulkanDevice, queue);
|
models.cube.loadFromFile(getAssetPath() + "models/cube.dae", vertexLayout, 1.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.background.loadFromFile(getAssetPath() + "textures/skysphere" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue);
|
||||||
|
textures.cube.loadFromFile(getAssetPath() + "textures/round_window" + texFormatSuffix + ".ktx", texFormat, vulkanDevice, queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setupVertexDescriptions()
|
void setupVertexDescriptions()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue