Search Unity

Question Instancing Lit Materials (Grass)

Discussion in 'High Definition Render Pipeline' started by JohnHudeski, Dec 9, 2019.

  1. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    Hi. So I was trying to create this effect by instancing grass planes/quads.



    It works fine when I use the PBR shader in the shader graph but the performance seems a bit slow. I tried using the List Shader. It works perfectly well when used in regular situations but when I try instancing it nothing shows up on the screen, Not one single instance.
    I have enabled GPU instancing in the material to no avail. Is there anything I am missing or is this shader not capable of instancing?

    I followed the steps shown in this example but no progress.

     
  2. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    Ok. Funny story. Apparently setting the material as transparent was the problem. unfortunately, it makes the textures very ugly when you make it opaque. Pretty strange the shader can be transparent while the material isn't. I guess I am a noob.

    While the problem is fixed I'd still like to know why this was the case. Thanks
     
  3. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    When you set shader to transparent, it fixed performance too?
     
  4. JohnHudeski

    JohnHudeski

    Joined:
    Nov 18, 2017
    Posts:
    126
    I am not too sure it did. I was rendering individual quads. This was a problem.
    Now I render a mesh clump that comes with about 7 quads welded together. It is much faster and requires fewer instances