Search Unity

Blurry textures on Android (with Gear VR)

Discussion in 'World Building' started by danielesuppo, Feb 24, 2019.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello all,
    I've 16 big terrains, covering about 30 sqKm of real world.
    Each of them use a Google Maps ortophoto (I've used World Composer to create this huge area).
    I should use them in Gear VR, and I'd like all the textures to be sharp enough on far distance too.
    To achieve this I've:
    1) increased the "Aniso Level" of each texture to 16.
    2) Increased the "Base Texture Resolution" of each terrain to 2048 from "Terrain Settings" (maybe this is useless but I've tried...).
    3) I've put this script on each terrain to expose and increase the "Base Map Distance" to a very high number (50000)

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System;
    4.  
    5. [Serializable]
    6. public class TerrainDetail : MonoBehaviour
    7. {
    8.     public int heightmapMaximumLOD;
    9.     public float heightmapPixelError;
    10.     public float basemapDistance;
    11.     public bool castShadows;
    12.     public bool draw;
    13.     public float treeDistance;
    14.     public float detailObjectDistance;
    15.     public float detailObjectDensity;
    16.     public float treeBillboardDistance;
    17.     public float treeCrossFadeLength;
    18.     public int treeMaximumFullLODCount;
    19.  
    20.     public TerrainDetail()
    21.     {
    22.         heightmapPixelError = 5;
    23.         basemapDistance = 5000;
    24.         draw = true;
    25.         treeDistance = 20000;
    26.         detailObjectDistance = 250;
    27.         detailObjectDensity = 1;
    28.         treeBillboardDistance = 200;
    29.         treeCrossFadeLength = 50;
    30.         treeMaximumFullLODCount = 50;
    31.     }
    32.  
    33.     void Start()
    34.     {
    35.         Terrain terrain = (Terrain)GetComponent(typeof(Terrain));
    36.         terrain.heightmapPixelError = heightmapPixelError;
    37.         terrain.heightmapMaximumLOD = heightmapMaximumLOD;
    38.         if (terrain.GetComponent("ReliefTerrain") == null)
    39.         {
    40.             terrain.basemapDistance = basemapDistance;
    41.         }
    42.         terrain.castShadows = castShadows;
    43.         if (draw)
    44.         {
    45.             terrain.treeDistance = treeDistance;
    46.             terrain.detailObjectDistance = detailObjectDistance;
    47.         }
    48.         else
    49.         {
    50.             terrain.treeDistance = 0;
    51.             terrain.detailObjectDistance = 0;
    52.         }
    53.         terrain.detailObjectDensity = detailObjectDensity;
    54.         terrain.treeMaximumFullLODCount = treeMaximumFullLODCount;
    55.         terrain.treeBillboardDistance = treeBillboardDistance;
    56.         terrain.treeCrossFadeLength = treeCrossFadeLength;
    57.         terrain.treeMaximumFullLODCount = treeMaximumFullLODCount;
    58.     }
    59. }


    Well, now in Editor far textures are still too blurry, but when I press "Play" everything is wonderful, with soo sharp textures because of the "Terrain Detail" script.

    My problem is that on my Gear VR the textures are still blurry, just like in Editor in non-Play mode...
    Just like the "Terrain Detail" script was not working...
    I've also set quality for both PC and Android to the same level, but nothing change, textures are still blurry on mobile.

    Any help on it would be much appreciated!
    Many thanks!
     
    Last edited: Feb 24, 2019