Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Grass using DOTS instead of terrain

Discussion in 'Entity Component System' started by alsharefeeee, Sep 16, 2020.

  1. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    Hi everyone,

    I was trying to make the grass as entities hoping for better performance but instead it back fired and the project became very slow that when I delete them the project freezes.

    Is there a way to benefit from DOTS when adding grass to a terrain?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Wouldn't be better of using GPU and shades instead, for grass purpose?

    Did you used multithreding and burst?
     
  3. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    @Antypodish I did enable GPU instancing. I don't know what you mean by shades?

    I did convert all prefabs into Entities and enabled Burst, doesn't this automatically make it use multithreding and burst.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Sorry, I meant shaders. Misspelled.
    You wouldn't need to use entities.
    Depends what you need.

    What rendering method you use?
     
  5. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    I used HDRP.
     
  6. UsmanMemon

    UsmanMemon

    Joined:
    Jan 24, 2020
    Posts:
    87
    use
    enable hybrid renderer v2 which is like 10x faster than v1 and if you are using subscene than make sure to close the subscene before entering playmode.
     
  7. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    Thanks, I can't use Hybird Renderer v2 at the moment, I think it needs Unity 2020 and no I am not using any subscene but maybe I should.
     
  8. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    Grass is almost certainly better done completely on the GPU. But there's a lot of types of grass. Can you share a screenshot of the effect you'd like to achieve? Is it tall grass that reacts to player movement and bends in the wind, very short grass, clumpy/patchy grass, grass with mini bushes or flowers, etc?
     
  9. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
  10. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    You really should try this before buying grass stuff
     
  11. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    You should ask for support from the author of the asset first. It looks like the asset was designed for use with https://assetstore.unity.com/packages/tools/terrain/vegetation-studio-103389 , which IME is a great asset worth the investment if you're working a lot with this type of stuff. It handles most of the rendering for you so you don't have to worry about it.
     
  12. alsharefeeee

    alsharefeeee

    Joined:
    Jul 6, 2013
    Posts:
    80
    @Antypodish I think there is not much difference than the one I have except that this one is made by shader graph, but I guess shader graph is faster than the normal shader script.

    @burningmime Yeah I think I should and the pro version here is super amazing but pricy.
     
  13. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,824
    Well primary difference is the price. :)
    You need be careful, when choosing assets, to make sure, they fit your theme. Otherwise, things will look very odd.