Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity Terrian Billboard Grass vanishes on camera distance

Discussion in 'General Graphics' started by Frogger007, Sep 11, 2017.

  1. Frogger007

    Frogger007

    Joined:
    Jun 24, 2014
    Posts:
    338
    Do you have ever had the situation that your unity billboard terrain grass vanishes on distance ?
    Only be visible on close camera distance ?

    I have had the same issue !

    Everytime the camera to grass distance gets greater all billboard grass objects vanishes and are only visible on very close distance.

    Then i have found a solution for this situation.

    I have previously imported the grass billboard textures with this import settings:
    Import1.jpg
    view1.jpg

    Then i have changed the import settings:
    Import2.jpg
    Important the 'Generate Mip Maps' option must be unchecked !

    view2.jpg

    Additional you can set 'Detail Distance' to 250 and 'Detail Density' to 1.
     
  2. Frogger007

    Frogger007

    Joined:
    Jun 24, 2014
    Posts:
    338
    'Detail Distance' and it's influence on the unity grass:
    DetailDistance.jpg
     
  3. Frogger007

    Frogger007

    Joined:
    Jun 24, 2014
    Posts:
    338
    'Detail Density' at it's influence on the unity grass:
    DetailDensity.jpg
     
  4. Frogger007

    Frogger007

    Joined:
    Jun 24, 2014
    Posts:
    338
    With this little sketch can you set the grass wavy speed and strength:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class WindSettingsForTerrainGrass : MonoBehaviour
    5. {
    6.     [Header("Terrain:")]
    7.     public Terrain terrainObject;
    8.  
    9.     [Header("Terrain Grass Wavy Speed:")]
    10.     public float grassWavySpeed;
    11.  
    12.     [Header("Terrian Grass Wavy Strength:")]
    13.     public float grassWavyStrength;
    14.  
    15.     void Start ()
    16.     {
    17.         if (grassWavySpeed < 0.0f)
    18.             grassWavySpeed = 0.0f;
    19.         else if (grassWavySpeed > 1.0f)
    20.             grassWavySpeed = 1.0f;
    21.         if (grassWavyStrength < 0.0f)
    22.             grassWavyStrength = 0.0f;
    23.         else if (grassWavyStrength > 1.0f)
    24.             grassWavyStrength = 1.0f;
    25.         terrainObject.terrainData.wavingGrassSpeed = grassWavySpeed;
    26.         terrainObject.terrainData.wavingGrassStrength = grassWavyStrength;
    27.     }
    28. }