Search Unity

Terrain missing on build

Discussion in 'Editor & General Support' started by LewisMather97, Aug 8, 2019.

  1. LewisMather97

    LewisMather97

    Joined:
    May 26, 2017
    Posts:
    2
    Hey folks,
    When I make an android build, the terrain object in a prefab in not showing. I've added a check in code to make sure the object is there and it is being found, it's just not displaying the texture. I've tried adding the texture and any related prefabs to the resources folder, but even so other prefabs like trees and buildings situated in the same folder are still showing. I've also tried playing around with the texture settings, such as changing the material setting to the legacy versions but nothing has worked so far.
    Any help would be much appreciated!
     
  2. zukesZen

    zukesZen

    Joined:
    Sep 16, 2018
    Posts:
    5
    Hello,

    I think I have similar problem going on, if I understood you correctly. I have tried to tweek some properties, but nothing seems to do any difference. So in the build the terrain isn't visible. Any ideas?

    Here's a screenshot from mobile, where the terrain isn't visible. It's there however, because I can drive on the terrain, but I just cannot see it.
    upload_2019-8-10_22-45-22.png

    Here's a screenshot from the same location in editor, where the terrain is visible.
    upload_2019-8-10_22-47-22.png
     
  3. LewisMather97

    LewisMather97

    Joined:
    May 26, 2017
    Posts:
    2
    Seems like we have the same issue then. I haven't managed to fix it yet, spent hours trying different things. Have you fixed it yet?
     
  4. zukesZen

    zukesZen

    Joined:
    Sep 16, 2018
    Posts:
    5
    No, unfortunately I haven't. I have spent two days now with this issue without any tangible results. I'm not sure if this is a terrain issue or a camera issue, because in other terrain I'm able to see it, but it's rendered incorrectly. While I drive around sometimes it's rendered and sometimes it just totally invisible. However all the other object are rendered.

    upload_2019-8-12_21-30-29.png


    Let me know if you come up with something.
     
  5. SanderGoal043

    SanderGoal043

    Joined:
    Feb 13, 2017
    Posts:
    9
  6. Ony

    Ony

    Joined:
    Apr 26, 2009
    Posts:
    1,977
    Just ran into this problem and yup, had to turn off "Draw Instanced", which solved it.
     
  7. bruceweir1

    bruceweir1

    Joined:
    Nov 29, 2017
    Posts:
    15
    Ditto for a WebGL deployment in Unity 2019.4.11.

    Terrain textures are not rendered when "Draw Instanced" is enabled. The geometry is all there though.
    It works fine when "Draw Instanced" is disabled.
     
    JamesWjRose likes this.
  8. azcoffeehabit

    azcoffeehabit

    Joined:
    Jun 14, 2015
    Posts:
    18
    I recently ran into a similar issue on Unity 2021+.

    I ended up creating a custom material (Using HDRP/TerrainLit as the base) and then enabling Instancing on the material and then create the terrain and set the materialTemplate as below.

    terrainObject.GetComponent<Terrain>().materialTemplate = Resources.Load<Material>("Material/HDRPLitGround");