godotengine / godot

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

Vulkan: TileMaps sometimes render incorrectly on Android #61789

Open doonv opened 2 years ago

doonv commented 2 years ago

Godot version

4.0-alpha9

System information

PC: Windows 10 64-bit; Phone: Samsung Galaxy A50

Issue description

I'm working on little farming game. I played the game on my android phone, and I see that the tilemaps render incorrectly and look extremely weird.

https://user-images.githubusercontent.com/58695417/172458014-15e2b955-d40d-49f1-9712-81fd87e9aebd.mp4

Sometimes the game runs normal without any glitches, other times it looks extremely weird.

Steps to reproduce

  1. Download the project below.
  2. Open it up in godot 4
  3. Run it on your android device

Minimal reproduction project

Since my game is very small and I plan to open source it anyway. You can download it here.

Calinou commented 2 years ago

Can you reproduce this after switching to the OpenGL rendering backend in the Project Settings?

doonv commented 2 years ago

Can you reproduce this after switching to the OpenGL rendering backend in the Project Settings?

@Calinou, I changed rendering/driver/driver_name to opengl3. Exported the game to my phone via USB debugging. I got this error message:

Screenshot showing that the phone was unable to initialize the Video driver

No idea why it's talking about Vulkan when I'm not even using it in this case.

Alexia-AT-Digitecnology commented 2 years ago

Same error with 4.0-dev alpha 10, switched to GLES3 backend and appears same message in Android. I have a Redmi 9T and have GLES3 drivers on Adreno GPU. @Dan-Gamin did you solve this?

Alexia-AT-Digitecnology commented 2 years ago

I'm seeing the source code and seems the gles3 backend is not compiled...

https://github.com/godotengine/godot/blob/4bbe7f0b98de72d6dd77d5ade4b761de375bcf66/platform/android/display_server_android.cpp#L522

Alexia-AT-Digitecnology commented 2 years ago

Did you have set in the buildserver the GLES3_ENABLED option in android export template @Calinou? Do you use Azure Pipelines to deploy the builds?

akien-mga commented 2 years ago

Vulkan is hardcoded here, GLES3 can't be used yet: https://github.com/godotengine/godot/blob/4bbe7f0b98de72d6dd77d5ade4b761de375bcf66/platform/android/display_server_android.cpp#L492

Edit: This was fixed by #69355.

MiloThatch4 commented 1 year ago

I had the same issue. I was able to switch the renderer to gl_compatibility in Godot 4.0.beta10 and that fixes it.

giulong commented 1 year ago

had the same issue on Android export using Godot 4.0.2.stable. Disabling Use Texture Padding in the TileSet atlas properties as suggested in this comment by @Calinou fixes it.

clayjohn commented 11 months ago

This was likely fixed by https://github.com/godotengine/godot/pull/84852 Which will be part of 4.2.1. Once 4.2.1, please test again and confirm

clayjohn commented 5 months ago

Can anyone reproduce this in 4.2.1 or later?