Search Unity

Question: Why Is Unity not using some form of GPU based grass?

Discussion in 'World Building' started by TyroByte, Aug 10, 2021.

  1. TyroByte

    TyroByte

    Joined:
    Mar 16, 2017
    Posts:
    25
    From what I can see here and correct me if I'm wrong, Unity is breaking up the terrain into small patches based on the Detail Resolution and Detail Resolution/Patch and uploading the vertices to the CPU where culling and all the stuff takes place. Assets like GPU Instancer offloads most of this work to the GPU from my understanding. Why is this not more commonly used?

    This idea of rendering grass using the GPU has been there since quite some time if we are to go by this Nvidia Article.

    All this seems like a lot of work on the CPU and a whole lot inefficient. Is Unity planning to provide a GPU based terrain detail system anytime soon for URP?
     
  2. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Probably compatibility; and culling is likely one of the reasons. Assets like Vegetation studio use compute shaders to do this, but those are not supported on every target.
    Most of those ~magic gpu performance increasers have a mention somewhere at the bottom that they require a certain hardware level to even function.
    I think there's no reason not to provide a toggle to render foliage instanced (like for the base terrain) and not if not supported; but this would require additional work, and as there are alternatives already, they probably just don't bother, i guess.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    ES2.0 devices need to die but 3.1 devices (which can do compute shaders) like Quest 1+2 (fastest growing VR device ever) may run those compute shaders slow if not carefully done.

    So even if Unity does choose to have a path for compute vegetation it will likely be HDRP only for the longest time, which makes everyone else shrug and sigh :p
     
    JoeStrout likes this.
  4. TyroByte

    TyroByte

    Joined:
    Mar 16, 2017
    Posts:
    25
    I thought ES 2.0 was dead already? Isn't that ancient tech?

    But yes, I didn't take into account the issue of compatibility with different devices. I do wish we had some sort of toggle to GPU instance grass on terrains. An overall update to the terrain system a la 2018.3 Upgrade would do wonders. The current implementation is ancient tech compared to other engines and what we are capable of now.
     
  5. Deleted User

    Deleted User

    Guest

    2021.2 has a new paint detail tool which uses GPU instancing but u have to use a grass mesh......grass texture is no more supported in it
     
  6. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    A vegetation system seemingly hasn't been on Unity's radar since Unity 2.0, when it was introduced. In comparison, UE4 is miles ahead in that area. The fact that every Unity demo so far employs sort of workaround or a quickie custom system really outlines its limitations. I suspect there's simply not enough people working at Unity that are passionate about large natural environments to advocate this, there's been plenty of sleeve pulling from the community otherwise.

    I believe DOTS/Hybrid Renderer could already be used to achieve high amounts of vegetation, based on the amount of possible objects seen in the Megacity demo. So they may be holding out until that's more mature. Sad truth is that this once again creates a feature gap, likely spanning several years.

    Either way, a system to populate a terrain with vegetation, based on procedural rules and manual painting would need to be in place. Finger crossed the upcoming "Environment System" is going to modernize vegetation as well. If not, an asset store system is truly the only option to reach today's standards.
     
    hippocoder likes this.