Search Unity

[Released] Advanced Terrain Grass

Discussion in 'Assets and Asset Store' started by larsbertram1, Sep 11, 2017.

  1. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    @larsbertram1, ok, I think I have pinpointed more information.

    Im using deferred rendering.

    Ive read your docs:
    upload_2022-6-14_10-39-51.png
    But Im not sure what to change in the settings. Would you mind clarifying?
    upload_2022-6-14_10-39-0.png
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    you use deferred but with URP. the quoted information from the docs only refer to the built in render pipeline.
    so you can fully ignore them.
     
  3. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    @larsbertram1, by the way I tried adding the shaders to the "Always Included" list and then finally I could see the grass (after restarting as well). I'm in Unity 2022.1.4f1 with URP 13.8.1 by the way.

    It would be great to be able to set a Deferred checkbox in the material rather than needing to customize this list.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    i haven't checked URP 13.8.1. yet but it should not make a big difference compared to 12.1.
    anyway - i do not really understand what you have been talking about, sorry :)
    - the list "always included shaders" just makes sure that the added shaders will never be stripped from the fnal build. it should not have any effect in editor.
    - the atg urp grass shaders are referenced by the the grass manager in your scene. so they should never be stripped.
    - you can also set the material used by the grass prefabs added to the terrain to use the afs urp grass shaders to add a 2nd reference.
     
    backwheelbates likes this.
  5. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    Thanks for that info. Then i don’t know why things weren’t working. Anyways, it’s all working well now thank you!

    also, what is the difference between the stylized grass example and the realistic grass example. Is it just a simpler texture on the stylized grass? Are there any other big differences in the setup?

    thanks again!!
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    it is just the model and material.
     
  7. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    @larsbertram1, one more question for you. How do you handle multiple terrains? Can I use one grass manager for multiple terrains?
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    each terrain would need its own grass manager.
     
    backwheelbates likes this.
  9. Nanon413

    Nanon413

    Joined:
    Apr 5, 2016
    Posts:
    7
    Hi, i always got the problem with grass don't in writting build and i got all of that error after build Capture.PNG
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    the errors regarding the "includes" are ,ore than strange as i assume that the shaders look fine in editor?
    might be that you are just using a mismatching version of the shaders and URP.
     
  11. Nanon413

    Nanon413

    Joined:
    Apr 5, 2016
    Posts:
    7
    i think yes because i have try in unity 19.4 with urp 7.7 that work with no problem, but here with unity 2021.2.10f1 urp 12.1.4 i dont know what happen, i have try to put the saved shader variant to see if i got any change but nothing
     
  12. Foulcloud

    Foulcloud

    Joined:
    Mar 23, 2014
    Posts:
    19
    Unity terrain tool details icons are blank any time an ATG shader is used. This makes it hard for painting terrain details. Is there a fix or is this expected? I can add other terrain details with different shaders and both mesh details and grass show the handy icon. Tried a blank project and imported ATG and same problem in the demo scene. The same problem happens with just previewing a prefab - upper left "preview" icon in inspector is blank.
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    i am not sure if it is fixable. and it changed over the different versions of unity...
    easiest "fix" is to assign a different shader to the prefabs you add to the terrain. then only assign the atg shaders in the grass manager.
     
  14. Jijzo

    Jijzo

    Joined:
    Mar 28, 2020
    Posts:
    3
    I apologize if this has already been asked, but I can't find it anywhere. Is there a way to tell this program to NOT place grass somewhere? I want to place grass around pathways. Thanks!
     
  15. Jijzo

    Jijzo

    Joined:
    Mar 28, 2020
    Posts:
    3
    I think I figured this out! Just remove the necessary grass in edit mode before pressing play.
     
  16. PGiza

    PGiza

    Joined:
    Jul 22, 2019
    Posts:
    4
    Hi,
    I'm currently upgrading my project from Unity 2019.4.32 (Built-in Render Pipeline) to Unity 2021.3.4 (URP v 12.1.7) and with that I upgraded ATG from version 1.081 to newest 1.36.1.
    I'm having weird problem:
    I have a very simple scene with terrain, directional light and camera only, in edit mode I have grass visible and everything is great, but when I hit "Play" there is no grass whatsoever, then when I'm back in edit mode, grass still is not rendering until I delete the grass manager component and add it again.
    I don't get any warnings or errors, and "Full Demo URP" works fine. Have you ever come across something like that? I would appreciate any help.

    Edit: I've got same behaviour in Unity 2019.4.32 Built-in Render Pipeline when only updateing ATG from version 1.081 to 1.36.1
     
    Last edited: Aug 3, 2022
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    sounds like a problem with baked terrain data which has to be regenerated.
    other than that: check all meshes and materials in the grass manager.
     
  18. BKprod

    BKprod

    Joined:
    Sep 19, 2014
    Posts:
    21
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    first you should check the generated motion vectors.
    next tweak the taa settings. grass gives you a very noisy background compared to the terrain or the sky and i assume it is just caused by this fact.
     
  20. arminiuspp

    arminiuspp

    Joined:
    Jun 15, 2020
    Posts:
    54
    Hey mmm... how do implement the touch blend in ATG?
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    if you look for a solution for the built in render pipeline go to the first pages of this thread. i think around page 6-8 you will find a discussion covering this topic.
     
  22. arminiuspp

    arminiuspp

    Joined:
    Jun 15, 2020
    Posts:
    54
    No its for URP, I have vegetation studio pro and I have these all on ticked, though I am using grass manager still (Vegetation studio implementation is so much only need a simple grass bending) but my grass is not showing up now
     

    Attached Files:

  23. arminiuspp

    arminiuspp

    Joined:
    Jun 15, 2020
    Posts:
    54
    Grass just showed up! but it's not bending or anything (grass showed up after turning off "enable VSP support")
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    might be a bit confusing - but if you "enable VSP support" you have to draw the grass using VSP and not the grass manager. so all you use in this case from atg is just the shader.
    in order to make it bend in the wind you have to add the atg wind prefab to your scene: the shaders rely on wind being passed in as texture created and updated by the atg wind script.

    in order to make e.g. the "Generic Grass Prefab URP" being rendered by VSP using render mode = instanced indirect (which is the fastest) you have to turn on "enable vsp support" in the material inspector.
    finally - to make it bend in the wind - add the atg wind prefab to your scene. make sure you have disabled any other wind zone except for the one which is added to the atg wind prefab.
     
  25. arminiuspp

    arminiuspp

    Joined:
    Jun 15, 2020
    Posts:
    54
    Oohh wait I meant touch blend... Maybe more like, I still use ATG but Having touch blend
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    well, you have to enable the render feature first.
    go to the touch bending demo and make sure it works there. then go back to your vsp scene.
     
  27. Grober

    Grober

    Joined:
    Sep 25, 2018
    Posts:
    1
    Hey, Im using Unity 2020.3.32f1 and HDRP 10.8.1 and it does not recognize few things.

    In GrassCellContent
    upload_2022-8-13_17-42-58.png

    upload_2022-8-13_17-43-33.png

    upload_2022-8-13_17-43-13.png

    and in GrassManager
    upload_2022-8-13_17-44-38.png
    upload_2022-8-13_17-44-51.png
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    these are for/from hdrp 12. if you are using hdrp 10 you will have to downgrade atg by installing the old package for hdrp 10. but honestly: why don't you update to 12?
     
  29. TreyH

    TreyH

    Joined:
    Feb 6, 2014
    Posts:
    16
    Having trouble getting the bending / displacement to work with the ATG terrain grass.

    The demo within the Lux URP Essentials pack works well, but the replacement terrain grass doesn't seem to budge etc.

    upload_2022-10-3_19-18-50.png



    I skimmed through the forum and saw a few mentions of grass bending with terrains, and the asset mentions it on the store page, but the docs only mentioned touch bending as part of Vegetation Studio's interop.
     
  30. TreyH

    TreyH

    Joined:
    Feb 6, 2014
    Posts:
    16
    Oop nevermind, you have to enable them on the specific materials.

    For anyone else looking for this, you can quickly enable this by selecting the given prototype in the Grass Manager component:
    upload_2022-10-3_21-14-47.png

    and then enabling the touch bending setting on its material:
    upload_2022-10-3_21-13-28.png

    which should give something like:
     

    Attached Files:

    Willbkool_FPCS likes this.
  31. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    250
    OK this has been happening for now over a year, I've ignored it cause it was only happening during playback of the scene with test camera but now its happening in the actual game. I should of sought the issue a year ago when it first happened but I didnt.

    ISSUE = The grass is not being drawn at all, what could possibly be causing this?
    Render Settings - camera (main camera only/ all cameras) makes no difference
    how to debug?

    Queried cell:0 Visible Cells:0 Cells to Init:0

    EDIT:
    OK the problem may be related to cinemachine with following path

    If I add the following to grassmanager.cs ~1290

    print(Cam.name + " " + Cam.transform.position );

    it prints out eg Main Camera (-164.97, 50.39, 946.37)
    yet the camera is actually at eg (500,40,500) like it says in the inspector transform
    so how on earth is this happening

    EDIT: No need to answer, I've decided to drop cinemachine
     
    Last edited: Oct 24, 2022
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    well, you do not have to drop cinemachine. you just have to make sure that the camera is tagged properly.
    altrenatively you could hack the grassmanager and expose the camera in script and feed in your current one.
     
    zedz likes this.
  33. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    250
  34. bosko0509

    bosko0509

    Joined:
    Apr 13, 2018
    Posts:
    4
    Any chance this will soon get an HDRP 14.x/15.x update?
     
    Enmoore likes this.
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    i haven't checked but it should work in HDRP 14 as well. this time i decided to go with shader graph.
     
  36. asiertroiti

    asiertroiti

    Joined:
    Jan 28, 2021
    Posts:
    18
    hi, how do i make the grass align with the high ground? It's that I have mountains but I can't get the grass to maintain the direction of the elevation of the terrain
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    please have a look into the docs and the provided demo scenes.
     
  38. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Is there a quick start guide for this asset that is actually helpful? I need to know the requirements/components and setup to get this working from scratch. The HDRP Demo scene works in my project. If I prefab the minimal components in that scene and move them into my own, they also work.

    But following the unhelpful docs and adding the components manually to my own scene (and terrain) causes all sorts of problems (invisible/missing grass, grass all congregating at one spot and becoming pink, grass sometimes displaying briefly but having messed up transparancies etc).
    The quickstart portion of the docs is about 5 sentences that don't help, followed immediately by 'under the hood'. It's unclear how relevant the quick start demo scene is to the HDRP version of this asset given the HDRP Demo scene that comes with it.

    This is the closest I've gotten to replicating what is in the HDRP Demo scene by using the same grass prefab/shader/materials from that scene and simply adding them to my terrain.
    https://imgur.com/a/Y175umi Half the grass is missing and the grass that shows up is having a disco.
     
    Last edited: Jan 10, 2023
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    there are step by step tutorials...
    missing grass: atg does not 1:1 recreate the density from unity grass.
    disco might be the normal bending. try to set wind to 0.0 for the start.

    in general: missing grass is most likely caused by false materials or the wind prefab missing in your scene.
     
  40. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Where is this step by step tutorial? I've only seen the bloated docs that came with the asset which i went through and have a broken result.
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    Hummy91 likes this.
  42. dustinhorricks

    dustinhorricks

    Joined:
    Sep 1, 2020
    Posts:
    1
    Not sure if I missed it in the documents but is there anyway to change the rendering layer mask? I'm using URP with deferred. Thanks Screenshot 2023-01-18 005144.jpg
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    tl;dr: unfortunately: no.
    in detail: only the hdrp version uses the new "Graphics.RenderMeshIndirect" api which allows you to specify a "renderingLayerMask". it does not make use of it tho.
    so you might try to grab the scripts from the hdrp verision and if they work with urp properly expose the "renderingLayerMask".
     
  44. abbasjafari

    abbasjafari

    Joined:
    Mar 7, 2020
    Posts:
    14
    I get these shader errors when I will build my android project Screenshot_20230130_013748.png
    on Unity 2021.3.17 in-built render pipeline
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    those error are from a shader created by naturemanufacturer - not atg!
     
  46. abbasjafari

    abbasjafari

    Joined:
    Mar 7, 2020
    Posts:
    14
    Screenshot_20230130_080648.png
    Sorry since I had same error from that package too, I sent wrong screenshot. This is the errors from advanced terrain grass
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    look at the first error: can't find include. reimporting the shader folder might help here.
     
  48. abbasjafari

    abbasjafari

    Joined:
    Mar 7, 2020
    Posts:
    14
    The strange thing is that that file is there that should be! By the way the build can be built although all these shader errors
     
  49. abbasjafari

    abbasjafari

    Joined:
    Mar 7, 2020
    Posts:
    14
    Do you know why the grasses looks different in scene view and game view. The scene view has a better graphic and more realistic colors than the game view! first picture is game view and the second scene view. Post processing and lights are enabled on both.
    Screenshot_20230208_064648.png Screenshot_20230208_064657.png
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    most likely because scene view uses unity grass and game view uses atg.
    looks like the ambient is different. imho ambient in scene view is off and does not pick up the overall tint.