godotengine / godot

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

weird error message when opening a repo for the first time after cloning #95290

Open shahriarlabib000 opened 1 month ago

shahriarlabib000 commented 1 month ago

Tested versions

System information

Android 11-Redmi 10 2022-Godot v4.2.2.stable

Issue description

When i clone my preexisting repo from github and open it for the first time with godot Editor it there is a error in the output it says

Cannot convert to <-> from compressed formats. Use compress() and decompress() instead.

Screenshot_2024-08-08-22-47-59-102_org godotengine editor v4 It doesn't cause any issue tho. Everything works normally AFAIK. It doesn't pop up ever again just for the first time.

Steps to reproduce

Clone a repo from github Open with Godot editor

Minimal reproduction project (MRP)

https://github.com/shahriarlabib000/dice

dice.zip

AThousandShips commented 1 month ago

This needs more detail, I can't replicate this with a generic project, what does your repo contain? Did you push the .godot folder to your repo?

shahriarlabib000 commented 1 month ago

This needs more detail, I can't replicate this with a generic project, what does your repo contain? Did you push the .godot folder to your repo?

Pls check out this repo https://github.com/shahriarlabib000/dice

viewers from future checkout the MRP zip

AThousandShips commented 1 month ago

Can't replicate on 4.3, so either there are more steps needed or this is specific to 4.2, can you please try with 4.3.rc3

shahriarlabib000 commented 1 month ago

Can't replicate on 4.3, so either there are more steps needed or this is specific to 4.2, can you please try with 4.3.rc3

I don't know what else i might be possibly doing. Here is the full process that i did in 4.3.rc3: https://youtu.be/QygUDJWCzRU?si=etsFxnL5Br-8CKhC

AThousandShips commented 1 month ago

Seems likely to be android specific then

Alex2782 commented 1 month ago

Your project has 2 png files, I think this is just a harmless warning if the 2 png files are displayed correctly in the editor.

https://github.com/godotengine/godot/blob/39fc116c5fed3a434aa35087a87d58d518b1033a/core/io/image.cpp#L517-L519

bool Image::is_format_compressed(Format p_format) {
    return p_format > FORMAT_RGBE9995;
}
enum Format ```cpp enum Format { FORMAT_L8, //luminance FORMAT_LA8, //luminance-alpha FORMAT_R8, FORMAT_RG8, FORMAT_RGB8, FORMAT_RGBA8, FORMAT_RGBA4444, FORMAT_RGB565, FORMAT_RF, //float FORMAT_RGF, FORMAT_RGBF, FORMAT_RGBAF, FORMAT_RH, //half float FORMAT_RGH, FORMAT_RGBH, FORMAT_RGBAH, FORMAT_RGBE9995, FORMAT_DXT1, //s3tc bc1 FORMAT_DXT3, //bc2 FORMAT_DXT5, //bc3 FORMAT_RGTC_R, FORMAT_RGTC_RG, FORMAT_BPTC_RGBA, //btpc bc7 FORMAT_BPTC_RGBF, //float bc6h FORMAT_BPTC_RGBFU, //unsigned float bc6hu FORMAT_ETC, //etc1 FORMAT_ETC2_R11, //etc2 FORMAT_ETC2_R11S, //signed, NOT srgb. FORMAT_ETC2_RG11, FORMAT_ETC2_RG11S, FORMAT_ETC2_RGB8, FORMAT_ETC2_RGBA8, FORMAT_ETC2_RGB8A1, FORMAT_ETC2_RA_AS_RG, //used to make basis universal happy FORMAT_DXT5_RA_AS_RG, //used to make basis universal happy FORMAT_ASTC_4x4, FORMAT_ASTC_4x4_HDR, FORMAT_ASTC_8x8, FORMAT_ASTC_8x8_HDR, FORMAT_MAX }; ```

For the first 17 formats there should be no warning, you could try to convert the png files to another format.

Or perhaps because ETC2 must be activated for Android Export?

Image::is_format_compressed(p_new_format)

image

shahriarlabib000 commented 1 month ago

Turning on ETC2 ASTC doesn't seem to work

https://github.com/user-attachments/assets/8c16cefe-7bd8-4ff7-9770-eefb6bfaa1f9

Alex2782 commented 1 month ago

ETC2 cannot be deactivated, Godot Editor on Android tries to convert to ETC2. Maybe we can disable this warning on Android. Or compress should be executed as stated in the warning.

Is this warning also displayed with other projects?

logcat ``` 2024-08-13 14:34:15.935 4258-4415 Godot org.godotengine.editor.v4.debug V OnGodotMainLoopStarted 2024-08-13 14:34:17.107 4258-4415 godot org.godotengine.editor.v4.debug I Image::convert : 5 -> 30 2024-08-13 14:34:17.107 4258-4415 godot org.godotengine.editor.v4.debug E USER ERROR: Cannot convert to <-> from compressed formats. Use compress() and decompress() instead. 2024-08-13 14:34:17.107 4258-4415 godot org.godotengine.editor.v4.debug E at: convert (core/io/image.cpp:520) 2024-08-13 14:34:17.133 4258-4415 godot org.godotengine.editor.v4.debug I Image::convert : 5 -> 31 2024-08-13 14:34:17.133 4258-4415 godot org.godotengine.editor.v4.debug E USER ERROR: Cannot convert to <-> from compressed formats. Use compress() and decompress() instead. 2024-08-13 14:34:17.133 4258-4415 godot org.godotengine.editor.v4.debug E at: convert (core/io/image.cpp:520) ```
Image::convert : 5  ->  30
Image::convert : 5  ->  31
 5 = FORMAT_RGBA8
30 = FORMAT_ETC2_RGB8
31 = FORMAT_ETC2_RGBA8
shahriarlabib000 commented 1 month ago

I don't understand why this warning is red. Shouldn't warnings be yellow? It's really confusing

shahriarlabib000 commented 1 month ago

Is this warning also displayed with other projects?

Yes i saw it in some other projects as well

Alex2782 commented 1 month ago

I don't understand why this warning is red. Shouldn't warnings be yellow? It's really confusing

I'm not sure if it's critical and which solution would be the best. Image::convert can also be executed via GdScript, I think it should still show it's error in red.

https://docs.godotengine.org/en/stable/classes/class_image.html#class-image-method-convert


If anyone wants to look for a solution. File drivers/gles3/storage/texture_storage.cpp

I have checked what happens when compress is executed. There is another warning in the function image->generate_mipmaps(): mipmaps cannot be created if the texture is compressed.

screenshot ![image](https://github.com/user-attachments/assets/e33c2d13-cdd9-4f53-bbe0-4505f5aeef4f)
shahriarlabib000 commented 1 month ago

I don't understand why this warning is red. Shouldn't warnings be yellow? It's really confusing

I'm not sure if it's critical and which solution would be the best. Image::convert can also be executed via GdScript, I think it should still show it's error in red.

https://docs.godotengine.org/en/stable/classes/class_image.html#class-image-method-convert

Sorry I really don't know how would I convert it with code. Like how would i get reference to the image? Will preload or load work?