godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.42k stars 20.24k forks source link

Importing image as Texture2DArray does not work and produces errors. #72573

Open pbaja opened 1 year ago

pbaja commented 1 year ago

Godot version

v4.0.beta17.mono.official [c40020513]

System information

Windows 11, Vulkan, Forward+, RTX 3060 Laptop

Issue description

After trying to import the texture as an array, I get the following errors in the console:

Trying to preview textures in the inspector repeats the error:

What I have tried

Steps to reproduce

  1. Drag and drop an image (png) to the FileSystem
  2. Select the image and in the Import tab change "Import As:" to Texture2DArray
  3. Click on "Reimport"
  4. Confirm to Save, Re-Import, and Restart
  5. After restarting the editor, select the image by double-clicking it

Update

After changing Compress:Mode to VRAM Compressed (It was set to Lossless), checking High quality, and restarting the editor (only reimport did not fix it) it imported the textures correctly!

acegiak commented 1 year ago

Using the workaround listed under Update here causes an issue where exported projects crash on load with an error saying that the resource hasn't been imported. This can be fixed by setting Compress:Mode to VRAM Uncompressed. Texture2DArray Test Project.zip

ventaur commented 1 year ago

As of v4.0.2.stable.official [7a0977ce2], I am not experiencing crashes or errors regardless of compression settings. However, the moment I change a resource's import settings to Texture2DArray and reimport (as well as confirm the need to save and reload the editor), the file is no longer visible in its folder and the folder itself now shows the import settings. Oddly, the folder's import settings also show the resource's file name.

image

Calinou commented 1 year ago
ventaur commented 1 year ago

I wanted to come back and mention that I do not see the behavior I posted about above when I run v4.1.dev.custom_build [c8a13c2c8] from source. The file is again visible in its folder as expected. So this appears to be fixed in the latest code on master.

image