Search Unity

Clamped texture bleeds if camera is far away [Resolved]

Discussion in 'Shaders' started by kiriri, May 22, 2015.

  1. kiriri

    kiriri

    Joined:
    Jan 14, 2011
    Posts:
    107
    Hi,
    I'm fairly new to shaders. I have a 512x512 texture for a tattoo on a character. I'm using lerp in my shader to add it to the base textures color. I'm using clamp mode in my texture. And I'm clamping it to a very small space (scale is 30/30).
    My problem is, any part of the texture that is close to the border (close as in like 10px from the border) gets smeared along the entire length of that axis. I can fix this by adding a larger margin. However, when I move my camera further away, this happens again. If I move the camera far enough the entire character will be covered in the color of the tattoo

    A picture of both the closeup view with the smear and a faraway view with both x and y smears as well as the beginning of the overall color is in the attachments. Please bear in mind that the tattoo is supposed to be only as wide as it is tall. The entire long line is an undesired smear :(

    This issue occurs on both my laptop's intel graphic chip and my desktop's nvidea gforce 660 so I asume it's universal.

    Any ideas on what this is or how I could fix it would be greatly appreciated!
    Thanks,
    kiriri

    PS: I hope this hasn't been asked already, I did google it but all topics I found addressed different issues.
     

    Attached Files:

    Last edited: May 23, 2015
  2. kiriri

    kiriri

    Joined:
    Jan 14, 2011
    Posts:
    107
    I have handed this in as a bug report because I couldn't find a solution. There is one however :

    Quoting the last post on http://fogbugz.unity3d.com/default.asp?699058_8dn4v70ba0chnb8b, by Aras Pranckevicius
    The "Border Mip Maps" setting appears under "Generate Mip Maps"

    So while I'm sorry I had to bother the developers with this one, I hope other users with the same problem will now find it via google here.
     
    Last edited: Jun 2, 2015