Textures blurry from some distance but normal when very close

As the title is saying, i get in both the rendered game and in the editor a very blurry ground texture when moving away from the textured location.

Like in this image:

  1. Is when i hold left mouse button and how it should normally be
  2. When i release the left mouse button it becomes blurry at that distance and how it looks in the game when playing untill i get very very close
  3. Without holding left mouse button but when very very close (how it should be from far away too)

Additional info:
Because the mountains that i want to put the texture on are very big , i use in the terrain add texture the size: x:1000 and y:1000 (did 15 too and it still gets blurry) ; 0 offset ;0 metalic ;0 smooth

What i have tried to fix the problem:
-aniso level to max (16)
-texture is 2048x2048 RGB 24 bit
-filter mode from bilinear to trilinear

If someone can suggest something to me, i am willing to try.
Thank you

What Mip Map settings do you have for the texture?

It might be worth setting the mip map filtering on your textures to Kaiser instead of Box, and see if that helps.

I have tried disabling / enabling / changing every setting at mipmap and there is no difference , it’s still as blurry.

I have tried that and sadly i get the same blurry effect.

The solution to the problem is this:
You make a C# Script and put this code in:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]

public class TerrainBlurryTextureFix : MonoBehaviour {
    //Add as Terrain Component and modify in text box
        public float BasemapDistance = 80000;
        private Terrain terrain;

        void OnEnable ()
        {
            terrain = GetComponent<Terrain> ();
            #if UNITY_EDITOR
            UnityEditor.EditorApplication.update += Set;
            #endif
        }

        #if !UNITY_EDITOR
        void Update ()
        {
        Set
        }
        #endif
    void OnDisable()
    {
        UnityEditor.EditorApplication.update -= Set;
    }
        void Set ()
        {
            if (terrain == null)
                terrain = GetComponent<Terrain> ();
            else if (terrain.basemapDistance != BasemapDistance)
                terrain.basemapDistance = BasemapDistance;
        }
    }

Just add this script as a component on the terrain in the inspector and modify the ammount of distance you want the script to render the texture for.

Also as another helpful script for distances , this is a Tree load distance:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]

public class TreeDistanceRender : MonoBehaviour {
    //Add as Terrain Component and modify in text box
    public float TreeDistance = 6000;
    private Terrain terrain;

    void OnEnable ()
    {
        terrain = GetComponent<Terrain> ();
        #if UNITY_EDITOR
        UnityEditor.EditorApplication.update += Set;
        #endif
    }

    #if !UNITY_EDITOR
    void Update ()
    {
    Set
    }
    #endif
    void OnDisable()
    {
        UnityEditor.EditorApplication.update -= Set;
    }
    void Set ()
    {
        if (terrain == null)
            terrain = GetComponent<Terrain> ();
        else if (terrain.treeDistance != TreeDistance)
            terrain.treeDistance = TreeDistance;
    }
}

Same as above just add this script as a component on the terrain in the inspector and modify the amount of distance you want the script to render the trees for.

1 Like

Thank you very much! That code works perfect in Edit mode. The only issue was when building it.

I modify the code slightly as follows to fix those errors in the build.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class TerrainBlurryTextureFix : MonoBehaviour
{
    //Add as Terrain Component and modify in text box
    public float BasemapDistance = 10000; // 10 km distance
    private Terrain terrain;

    void OnEnable ()
    {
        terrain = GetComponent<Terrain> ();
        #if UNITY_EDITOR
        UnityEditor.EditorApplication.update += Set;
        #endif
    }

    #if !UNITY_EDITOR
    void Update ()
    {
        Set();
    }
    #endif

    void OnDisable()
    {
        #if UNITY_EDITOR
        UnityEditor.EditorApplication.update -= Set;
        #endif
    }

    void Set ()
    {
        if (terrain == null)
            terrain = GetComponent<Terrain> ();
        else if (terrain.basemapDistance != BasemapDistance)
            terrain.basemapDistance = BasemapDistance;
    }
}

What about textures ? Does it work ?

@Icefinity & fjruizf, you’re heroes, dudes!

It does, indeed!