Hey everyone! Like the title says, how would someone go about that?
I am aware about ktx format but I want to know if there is a way to make one with 6 separate tga files to use as a skybox. In OpenGL I was able to create one handle with 6 textures applied to the corresponding faces. How can I do that in Vulkan? The VkImageViewCreateInfo only has one VkImage and one VkImageSubresourceRange, where I am able to set baseArrayLayer to proper face (+X,-X,+Y,-Y,+Z,-Z). I am just a bit confused on how to go about it. Ive searched but they all mention about ktx format.
Is there an example someone can provide? Maybe point me in the right direction? Ill definitely be grateful!
Load all TGAs into a single buffer with proper layout, offsets and stride for the cubemap image format you want to use (e.g. R8G8B8A8_UNORM) and simply upload them. That’s pretty much the same as how the files are stored inside a .ktx container file if you skip the mip level part.
Or load each TGA into a separate host local buffer and upload with single buffer copies.
Hey Sascha! Thanks for replying! Apologies for the late reply. Busy at work.
But anyway, so if I understood you correctly instead of having 6 different pixel buffer arrays, I will combined all of them into one big buffer?
Yes, as long as your buffer layout matches the one of the target. If not, load up each face into a separate buffer and upload using multiple buffer copies like in my example (https://github.com/SaschaWillems/Vulkan/blob/master/examples/texturecubemap/texturecubemap.cpp).