Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Adding Grass in HDRP

Discussion in 'High Definition Render Pipeline' started by BloodAlibi, Mar 25, 2023.

  1. BloodAlibi

    BloodAlibi

    Joined:
    Nov 28, 2021
    Posts:
    7
    Hello everyone,
    I hope this post doesn't bother anyone as I believe I already posted it on the answers forum, but with technical issues I have no idea if it really shows up (I got some "internal server error" errors when posting it, and "504 gateway timeout" when trying to access them), since I can't even open my profile activity. Anyway.

    As I stated in the answers forum post, I am making a game which uses the High Definition Render Pipeline, and tried adding "grass" to the terrain. However it seems like the "Paint Details" option does not support "Grass Texture". I then decided to use a "Detail Mesh", made some kind of 3D shape object simulating low-poly grass and imported it in Uniy. When trying to add it, the editor prevents me from doing so and prompts me: "Renderer Component is missing."

    Does anyone know a solution to this issue ? And is there a way to add "2D" grass as for other render pipelines ?
    Thank you very much!

    (Again, I am very sorry for the "duplicated posts" between answers forum and this one, but I can't seem to do anything with them in the other one)
     

    Attached Files:

  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    Billboards for grass is not supported in HDRP (not sure if its coming later or just never coming). 3D models like you did I think should work. Most likely a component is missing. If you look in the HDRP sample project (https://assetstore.unity.com/packages/3d/environments/unity-terrain-hdrp-demo-scene-213198) you could compare the grass there to your grass (see what component you are missing).
     
  3. BloodAlibi

    BloodAlibi

    Joined:
    Nov 28, 2021
    Posts:
    7
    Alright, I'll check the demo scene you provided and see the difference. Thank you!
     
  4. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    330
    I guess the problem you faced is very simple.
    your grass model has an empty parent gameobject.
    the grass renderer is expecting your model is simple and pure,all rendering infomation is provided in the model you assign.
    so you have to make sure the grass model is just a simple gameobject with a meshrenderer on it,no children,no parents.

    btw,you could get an empty parent on the top of gameobject by exporting your model to .obj file.
    use a .fbx file will solve your problem.
    or you can duplicate the gameobject with meshrenderer to a new prefab.
    both solutions could solve your problem.
     
    akent99 likes this.
  5. BloodAlibi

    BloodAlibi

    Joined:
    Nov 28, 2021
    Posts:
    7
    Yes, that's exactly what I noticed between the grass model of Unity's demo scene and mine.
    My grass model wasn't "joined" from Blender, making it one parent with several children.
    Thank you for your help!