Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TileMap rendering error after Android export. #71020

Open
Atem1995 opened this issue Jan 7, 2023 · 15 comments
Open

TileMap rendering error after Android export. #71020

Atem1995 opened this issue Jan 7, 2023 · 15 comments

Comments

@Atem1995
Copy link

Atem1995 commented Jan 7, 2023

Godot version

4.0 Beta 10

System information

Window10

Issue description

As shown in the figure, there is always a problem with TileMap rendering after Android is exported. Does anyone know what the problem is?
ba75665e24760d9113a8f534d930e1c

If it is exported on PC, there is no problem.
捕获

Steps to reproduce

Minimal reproduction project

@Zireael07
Copy link
Contributor

Most likely related to low precision on Android

@Atem1995
Copy link
Author

Atem1995 commented Jan 7, 2023

Most likely related to low precision on Android

@Zireael07 This question is very strange. I didn't remember it at first, but it has appeared since I used "Scenes collection" in TileMap; I'm not sure if it has anything to do with this. I want to do some more tests and then have a look.

@Atem1995
Copy link
Author

Atem1995 commented Jan 7, 2023

@Zireael07
6ed1a75894c37f9d948658bdc864784
91298682aadb7f74ecce11fe86b8dc8
I think I found the problem, mainly the rendering problem caused by using "Scenes collection", but I don't know how to solve it. Please, everyone.

@Atem1995
Copy link
Author

Atem1995 commented Jan 7, 2023

@Zireael07
I found a solution, probably because "Scenes collection" can't be placed in the same "TileSet" resource as the common mapping resource. If it is hierarchically separated as shown in the figure, there seems to be no error.But at this time, the display of "Scenes collection" will go wrong again.Please look at the tile display of the house
捕获
fa5bca9004388b50a69a646255f5228
微信图片_20230108011111

@akien-mga akien-mga modified the milestones: 4.0, 4.x Feb 22, 2023
@akien-mga
Copy link
Member

We would need a minimal reproduction project to debug further, i.e. a zipped project with only the minimal setup necessary to reproduce the bug which we can export to PC and Android to compare.

@cobouti
Copy link

cobouti commented Mar 25, 2023

I encountered the same problem while making my game.

Version: Godot 4.0
System: Windows 10

Issue Description:

Tilemap renderer breaks in scenes with overlapping TileMaps after Exporting to Android

Screenshot_2023-03-25-14-55-03-476_test render
Poco X4 GT

19bb93e1-240e-49f1-a819-9d12c558b10f
Samsung A30s

Screenshot_20230325_145426_Android_Tile_Rendering_Test
Samsung Galaxy S20 FE

Steps to Reproduce:

1 - Create new project
2 - Configure Exportation for Android following: https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html

3 - Set Project Setting Display/Window/Stretch to:
3.1 - Mode : Viewport
3.2 - Aspect : Expand

4 - Create 2D scene
5 - Add Tilemap
6 - Add second Tilemap with transparency in the sprite
7 - Overlap the tiles of the two TileMaps
8 - Export to Android

Minimal Project

Android Tile Rendering Test.zip

@Calinou
Copy link
Member

Calinou commented Mar 25, 2023

The TileSet editor creates a new texture with one-pixel padding around each tile to avoid issues with filtering being enabled. Can you reproduce this if you disable Use Texture Padding in the TileSet atlas properties then export to Android again?

image

@cobouti
Copy link

cobouti commented Mar 25, 2023

This seems to fix it. Test project now:
image0

Game without fix:
Screenshot_2023-03-24-17-35-17-739_mecha game

Game with fix:
Screenshot_2023-03-25-15-24-05-440_mech game

@Atem1995
Copy link
Author

Atem1995 commented Mar 25, 2023 via email

@Kaffeine
Copy link

Thanks @Calinou!
Disabling Use Texture Padding also fixes the rendering issue for me.

@panreyes
Copy link

This error has also happened to me in one of my games. In my case I also solved it by deactivating "Texture padding", but I also noticed that the first tileset had no glitches, but the tilesets after that were damaged.

It also seems that the second tileset picks up part of the pixels of the first tileset.

The error probably occurs near here:

void TileSetAtlasSource::_update_padded_texture() {

@akien-mga akien-mga changed the title 【Android Tilemap Rendering Bug】TileMap rendering error after Android export. TileMap rendering error after Android export. Oct 20, 2023
@gravit22
Copy link

gravit22 commented Oct 20, 2023

Then "Use Texture Padding" should be turned off by default

@panreyes
Copy link

Then "Use Texture Padding" should be turned off by default

Texture Padding helps a lot avoiding graphical artifacts when scaling tilemaps.

Disabling "Use Texture Padding" can be a temporary patch to avoid having more intense graphical artifacts, but it is not the solution.

@Atem1995
Copy link
Author

Atem1995 commented Oct 27, 2023 via email

@clayjohn
Copy link
Member

clayjohn commented Dec 6, 2023

This was likely fixed by #84852 Which will be part of 4.2.1. Once 4.2.1, please test again and confirm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

10 participants