Search Unity

[Solved] Terrain Layers not working with LWRP in upgraded project.

Discussion in 'World Building' started by Sun-Dog, Mar 18, 2019.

  1. Sun-Dog

    Sun-Dog

    Joined:
    Mar 23, 2009
    Posts:
    144
    I've been googling around for a few hours and now I'll just give up and ask...

    I have a scene that I've upgraded to 2018.3.9f1. Unity created a folder called _TerrainAutoUpgrade and created new terrain layers. They show up with the wonderful pink broken shader color when viewed in the scene. The terrain layers themselves seem to be fine.

    If I check under the terrain settings I see this:
    47a0af76ac5e09d09be3cd14ebc4543f.png

    "Ok!" I say. "The terrain is using the Standard Shader. These need to use a LWRP compatible shader!"

    But if I choose "Custom", I can't assign a shader, a slot appears and it apparently wants a MATERIAL!

    I can put a material into that slot:
    17c8e6ae5a8692f42afe8932784f9ee8.png

    But if I do, then the terrain is mapped 1:1 with the material (texture/shader) - which is ridiculous - and the system seems to ignore the terrain layers and the spat map.

    How do I upgrade the terrain layers to use the LWRP so they work on the terrain?

    P.S.: There is some talk about selecting "Draw Instanced" as a solution, but no: Draw Instanced simply makes the terrain invisible... and then the psychedelic artifacts come out when the scene view camera is moved.
     
  2. Sun-Dog

    Sun-Dog

    Joined:
    Mar 23, 2009
    Posts:
    144
    Interesting: It seems that *UPGRADED* terrain may be broken!

    This is an image of the inspector of a new terrain:
    08abc4f18390238f1722cdd30eddb623.png

    Notice that there is a "TerrainLit" material but no texture applied?

    This is the image of the upgraded/converted terrain:
    7aa18925d19b0db7c4e796da9b316c3b.png

    Between Settings and Terrain Layers there is NOTHING and no way to set or select the base shader.

    Took me a while to notice that... :-/

    I'll try to find a workaround, but if anyone has any hints or suggestions, I'll take them.
     
  3. Sun-Dog

    Sun-Dog

    Joined:
    Mar 23, 2009
    Posts:
    144
    Figured it out.

    The "TerrainLit" material needs to be added in the settings tab!
    e459cf87aa825519cb89b3946238bd89.png

    Terrain Lit can be found in the packages that come with the LWRP here:
    375c088eb6a8aa547bf89eb07fe22de4.png
     
    BollyFlex, Braza, Quast and 1 other person like this.
  4. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Glad the terrain shader is set up for LWRP, not so great that the Tree Creator shaders don't work!
     
    rthom likes this.
  5. herrenderschoepfung

    herrenderschoepfung

    Joined:
    Nov 18, 2016
    Posts:
    5
    Also works by creating a new material with the default shader "Lightweight Render Pipeline/Terrain/Lit" and linking it to the terrain in the debug inspector.
     
    TheHiss likes this.
  6. B1QQ

    B1QQ

    Joined:
    Aug 16, 2018
    Posts:
    10
    thank you.
     
  7. Batz_

    Batz_

    Joined:
    Nov 22, 2019
    Posts:
    1
    THANK YOU! This is the only thing that's worked for me!!!
     
  8. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    Thank you very much for this AMAZING information.

    I want to add this little detail too. This little button is very important because it unhides package materials in asset picker window so you can see TerrainLit material.

     

    Attached Files:

    undevable and hipoldo like this.
  9. dyncoch

    dyncoch

    Joined:
    Jun 6, 2020
    Posts:
    1
    Thank you! Solved my problem!
     
  10. kiko-allouache

    kiko-allouache

    Joined:
    May 2, 2017
    Posts:
    4
    i could fix the trees, the terrain but not the grass? how to fix that, there's no way to change the shader of the grass, & the lwrp package doesn't come with a grass shader anyway
     
  11. morrhugg

    morrhugg

    Joined:
    Oct 17, 2020
    Posts:
    3
    Thank you, this helped me solve why my Terrain materials always kept reverting to Standard shader.
     
  12. kamalaswal40

    kamalaswal40

    Joined:
    Feb 9, 2021
    Posts:
    4
    thank you so much you save my month