Search Unity

[SOLVED] Terrain blurry texture

Discussion in 'General Graphics' started by henmachuca, Sep 22, 2020.

  1. henmachuca

    henmachuca

    Joined:
    Oct 14, 2016
    Posts:
    105
    Hello there,

    For some reason I have a simple ground texture applied to my terrain, and whenever I hit play, the camera renders everything just fine up until a point, and after that the texutre becomes blurry.
    I took the picture below so you can see what I mean... (The red line I drew myself to show where the shift happens)

    upload_2020-9-22_16-23-58.png

    Any ideas what may be causing this?
    I'm using the URP with default settings.

    Thank you.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,340
    That's just what bilinear filtering looks like. You probably want to enable at least trilinear filtering for your textures, or maybe anisotropic filtering.

    By default all textures are set to use Filter Mode > Bilinear. You can manually override textures to use Trilinear, or you can set the Aniso Level to something other than 0 or 1. Or you can go to your project's Quality settings and change Anisotropic Textures to Forced On. This will force any texture not set to Filter Mode > Point and using an Aniso Level of 1 to 9 effectively use an Aniso Level of 9.

    On mobile anisotropic filtering can be quite expensive, potentially dropping your frame rate in half or worse at the higher values, and still being a potentially large hit at lower values if those textures cover a large part of the screen.

    On PC you can slide that Aniso Level all the way to 16 on every texture in the game and you'd be hard pressed to notice a difference on even the slowest integrated GPUs.

    I wrote an article that goes into the visual differences between bilinear, trilinear, and anisotropic filtering here:
    https://medium.com/@bgolus/sharper-mipmapping-using-shader-based-supersampling-ed7aadb47bec
     
    Coderious and henmachuca like this.
  3. henmachuca

    henmachuca

    Joined:
    Oct 14, 2016
    Posts:
    105
    Awesome! Thanks for the very helpful insight.
    It worked out for me.
     
  4. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    @bgolus I did all that and it didn't fix the issue. The weird part is that the same textures used in a material using the HDRP/TerrainLit shader look good, but when used in my own shader graph, they do not. Either it is not related to the mipmaps settings or the TerrainLit shader overrides them.


    Do you have any idea how to fix this?
    Thank you