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

TileMaps show flickering vertical gaps when running the project #41900

Closed
Hevedy opened this issue Sep 9, 2020 · 6 comments
Closed

TileMaps show flickering vertical gaps when running the project #41900

Hevedy opened this issue Sep 9, 2020 · 6 comments

Comments

@Hevedy
Copy link

Hevedy commented Sep 9, 2020

Godot version:
v3.2.2.stable (Mono version)

OS/device including version:
Windows 10 Pro
Intel i7 (Old Gen)
Nvidia 970GTX with 441.20 driver.

Issue description:
At move using Tiled maps created inside the editor you get gaps randomly spawn in-game in vertical lines like if the world gets split or divided.
Whatever if you enable the Nvidia solution does nothing plus at enable it you get a drop from 1100FPS to 100FPS.

Steps to reproduce:
1.) Download the provided project or use any Tiled map project.
2.) Play the game and move sideways at some point you will notice the gaps randomly spawn that are pretty annoying.

Minimal reproduction project:
https://github.com/josephmbustamante/Godot-Top-down-Shooter-Tutorial

@lawnjelly
Copy link
Member

Do you have a screenshot? Is this GLES2 or GLES3?

@Hevedy
Copy link
Author

Hevedy commented Sep 9, 2020

GLES3
Godot_v3 2 2-stable_mono_win64_2020-09-09_20-50-27_Showcase

@lawnjelly
Copy link
Member

Will try the project out soon, in the meantime, have a look at this issue which is kind of similar and might give you some ideas for fixing it: #41696

@Hevedy
Copy link
Author

Hevedy commented Sep 9, 2020

Well is kinda random like happen once each 10 seconds or so, isn't a constant etc and the whole project seems to be set properly

@Calinou Calinou changed the title Tiled levels vertical gaps in-game TileMaps show flickering vertical gaps when running the project Sep 9, 2020
@lawnjelly
Copy link
Member

I had a quick look at the project, it's really too big to easily investigate, that's why we use minimum reproduction projects.

But it's very probably due to a lack of padding around tiles. With no scaling, or full integer scaling (i.e. x2, x3) you may be able to just about get away without any padding, but with freeform zoom / scaling you very probably will need padding around tiles.

This is due to things like floating point error in GPU etc calculations, where texels will be read across a boundary. We also offer a uv_contract option in GLES2 batching to help get around this kind of problem, but this is only available with batching path.

Really the best solution is padded tiles, with either a 1, 2, or 4 texel 'dilate' style padding, depending on whether you are using compressed textures (which tend to work in blocks of 4x4 texels), and / or whether you are using mipmaps.

This also applies doubly so for filtered textures (I don't think this project uses filtering, but worth mentioning).

As a quick solution, you could probably convert this project to gles2 with batching, and use uv_contract option in project settings->batching.

@Calinou
Copy link
Member

Calinou commented Oct 31, 2023

Thanks for the report! Consolidating in #39720, as this is due to the same cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants