Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Terrain - setting drawInstanced at runtime

Discussion in '2018.3 Beta' started by sstrong, Oct 31, 2018.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    Setting drawInstanced on a existing terrain in the editor works fine in 2018.3.0b7. However, when set on a new terrain at runtime in LWRP, the shader doesn't render. Is this a know problem and are their any workarounds?
     
  2. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    74
    Does it work if, instead, you have instancing enabled, and disable it at runtime?
     
  3. ChrisTchou

    ChrisTchou

    Unity Technologies

    Joined:
    Apr 26, 2017
    Posts:
    74
    (I'm thinking it is because the instanced shaders are not built if instancing is disabled at build time..)
     
    NathanJSmith likes this.
  4. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,255
    The terrains get created at runtime in our tool (in this scenario), so guessing this approach won't work.
     
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,620
    Add two terrains, one with with and one without instancing, to a dummy scene and add this scene to the "Scenes Included in Build" list?