Search Unity

Speed tree optimisations?

Discussion in 'General Graphics' started by hippocoder, Apr 9, 2015.

  1. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Well per instance data is not required, as per the Unreal implementation it only calculates the data per instance type and not per instance. Per instance data is calculated on the GPU.

    And speedtree looks awesome and you can have very good looking grass at 12 vertices (practically 2 quads) and bigger patches at 100 verts.

    You can read my performance numbers a little higher.

    As for procedurally generating it, it's quite trivial, no need for individual instances... The problem with procedural grass is that it tends to look uniformly even if you seed a little each instance. Take nomansky for example... 1quintiliom or whatever planets and you get bored after 9-10 planets i heard.

     
  2. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Thanks a lot, i'm not at the PC now will try it out later to see how and if it works.

    I wonder how didn't this crossed my mind... But thats what unity experts are for!
     
  3. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I just have tried this and with the 'GetPropertyBlock' it takes an extra of 5 milliseconds (dropping the FPS from 100 to sth like 50 with grass only). It is a workaround but, unfortunately, it takes a huge lot of time making the system quite unusable.

    Still waiting for a better workaround that would make the system usable.
     
  4. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Ok I've found a workaround at the current workaround's partial workaround, it is to only draw animated grass in a range of let's say 30m of the player and all the other grass to be non-animated at a farther range than 30m.

    Result: Performance.jpg

    30FPS in the spot where the grass is most dense. Of course where there's less grass the performance will be better. Also there are options for density, animation distance etc... that can be tweaked.

    Far from a ideal solution, it will only keep your game running at 30FPS+ which is not ideal. Impossible with all the data copying back and forward and the lack of per-item culling params and other low level stuff.

    If you want high performance with a lot of very good grass (not the existing billboards or partial implementation like the asset store, but grass like Uncharted 4) unity is NOT the engine without a LOT of extra work, at least at the moment.
     
    Last edited: Sep 3, 2016
    moure likes this.
  5. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    New note, with Unity's 5.5 new API 'DrawMeshInstanced' the FPS with grass only went from 30FPS to 300FPS. Will post more details in the future.
     
    fffMalzbier, radimoto and moure like this.
  6. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    In order not to clog this with extra data related to grass, that is completely unrelated to trees I made a new post for the people interested:

    "Critias grass system"

    I hope someone might find it usefull. I hope in the future I can do the same for the SpeedTree optimization system too.
     
    Jona-Marklund likes this.
  7. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    jason-fisher likes this.
unityunity