godotengine / godotengine/godot

Texture Padding in tileset causing visual glitches

Open
#90,545 3 comments 0 reactions 0 assignees View on GitHub
discussion documentation topic:2d
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Tested in latest stable 4.2.1 build only.

### System information

Windows 11 - Godot 4.2.1 - Vulkan Mobile renderer (Same happens in forward +)

### Issue description

First of all, the Tilemaps I add to my tileset always become transparent. To fix this issue I have to disable "Use Texture Padding" as seen here:

![image](https://github.com/godotengine/godot/assets/7636427/0906e7ab-c94d-4468-9616-4eb3af56458e)

And here with the option checked:

![image](https://github.com/godotengine/godot/assets/7636427/4ee9bd8f-f1a8-4754-9003-53b2cdad753a)

Now, after this "quick fix", when play testing I have many lines between the tiles on screen, as shown here:

![image](https://github.com/godotengine/godot/assets/7636427/6932730b-a47c-419f-a13a-811874089319)

What I tried to fix this:

- Set filter to nearest
- Import all textures as Vram compressed and high quality enabled

Now what half fix it:

Reimport the texture as lossless and set to generate mipmaps. The problem is, apart from not being ideal for a mobile game, while Texture padding now works, I still have few lines in some tiles like here:

![image](https://github.com/godotengine/godot/assets/7636427/2d70346f-845a-4923-8645-7795899f2db6)

Unfortunately I cannot share my tileset since it's a paid asset with licensing, but I'll do my best to add more to this discussion.

Edit:

Now I've noticed that after setting back to Vram compressed I get an error in the editor "Cannot blit_rect in compressed or custom image formats." Which is the culprit of not being able to use a VRAM compressed image and texture padding. Still that brings the line bugs from above.

### Steps to reproduce

Import a vram compressed texture in a tileset.

### Minimal reproduction project (MRP)

Can't share I'm afraid.

Contributor guide

Open the contributing guide

Research direction

Start by importing a VRAM-compressed texture into a Godot tileset with Use Texture Padding enabled, using the reported Windows 11 and Godot 4.2.1 renderer setup if available. Check the editor error about blit_rect and the visible lines or transparency between tiles; done means texture padding works without the error or visual glitches while preserving the relevant mobile texture workflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.