Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Impossible to overwrite terrain grass shader in URP

Discussion in 'Shaders' started by joakim219, Jul 27, 2020.

  1. joakim219

    joakim219

    Joined:
    Nov 11, 2016
    Posts:
    7
    Hello,

    I'm looking for a way to make changes to the billboard shader used by Unity's terrain for rendering detail. However, despite looking into the matter for several days I still haven't found a feasible way to achieve this.

    I found out that there is an asset called UniversalRenderPipelineEditorResources in the URP package which contains fields for which shaders to use.


    I went ahead and made a copy of this asset and referenced the shader I want to use, but was faced with a problem. There's no way to set my copy of this asset to be used by the active Universal Render Pipeline Asset. By taking a look at the UniversalRenderPipelineAsset.cs source code, I noticed it's impossible to change it. Any changes I make to this file are reverted by Unity.


    I read that Unity overrides any built in shaders as long as you name your custom shader with the same name. However, I tried this and the grass on my terrain wasn't affected by my custom shader. And I don't see why this would work when there is a direct reference to the shader to be used in the EditorResources asset.

    The only way I've found around this is not a feasible solution. I can make a copy of the complete URP Package and make my changes there. However, making a copy of this package is bad idea in terms of future URP Package updates and the fact that I would have to sync this whole package over the collab just to share my modified grass shader with my team.

    Any help is appreciated. Thanks for reading!
     
  2. wechat_os_Qy09oQj46wCoXNKXVCJThpiEg

    wechat_os_Qy09oQj46wCoXNKXVCJThpiEg

    Joined:
    Jan 11, 2021
    Posts:
    3
  3. Nefron

    Nefron

    Joined:
    Jun 21, 2013
    Posts:
    6
    Having the same issue! Dev team is probably not going to fix this, does anybody know a good grass replacement that works in URP and has similar/better performance than Terrain grass? And runs on the Quest? (GPU instancing is broken apparently)
     
  4. ysundawa

    ysundawa

    Joined:
    Mar 2, 2020
    Posts:
    33
    i browse the internet for exactly the same problem.... I need to know how to replace the default terrain grass shader in URP 10.2.2... seems like i am not the only one having this problem
     
  5. Gnoblar_agency

    Gnoblar_agency

    Joined:
    Sep 20, 2012
    Posts:
    8
    Same here.
    I need to use a custom shader for terrain detail meshes in URP but I can't find a way to do this.
     
  6. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    You still do not understand that unity *RP teams don't want to allow you to change anything?
     
  7. HanJeongSeop

    HanJeongSeop

    Joined:
    May 20, 2019
    Posts:
    1