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

Pixel artifacts on model in 3D - Gets more prevalent the lower the resolution #91602

Open
Knairda0 opened this issue May 5, 2024 · 5 comments

Comments

@Knairda0
Copy link

Knairda0 commented May 5, 2024

Tested versions

  • Tested in 4.2.2.stable

System information

MacOS 14.4.1 - M1 Pro - Vulkan (Forward+) / Windows 11 23H2 - GTX 1060 6GB

Issue description

Pixel artifacts appear on the player character model in the 3D scene. The rogue pixels appear to be behaving with an "X-ray" effect, where it shows color of the geometry behind what should be rendered in front.

Notice how the artifacts become much more frequent and noticeable the lower resolution the game is set at. Videos of tested resolutions are as follows:

480x360.mov
640x480.mov
1080x720.mov
1920x1080.mov

Steps to reproduce

  1. Open the attached MRP and run the game.
  2. Walk around with A/D and jump with Space.
  3. Observe artifacts as the player model animates.
  4. Experiment with the resolution in Project > Project Settings > Window > Size.

I worked with the Godot Discord community to troubleshoot for a few days, including ensuring model LODs were turned off, changing rendering and AA settings, but nothing fixed the issue.

Minimal reproduction project (MRP)

Pixel Artifacts.zip

@lawnjelly
Copy link
Member

lawnjelly commented May 6, 2024

Have you got enough border area around each UV island? Typically you would use an automated dilate to duplicate edge texels around UV islands, but for drawn stuff, you can draw in the borders manually.

You need some kind of dilation to account for texture filtering, mipmapping, and filtering accuracy error.

Here's an example dilated texture:
frog1

Also I would double check there is no transparency selected for the material, it will run faster if opaque.

EDIT: Looks like photopea.com can do this. Just choose filter/3d/texture_dilation.

@huwpascoe
Copy link

Have you got enough border area around each UV island

Yep, confirmed it looking at their MRP

See that one pixel border, not enough. The moment mipmaps are generated, it's leaking into the rest of the image.
image

If I flood fill the transparent area blue, you can see a blue outline around the face
image

@lawnjelly
Copy link
Member

lawnjelly commented May 6, 2024

Dilated texture seems to fix it for me:

Lily

Here is more info on edge padding:
http://wiki.polycount.com/wiki/Edge_padding

@Knairda0
Copy link
Author

Knairda0 commented May 6, 2024

Thank you both for the valuable info and resources, I tried it out and it fixed the problem!

480x360.Fixed.mov

@Knairda0 Knairda0 closed this as completed May 6, 2024
@AThousandShips
Copy link
Member

Let's keep this open so we can document this solution

@AThousandShips AThousandShips reopened this May 6, 2024
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