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

Scanlines/fickering tilemap on NVIDIA laptop (Moiré patterns due to mipmap aliasing) #55241

Closed
Xarcaneo opened this issue Nov 22, 2021 · 13 comments

Comments

@Xarcaneo
Copy link

Godot version

Godot_v3.3.3-stable_win64

System information

Windows 10, GLES 3, INTEL(R) Core i7-7820HK CPU @ 2.90Ghz 8CPUs

Issue description

So I will appreciate any help because that project is important to me. I am making a game with 2D tilemaps but I have some problems with graphic glitches, I recorded video for you:
Glitch example 1
And also moved my tilemap to another project and there is the same problem, even in editor:
Glitch example 2

Pixel snap is on, filtering off, camera process mode set to physic, vsync on, I tried to switch from GLES3 to 2 but there is the same problem, I turned Nvidia rect ficker workaround but it doesnt help. I have no idea how to fix that. I tried GODOT 3.3.3 and 3.4

Steps to reproduce

Put the tilemap and player with camera then run the game and enjoy flicker.

Minimal reproduction project

No response

@clayjohn
Copy link
Member

Do the textures have mipmapping enabled? In the video, the artifacts look like mipmap artifacts from using mipmaps on a texture atlas.

@Xarcaneo
Copy link
Author

No, Ill show you settings for all my textures in project:
Bez tytułu

@lawnjelly
Copy link
Member

lawnjelly commented Nov 23, 2021

Not absolutely sure, aside from mipmapping as clayjohn says it could also possibly just be aliasing? (especially if filtering is off)
https://en.wikipedia.org/wiki/Aliasing

This will occur when the source texels do not match up to a regular number of pixels on screen, especially when filtering is off, and is especially noticeable in some textures.

@Xarcaneo
Copy link
Author

So what should I try to do?

@Calinou
Copy link
Member

Calinou commented Nov 23, 2021

You most likely need to enable Mipmaps to avoid visible Moiré patterns when the texture is not displayed at a 1:1 scale.

@Xarcaneo
Copy link
Author

Moiré patterns still visible with mipmaps enabled, I have to try to open project in another laptop and check if there is also this problem. Do you have any other suggestions?

@Calinou
Copy link
Member

Calinou commented Nov 23, 2021

@Xarcaneo Please upload a minimal reproduction project to make this easier to troubleshoot.

@Xarcaneo
Copy link
Author

reproduction.zip
Simple reproduction. Slower character movement == more visible effect. Effect only visible with camera on.

@lawnjelly
Copy link
Member

Yes it looks like aliasing between the viewport size (lower resolution rendered surface), and stretching it to fit on a fractionally scaled window. If you set the test window size to e.g. 960x640 (i.e. double the original) you don't get the problem, or presumably with other multiples 1:1, 2:1, 3:1 etc.

@Xarcaneo
Copy link
Author

Xarcaneo commented Nov 24, 2021

That's right, there is no Moiré patterns when I set that test windows size 960x640, but there are still visible gaps between tiles while e.g. jumping. For window size 1440x960 there are visible aliasing again, and I still have no idea how to make that project be able to resize to fullscreen on all PC devices without aliasing,.

@Calinou
Copy link
Member

Calinou commented Nov 24, 2021

For the record, this issue was cross-posted on the Godot forums: https://godotforums.org/discussion/28093/weird-graphic-behavior-in-pixelart-platformer

@Calinou Calinou changed the title Scanlines/fickering tilemap on NVIDIA laptop Scanlines/fickering tilemap on NVIDIA laptop (Moiré patterns due to mipmap aliasing) Nov 24, 2021
@Xarcaneo
Copy link
Author

Solution:
So I didn't give up and tried to figure it out what is going on so simply you was right, there is scaling on but no in the editor. I use Win10 that has scaling on by default in display settings 125%. When I changed it to 100 Moiré patterns disappeared. I wasn't satisfied by this solution because we can't force players to change scale of display when they play specific games so I found a setting Allow Hidpi and enabled it, now it work good even on scaled display. I also changed viewport to 640x360 and it also helped a lot coz can be easly multiplied to 1920x1080. For now I have only problem with flicker while camera is moving, it is not noticeable on video when I tried to record that and also tiles get blurry, if you guys gave any solution for that Ill appreciate.

@Calinou
Copy link
Member

Calinou commented Nov 25, 2021

Closing per the above comment. Enabling Allow Hidpi by default was rejected in the past, but it may be considered again now that built-in 3D resolution scaling is available.

We have no control over how Windows does its hiDPI scaling – only whether it's enabled (non-DPI-aware app) or not (DPI-aware app). Whether it chooses nearest-neighbor or linear scaling is something Windows does on its own.

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

4 participants