godotengine / godot

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

Texture render error on Android #78115

Open CsloudX opened 1 year ago

CsloudX commented 1 year ago

Godot version

v4.1.dev2.official [668cf3c66]

System information

window10 64bit

Issue description

Texture render error on Android but all right on PC. 1803005947

NOTE: The project was convert from Godot3.

Steps to reproduce

Please export the reproduction project to Android and look the the Texture.

Minimal reproduction project

TTT.zip

ADD: Device: MI8 OS: MIUI 12.5.2

Calinou commented 1 year ago

Which Android device model and Android version are you using? Try switching to the Compatibility rendering method in the Project Settings (including for the .mobile override), as Vulkan support on Android devices is notoriously buggy.

PS: Your textures have a non-of-power of two size. While this should work in theory since OpenGL ES 3.0 mandates support for it, I wouldn't be surprised if some Android devices choke on these. Try resizing your textures to use power-of-two sizes such as 128×128 or 256×256.

CsloudX commented 1 year ago

I'm test again, it like because of Image.resize or ImageTexture.create_from_image. I'm upload a test project: AAT.zip

image If I comment the for loop codes, everything works well.

NOTE: Also maybe because of ProjectSettings that I'm changed, but I can't found sorry.

AThousandShips commented 1 year ago

Does it work if you follow this instruction?

Try resizing your textures to use power-of-two sizes such as 128×128 or 256×256.

In this case 32 for the ones with 20, or 16 for the ones with 10, and so on, you can do this easily with resize_to_po2()

CsloudX commented 1 year ago

Does it work if you follow this instruction?

Try resizing your textures to use power-of-two sizes such as 128×128 or 256×256.

Yes, I'm changed my image's size to 256x256 and test, i't work error too. image

Addtion: Everything work well in v3.5.

CsloudX commented 1 year ago

Addtion: I'm test again, and found some more information, wish can help. If use for loop, it work error. image image

If use for loop and resize again on out for loop, it work error but looks better. image image

If not use for loop, it work no error. image image

NOTE: In this section, the tomato.png original size was 183x183