Prevent texture from repeating itself at the edge? (texture filtering issue)

I have a mesh where I’m tiling a texture on two times. This is the texture:

And this is how it looks like on the mesh:
[spoiler]

[/spoiler]
You see that at the edge at the bottom, there are white pixels even though the texture should be fully black there. The texture seems to start tiling again, so it starts repeating the white part from the top of the texture. That’s wrong. I don’t want to have such artifacts on my meshes.

This is the mesh from different perspective:
[spoiler]

[/spoiler]
Using “nearest” filtering setting on the texture fixes the issue, no white is visible at the edge of the texture then:
[spoiler]

[/spoiler]
Nearest filtering is very ugly though, especially regarding aliasing on textures in the distance. So I can’t use that.

How can I fix this issue so that the texture won’t start repeating itself too soon at the edge, with still having regular filtering on the texture?

Check the UV maps of your mesh. Make sure its not skewed.

The UVs on the mesh are fine. On the images I’m using the default engine cube mesh (/Engine/BasicShapes/Cube).

You can set the texture itself to use clamped UVs instead of wrapped UVs.

but then the texture won’t tile like it’s doing on the surface :wink:

1 Like

Another solution could be to enable precise UVs, I think it’s in the static mesh settings.

X-Post from Discord if anyone would need this:
With wrapped sampler:

https://image.prntscr.com/image/mcoxbUDeQU2UML_zJS6Svw.png

Still not enough to fully cover anisotropic filtering, but generally helps to some degree.

With clamped sampler:

https://image.prntscr.com/image/oqFyaYGwSwWuVRm_zZx0Xg.png

Mip map generation also needs to be taken into account, as it blurs the edge. It is preferable to import custom mips, but generally Sharpen generation settings is sufficient.

I tried more precise UVs, that doesn’t affect the issue.

Deathrey found the solution for the problem! The texture sampler has to be set to clamped, and with that input it will still tile correctly even though it’s set to clamped. It works great, I didn’t find any issue with it. Thanks a lot Deathrey! :slight_smile: