Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    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

    Using "nearest" filtering setting on the texture fixes the issue, no white is visible at the edge of the texture then:
     
    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?
    Easy to use UMG Mini Map on the UE4 Marketplace.
    Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

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

    Comment


      #3
      Originally posted by KVogler View Post
      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).
      Easy to use UMG Mini Map on the UE4 Marketplace.
      Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

      Comment


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

        Comment


          #5
          Originally posted by jonimake View Post
          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
          Follow me on Twitter!
          Developer of Elium - Prison Escape

          Comment


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

            Comment


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

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


              With clamped sampler:



              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.
              Last edited by Deathrey; 08-08-2017, 08:17 AM.

              Comment


                #8
                Originally posted by jonimake View Post
                Another solution could be to enable precise UVs, I think it's in the static mesh settings.
                I tried more precise UVs, that doesn't affect the issue.

                Originally posted by Deathrey View Post
                solution
                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!
                Easy to use UMG Mini Map on the UE4 Marketplace.
                Forum thread: https://forums.unrealengine.com/show...-Plug-and-Play

                Comment

                Working...
                X