How to import CompressedTexture2DArray

Godot Version

Godot v4.5.1.stable - Windows 11 (build 26100) - Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 32.0.15.6094) - 11th Gen Intel(R) Core™ i5-11400F @ 2.60GHz (12 threads) - 31.87 GiB memory

Question

I want to use a CompressedTexture2DArray in a multimesh shader so that I can use multiple textures on the duplicated meshes.

I have a list of 12 images in my filesystem that I’m selecting all at once, and I’m reimporting them as Texture2DArray in the import panel.

The result is 12 separate CompressedTexture2DArray’s instead of one merged CompressedTexture2DArray.

How do I import these images so that they are all merged into the same CompressedTexture2DArray for use in a multimesh shader?

It’s not possible to import multiple files as one Texture2DArray You’ll need to create the Texture2DArray from code with ImageTextureLayered.create_from_images() There is an example in the documentation.

You could use an EditorScript to generate the Texture2DArray in the editor if you want.