Search Unity

2019.2: Overriding shaders of Terrain-Grass

Discussion in 'Shaders' started by Selupsis, Aug 9, 2019.

  1. Selupsis

    Selupsis

    Joined:
    Mar 17, 2019
    Posts:
    5
    Hi!

    For my project I'd like to modify the shader that is used to render the grass-meshes that I paint on the terrain with the Unit tools. However, following the instructions I have found I still cannot modify the shader...

    Here's what I tried:
    • Downloaded the built-in shaders for the correct version
    • copied the shaders into the Assets-folder
    • Tried to modify the shader "Hidden/TerrainEngine/Details/WavingDoublePass"
    However, the grass always renders the same, even if I e.g. change the color in the shader

    I tried tips that I found, like hitting the "Refresh"-Button for the according Detail-Stencil in the according details setting, reloading the project, creating a new terrain... Neither the grass-shader, nor the VertexUnlit-shader that I can choose when creating a mesh-detail brush are affected...

    I remember it working in a 2018.x-Version of Unity, did something change in the meantime?

    I'm currently working in a LWRP-project, but I also created a quick "normal" 3D-test-project, and it also did not work there...
     
  2. Aerial_Knight

    Aerial_Knight

    Joined:
    Aug 9, 2012
    Posts:
    84
    Did it ever find a solution? I have been trying to get grass to render in LWRP for about a week now with no luck
     
  3. tmcthee

    tmcthee

    Joined:
    Mar 8, 2013
    Posts:
    38
    Not sure about the details of the grass shader but the name "WavingDoublePass" is a clue for me.
    LWRP only allows single pass shaders.
     
  4. Selupsis

    Selupsis

    Joined:
    Mar 17, 2019
    Posts:
    5
    No luck so far, I'm thinking about implementing something on my own, since I don't know if/when this will be fixed...

    It would make sense - only the Vertex shader you can pick is a singlepass shader as far as I remember, and it too doesn't work... Might be wrong though!
     
  5. Selupsis

    Selupsis

    Joined:
    Mar 17, 2019
    Posts:
    5
    I'll try a simple project with a 2018.x later to see if it works there - it's not an option for me to jump back to an older version, but it might be a useful information for others
     
  6. Selupsis

    Selupsis

    Joined:
    Mar 17, 2019
    Posts:
    5
    Sorry, I missed a part there - the grass doesn't render at all for you with the standard shaders in LWRP? Because for me it renders at least with the default shaders
     
  7. Selupsis

    Selupsis

    Joined:
    Mar 17, 2019
    Posts:
    5
    Ok, I did a quick test with 2018.4.6f1, and there overwriting of shaders definitley works - the overwritten shader is definitley loaded as soon as I drag it into the project.

    However, I'm now at the same stage as Aerial_Knight, as the shader does not work (grass is only rendered in pink and does not move), so perhaps there is really a problem with using multipass-shaders... I'll try out a few things I have found