Search Unity

Terrain [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:
    142
    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:
    142
    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:
    142
    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
     
    Quast and ARLS like this.
  4. ROBYER1

    ROBYER1

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

    herrenderschoepfung

    Joined:
    Nov 18, 2016
    Posts:
    4
    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.