Search Unity

[ON $20 SALE!✅]Infinigrass-GPU Optimized Interactive Grass-Trees-Meshes,work on mobile,HDRP-URP

Discussion in 'Assets and Asset Store' started by nasos_333, Sep 1, 2015.

  1. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    Hiya, here is my latest:

    -Managed to get the "flying grass" problem fixed.

    -Started applying grass to my level with this method:

    -Create empty game object and put new grass manager in it
    -Disable "when combiner is full checkbox"
    -Enable "Disable after grow" and "Eliminate original" checkboxes
    -Place ~100 patches of grass
    -Ungrow in editor
    -Repeat

    With this manner I have been able to populate about 5th of my 3000*3000 terrain.
    Anyway if I add any more the game will crash in the beginning when grass is grown.

    Is there any setting to make my grass lighter so I could have more?
    I don't know how it works under the hood but the bulk of the grass is made with single brush. Made me wonder is there a way to reuse the same geometry somehow, as having individual geometry for each patch would result in awful lot of geometry.



    Here is the video... audio is a bit low so you might need to turn it up to hear.

    Thanks

    Teemu

    P.S
    Here is an overview pic of the 15 grass managers holding about half of the needed grass amount for the map. This amount will crash instantly in the play mode.
    15grass.PNG
     
    Last edited: Jun 9, 2016
  2. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi, is the crash due to RAM or other issue ? Unity 5 used is 64 bit ?

    Also you can bring in the grass managers gradually so each grass manager has time to eliminate the original meshes before the next grows for example (a timer script that will enable one after the other on start). The RAM saved in this mode is great (but i cant tell how much is used in the specific scene), my guess is that the system creates the grass all together and does the issue before has the time to recover the RAM by the original mesh elimination.

    Another solution is to setup to bring the grass gradually, (gradual growth mode), this will create the grass only around the player (in the user defined radius), but has to be regulated for performance (as creating the batches can be taxing in real time, so count of members per batch should be lowered from 8-9 to 1-3). After the grass is created there is no more batching overhead (only for the grass not yet created as hero is far way).

    There is no way to use a single model curently, but for next versions i am looking at posisbilities in pooling the grass and creating from a pool in gradual mode (so grass player creates on the fly on approach can be grass of another area the player is moving away from). The problem with having one mesh is that you cant batch and the performance will not be good and grass wont look as good, which are the main points of InfiniGRASS (e.g. i could enable a unbatched mode where all blades would indeed use the same model, i use such a mode in scripted interaction as well, but if many batches are open the performance drop is dramatic and the game would be unplayable)
     
  3. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    Thanks,
    I'll look into gradually loading the grass.

    I'm using unity 5.34f1 in 64bit mode.
    It doesn't look like it's totally out of RAM but the crash report
    shows pretty big amount in use.

    Error occurred at 2016-06-09_151312.
    G:\unity\ledergrass16\leder.exe, run by CloudBounce.
    68% memory in use.
    16343 MB physical memory [5083 MB free].
    33484 MB paging file [20997 MB free].
    8388608 MB user address space [8386066 MB free].
    Read from location 00000000 caused an access violation.


    BTW, Do the "Update materials" and "No threading" options have effect on this? I didn't find any help on those.
     
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I am doing tests for the RAM and i see some strange behavior, e.g. when i load everything gradually it takes as supposed 100MB, then i do a load of all in game start i get much larger consumption (both with original mesh elimination on)

    This seems like a bug or some setup thing i had not noticed before, so i will try to find out why this happens. Note that in both cases the grass gets eliminated as supposed, but the RAM consumption is much different.

    If RAM is not full, then probably the issue is trying to create too much detail in one go, so the script to enable managers with a small delay may fix this.

    I am working on both above and will get back asap.

    The "Update material" tells the manager to update the grass materials for wind etc, so if you have more than one managers with the same material list active, you can disable for all but one to enchance perfmornance.

    The "no threading" only applies to dynamic phase, and is best to use threading for any real time procedure (e.g. gradual growth), i have this as an option since WebGL does not allow multithreading, so use only to build for WebGL case.
     
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Just did another test, i disabled gradual grow and let all grass be created at once, but enabled the grass managers one by one. Seems this also solves the RAM issue, the only problem is when all managers come into play at the same frame as it seems, so i will work full time on a scheme to ease this first loading and try to have as low RAM as possible as well.
     
  6. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    I did a script to gradually engable grass managers and that resulted in success loading all the grass this far without crashing! Cool. I'll let you know how it goes when the level is full of grass.
     
    nasos_333 likes this.
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Great :), i also notice a RAM decrease when doing it this way from 850MB overall to just 550MB in my test scene, so i am investigating what could negate the full optimization when all are created at once and will handle for the new version and systems in a better way.
     
    docsavage likes this.
  8. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    Did rest of the grass today resulting in 38 grass managers.
    Unfortunately the game crashes about half way through enabling them, even when 10 second delay is induced between every load.

    The error is very similar to the last one except this time It's
    Read from location ffffffff causing access violation instead of 00000000.

    I'll investigate further after sleepz

    grass38.PNG
     
  9. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    The mesh combining seems to work fine if you look at unity profiler but Windows task manager tells a different tale. The levelful of grass would consume 8Gb of extra RAM if it didnt crash before getting all gets loaded.
     
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    What type and density of grass is used ?

    Perhaps a combination of some pre-defined and some streamed would help in this case as well.

    Another thing worth checking is whether the RAM consumption when all grass is gradually grown is less than the one when activating the managers.
     
  11. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    I'm using Vertex1 grass (brush #2) with default density. When activating more than like 6 grass managers at once crashes the game... I was able to run more batches of the grass when removing colliders and raycast layers from the prefab, but still get crash around the 30th loaded manager or so.

    The loading also takes a huge time so it kinda makes me suspicious there is something fishy going on.

    -T
     
  12. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    1. Tried everything, cannot get 'mass place' to work (?)
    2. Can you increase the brush size when painting in the editor?
    3. Is there any way to prevent the camera from rotating in the editor when painting grass?
     

    Attached Files:

    Last edited: Jun 11, 2016
  13. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi,

    About 1. Are you using a mesh or Unity terrain when Mass Placing ? Also try to enable/disable the terrain and see if fixes the issue. The system will grab the TData of the first active Unity terrain and to mass place on another you can disable all terrains but the one you need and the system will grab the new active automatically.

    I have the procedure in the below video and another one to show the placement when in smaller scales:
    https://www.youtube.com/watch?list=PLJQvoQM6t9Gddp8uags3YC4D9zUQ4CbYt&v=If8G_MrL83A
    https://www.youtube.com/watch?list=PLJQvoQM6t9Gddp8uags3YC4D9zUQ4CbYt&v=4RSPTd2x1sw

    About 2. The brush size is govered by the Spread parameter, you can set a spread range to vary the size as well. Then adjust the density to cover this newly defined brush area with a more or less dense grass.

    About 3. It is possible to stop the rotation when while having the right mouse pressed, press once the left (without leaving he right) and then drag the right. So press the right mouse button to paint the first stroke and hold (no more will be painted while not dragging), click the left button once while holding the right and then drag to paint without camera rotation.

    Let me know for any more questions
     
    buttmatrix likes this.
  14. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    How many batchers does each Grass Manager create ? Indeed seems strange for only 6 managers, i will do more tests with a lot of grass and see what might be the problem.

    Also what is the polygon count increase due ot grass ?

    Let me know an estimation of about how much grass goes into each manager and will paint one and copy it ina grid and check with a variable number of managers to try and recreate the problem
     
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi,

    I did some stress tests with 500 Grass Managers and trees plus grass, with the new tiling system i work on, i bring in the grass/treee with streaming and i have enabled almost all grass now (by moving the player around to all tiles) and i dont have a crash (4GB RAM PC). Also the system is super fast, since i disable the far away Grass Managers so only the needed are present around the player. The major issue is bringing the grass in scene all at once, i tried this and my PC took a long time to do and got stuck (though it is a very old one) for 20 managers, so i will look for ways to ease this initial transition.

    The best way to handle this now is to use a combination of some streamed and some grass created at game start. For example the filler grass that may not be too thick or for places of interest be streamed, with a lower distance and the areas of interest be created at game start. Note that the sreamed grass should have a lower static batch group memeber count (e.g. 2 instead of 8 members per static grass batch).

    Also it is a good idea to check the distance to player, and while creating the Grass Managers, disable them afterwards, perhaps a disable after one manager has grown its grass, before another comes in will ease the intitialize problem.

    I will do many more tests and get back with more solutions.
     
  16. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    This forum won't let me post this cause it's "Inappropriate or spam-like". Horay algorithms. That's why below text is a screenshot of the text : D

    text.PNG
     
  17. wavesum

    wavesum

    Joined:
    Jun 5, 2016
    Posts:
    11
    I think I narrowed the crash, it seems to happen within this ControlCombineChildren function.
    Here is a profiler shot of the situation when about half of the grass is loaded. The 8ms cpu hit per frame and memory allocation makes me think there might be something fishy going on....

    laters!

    -T

    grassprof2.PNG
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I will check it out, thanks for the insight.

    Also i am working on the new scheme that will copy around the batched item to increase the density of grass using the same mesh (share mesh) so RAM is not increased. This sceme will result in more draw calls, but still massively optimized comparing to not using the system, so could be a viable option for the large amount of grass case.

    I will see if it is posible to have that scheme, so RAM can be saved a lot. Also this might be good for streaming as well, since it could fill areas with far less CPU usage.

    This will be created as priority and will try to have as soon as possible, it is rather complex to fit in so will take next week probably.
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I have now created a first base version of the new batch instances system, works great in real time (not integrated to editor yet, so the copied meshes cant be previewed in editor yet, this will be the major work to finilize).

    The RAM consumption in this mode is minimal and you can essentially have a huge thick forest with RAM consumed for only one of the batches. Also the intitial creation time will be multiple times less in this mode. This will be a huge breakthrough for the massive grass case for the system and from what i see the draw call impact is not very big either.

    The base is done and works with LODs as well and does the spreading based on ground etc, so i hope i have the editor integration early next week and finilize the tests by end of the week.
     
  20. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi nasos,

    Probably not related but after what Nathaniel the maker of terraincomposer said in one of his posts re the amount of unity memory leaks it's worth checking that as well.
     
    Last edited: Jun 12, 2016
  21. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    I ask my old question, How much keywords used by this asset?
     
  22. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I used ShaderForge shader as base and have not added any keywords of my own, so i am not sure how many Shader Forge uses in its standard setup, but my guess is that would be minimal and the standard that Unity uses.

    I can send a test version of the asset and see first hand the shaders as well.
     
    ksam2 likes this.
  23. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348

    Thanks for the heads up, will check it out as well.

    I have now done a few tests with the new batch instantiation system for giving extra density with less RAM consumption and the pics above show the result and RAM use with 100+, 1000+ and 3000+ instances (Batch copies count parameter) of the original single batch (last pic).

    I gather the move from 1000 to 4000 trees take around 100MB ram, so the RAM saving is very big.
     
  24. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    This is not just a bug fix but looks like even extra improvements:) Great support nasos.
     
  25. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Thanks :), this will give an extra option to regulate in other ways for covering more cases.

    Also the instantiaton time is only 2secs for 8000 trees (so will have much faster initial scene loading) and gradual growth can benefit from this also as creating a single batch and copy the batch is much faster than open/close the batch and create a new brush, so the streaming will benefit a lot as well.

    It is very exiting to add this, i will work full time until is fully polished and the coming streaming system and demos will also use it extensively.
     
  26. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Do you think this will be of use in infinitree?
     
  27. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Definitly, i will pass all these extra system to InfiniTREE 2 as well. The L-trees will have less variety in this case (since some will be copies of the original L-tree), but since the option is fully adjustable any combination can apply, plus the instantiated trees are still rotated with custom rotations and based on normal if needed, so there is still a variety factor within each batch group and of course each group will have its own variant of L-tree so variety can still be very high.
     
  28. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695

    Hello and forgive the delay.
    I have already begun to test everything said in previous messages. I will go by parts and you send in a few days because there is much to analyze.
    My version is of Unity es 5.3.4p1

    1º The first reference to how to make LODs. I follow your instructions on how to do less grass blades, flower, etc ... But as I do that those LODs are activated at the scene according to the distance? You have taught me to create a prefab with less polygons, but not how to use it with your asset.....


    2º On the other hand I unchecked the box "When combiner is full" and also the "disable after grow" (I think this was to you meant).
    I've been doing several tests but do not see the difference. I explain ... I unchecked the options "When combiner is full" and "disable after grow" grass that was already set before this project, I tried to compare the RAM with the marked options and you unchecked by play within the editor .
    I have also tried to erase all the grass that was before the project start has reintroducing all the grass, with the option "When combiner is full" marked and unmarked, but no noticeable variation in the amount to RAM.
    Here is the video:


    It has also tried to make a compilation of the scene with the "When combiner is full" option checked and another compilation with the option unchecked and not I've seen variation in RAM.


    3º Another test I was doing is about what the "spider web"
    I inform you that I have no effect postprocessing, or antialiasing or anything in the camera that'll show in the videos below.
    I was trying to change the parameters you said in previous posts but although it seems that putting those values vector Y / Z zero is solved, the issue would be that it could not use it snow ... I think !!

    Also not it seems to be resolved with re-import the texture or to change the texture GRASS12

    Here are the videos:






    4º I have also tried the parameter called "Editor view distance" and seems unhelpful because what I want is to zoom the camera out in the editor and put the brush biggest to paint areas of extensive land with few clicks, but if low value of "editor view distance" you make it go faster the editor, but for the purpose than I intended does not serve because the brush does not paint if the camera is more distance than that set as a parameter in "editor view distance"

    Is there any way to correct this? That is, the grass detail is lost for the editor to work fast but continue painting brush


    Throughout the day tomorrow I will send the following tests to do.
    a greeting
     
  29. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi,

    About LODs, you need to insert your LOD items in the prefab, name the LOD items materials with LOD0 (or LOD1, LOD2 for the other LOD distances) in the material name and disable the mesh filter, also remove shadow cast and receive, then Apply the prefab to save the changes.

    Then define the LOD distances in the inspector and paint the grass.

    About the RAM saving with mesh elimination, i notice that when the grass is grown and not created on the fly (e.g. gradual mode or rela time painting) the RAM saving is less, this seems like a Unity bug and i am investigating. If you have multiple grass managers, then enabling one after the other makes the system free the RAM properly. The Unity bug could be some garbage collection issue, as it seems the RAM is not freed as it should after erasing the original meshes. The issue is that since it does get freed when i eliminate the grass in real time, it is hard to pinpoint the problem, this i think is a Unity bug, but i will try to figure out the exact problem and get back on this.

    Also i have finilized the base of a new system that will save RAM a lot, by copying the batched items around, this will also greatly help in RAM contraint situations and also decrease intital loading time. I have the Beta for this sytem ready to download as well.

    About the Spiderweb issue, if the snow parameters are the problem, i will check to redo the snow handling a bit different and get back with a new shader variant to test asap.

    About painting bigger brushes, i advise against it, as the LODs will seems to appear/disappear in a harder way, the best way is to use a medium sized brush and fill the map with Mass Plant system, with a few such mass plant applications.

    Let me know for more details and any further questions
     
    Last edited: Jun 14, 2016
  30. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    You mean this?


    or this?
     

    Attached Files:

  31. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    The first one, this defines the distances from player LODs take place (e.g. cut of distance is where grass dissapears). Note that if one of the LOD levels is not defined (e.g. LOD2) then the cut off diastance is the LOD2 distance (far) etc, since there is nothing to show if it is not defined.

    Note also that one must be bigger than the other (last the biggest, first the smallest).
     
  32. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    UPDATE:

    Two major breaktrough features are coming in the next version of InfiniGRASS, for performance, intitial loading time and RAM conservation, especially useful when big amount of grass is required.

    InfiniGRASS v1.8 features and fixes

    - New RAM saving mode where batched models can be copied around to increase grass-tree density with far less RAM consumption (as the mesh is shared). This can be used in combination with the current mode for any kind of performance and RAM consumption variants. This mode also decreases initial loading time.

    - Fixed v1.7.5 issue where the LODs will not work after a Refresh in Editor and have to regrow the grass to make them work. This is no issue when grass is grown in play mode (only when coming from pre-gorwn grass in editor).

    - Added option to recreate grass gradually at game start in a fast speed (not depending on player approach), instead of growing all at first frame. This can be used to override the issue with Unity GC collection that does not free RAM in mesh elimination mode, so RAM now is freed when grass is all created at game start, with a slight delay to get to normal frame rates, then everything is normal and RAM is fully freed.

    The issue with ram is the Unity GC collection method, if too much is loaded in RAM at the same frame, the GC collector pushes some of the items to level 3 of GC collection levels and cannot then easilly cast the garbage out. This is solved by the gradual methods. More info in this post: http://answers.unity3d.com/questions/7853/garbage-collection.html

    For example a scene with 5 managers at 850MB when all grass is loaded at first frame, with this system active after loading in around 3-4 seconds, it is just 450MB (with mesh elimination on).

    The update will be ready soon as a hotfix and will have a Beta period to make sure everything is as polished as possible.
     
    ftejada likes this.
  33. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    Top notch:)
     
    nasos_333 likes this.
  34. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    A few more additions for v1.8

    - New Fern brush
    - New Unity Tree sample brush and new shader compatible with Unity Tree system
    - New thin grass brush, great for helicopter like wind system
    - First version of the Streamer and higher end LOD system, with sample scene to showcase multiple grass managers with a higher level LOD to disable them for maximizing performance in two cases A. in the new in v1.8 gradual growth of all grass at game start to bypass the CG collection issue with Unity and save lots of RAM in mesh elimination mode and B. in full gradual mode that creates grass as the player moves near.
     
  35. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi,

    I have worked more on the shader and have managed to lower the white effect of snow on shadows.

    I send a PM with the possible tweak for the shader to test.
     
  36. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    hi
    Concerning the creation of LODs we talked, I can not do it. You could do a little video tutorial?
    regards
     
  37. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi, i sent a PM with more info on the shader, also i will try to create a tutorial for LODs this weekend and post as soon as possible.
     
    ftejada likes this.
  38. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Hi Nasos. Sorry for my mail. Most of my questions are properly answered here. Do you have an ETA for 1.8 ? We are relying on streaming so 1.8 will probably fix our problems.
    As far as I can see there is no option for planting gras via TerrainComposer but I guess it is ok so far just need to check how long it takes to plant it manually. You wouldn't mind contacting me for some indepth tests? We have a very large world in the making consisting of 59 terrains with 5,76km² each and planning to ditch the terrain system which brings in infinigrass as the one and only option for keeping ground foliage. Keep up the great work on this.

    Cheers
     
  39. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi,

    v1.8 is already in an advanced state and i have it for Beta testing as a hotfix to the current v1.7.5 and is stable from my many tests so far. Also has a new system with very performant erase of grass en mass in real time (i was asked this feature many times, so now it is possible and using multiple grass managers as well with it)

    Streaming is a bit tricky always, so needs regulation (especially with this quality of grass) and i hope the new systems like batch instantiation and higher level manager (to manage multipel grass managers) further help towards this usage. Also it is possible to use multiple managers to stream detail separately and not stress the system at same frames (e.g. bring in far away trees with one manager set at high grow distance and grass with another with grass created only when the player approaches, so the detail in the same spot will be going in at separate moments.

    And of course all my assets are always ongoing in development, so more improvements on the massive grass and streaming grass will be coming as i discover them. v1.8 is for example a massive improvement for RAM usage and can help further in streaming more detail with batch instantiation and the new global management system for grass managers.
     
    toxtronyx likes this.
  40. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Purchased this awhile ago and now about to start work on a project that needs it...but we have a very large terrain so really need TerrainComposer-like controls for planting grass based on splat, slope, height, etc. I've been following this thread but haven't noticed mention of that kind of thing. What does it offer? (Ideally infinigrass would be cross-compatible with unity terrain grass, but I understand that's not easy and at this point it doesn't seem like it'll come soon enough for us.)
     
  41. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    There is control for height, splat map (weighted) and slope for mass planting the grass. Furthermore the grass can be masked with objects and is not bound to terrain only, for much better control (e.g. any mesh that is not tagged as PPaint wont receieve grass, essentially masking the area below it on a mass plant)

    If more than these controls are needed, i am always open to suggestions and i try to implement user required specific features in next versions as priority.

    Also it is trivial for me to devise a system to plant the grass on specific spots, that can come from a texture map etc, but that would be far from optimal (like the current Unity etc systems) so would defeat the purpose and major benefits of InfiniGRASS.

    That said, i am getting closer to have the full base for starting on a proper such a system, especially after the new in v1.8 batch instantiation system. Essentially i can create a whole forest with a single stroke and working on a system that can feed the positions of these items from external sources, so i hope i can have something for converting from other systems soon, but i cant guarantee a date.

    The speed i can work on such extras depends directly from reviews on the asset, even a single review can make the difference between weeks or months of development, as i have to split my work to other projects. All bonus extra planned features will come eventually though, only the timing is affected by reviews.
     
  42. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi Gecko,

    I went through some of my code and i have most terrain reading functions and i think i can push to have a first system that will do the following

    1. Create a grid of Grass Managers based on terrain detail map and user choice
    2. Convert from Unity grass and trees to InfiniGRASS without preview of grass in editor (a list will be used to assign grass type to detail and another to assign to tree types)
    3. Assign the Grass Managers to the new in v1.8 Grass Manager controller for higher level LOD and material handling optimization and the new gradual growth on start mode to save on RAM, or use the full gradual mode for all managers automatically (no need to change properties in each one).

    This will be a first version and since v1.8 is Beta i suppose can be tested and refined until release further and of course be improved for later versions constantly to optimize the grass placement vs grass brush size etc.

    I think this could be ready next week, if you would be interested, but knowing that this will not be the 100% optimal distribution of grass. This is the hardest part, getting the most out of everything, which may take longer to perfect.
     
  43. martire

    martire

    Joined:
    Feb 27, 2015
    Posts:
    36
    Hi!
    Sorry if it is a dumb question (I'm not a programmer...): is there a way to enable InfiniGrass only if the Quality is set to Fantastic?
    Thanks in advance!
     
  44. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for the detailed reply. It sounds like it already has much of what I need. converting unity terrain grass is certainly attractive (especially since I'd like to use Gaia) but I don't want to pre-empt other priorities (though I suspect other users would appreciate that too). I don't think k need optimal placement yet, we mostly just need to select our grass system so we can tie in some other functions to it.
     
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    The conversion is going well, i have the base system down for reading all terrain info in the new v1.8 controller and now doing the grass growth methods, so this first version will be ready soon and i can biuld on that, i guess having one early is not a bad idea, epsecilly since v1.8 is in Beta now. This will also automate a lot the intial spread of Grass Managers properly on terrains, so i will decouple this step from the conversion to be used separatly as well.
     
  46. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    You can disable the grass and the Grass Manager and enable them depending on quality chosen at game start. You can also choose a different grass manager to activate depending on quality, with lower end grass for example if low quality is needed etc or have multiple grass managers overlapping and enable certain number of them depending on quality needed.

    This disable needs to be coded though, i dont have a control to use from Inspector for that for example.
     
    martire likes this.
  47. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    UPDATE:

    Two major breaktrough features are coming in the next version of InfiniGRASS, for performance, intitial loading time and RAM conservation, especially useful when big amount of grass is required.

    InfiniGRASS v1.8 features and fixes

    - New RAM saving mode where batched models can be copied around to increase grass-tree density with far less RAM consumption (as the mesh is shared). This can be used in combination with the current mode for any kind of performance and RAM consumption variants. This mode also decreases initial loading time.

    - Fixed v1.7.5 issue where the LODs will not work after a Refresh in Editor and have to regrow the grass to make them work. This is no issue when grass is grown in play mode (only when coming from pre-gorwn grass in editor).

    - Fixed v1.7.5 issue where Daisy3D and Distant Forest brushes had colliders disabled in play mode.

    - Fixed issue where Terrain TData is not grabbed if "Adapt on terrain" is not chosen ("Scale per splat map" in Inspector)


    - Added option to recreate grass gradually at game start in a fast speed (not depending on player approach), instead of growing all at first frame. This can be used to override the issue with Unity GC collection that does not free RAM in mesh elimination mode, so RAM now is freed when grass is all created at game start, with a slight delay to get to normal frame rates, then everything is normal and RAM is fully freed.

    The issue with ram is the Unity GC collection method, if too much is loaded in RAM at the same frame, the GC collector pushes some of the items to level 3 of GC collection levels and cannot then easilly cast the garbage out. This is solved by the gradual methods. More info in this post: http://answers.unity3d.com/questions/7853/garbage-collection.html

    For example a scene with 5 managers at 850MB when all grass is loaded at first frame, with this system active after loading in around 3-4 seconds, it is just 450MB (with mesh elimination on).

    - New Fern brush

    - New Unity Tree sample brush and new shader compatible with Unity Tree system

    - New thin grass brush, great for helicopter like wind system

    - First version of the Streamer module and higher end LOD system, with sample scene to showcase multiple grass managers with a higher level LOD to disable them for maximizing performance in two cases A. in the new in v1.8 gradual growth of all grass at game start to bypass the CG collection issue with Unity and save lots of RAM in mesh elimination mode and B. in full gradual mode that creates grass as the player moves near.

    - Mass erase of grass in real time with maximum performance for strategy games etc where grass needs to be erased in the most efficient way to place buildings etc (or any other use). Multiple Grass Managers support, erase radious is user specified.

    - Conversion of Unity terrain grass and trees to InfiniGRASS, first base version (this module will be more optimized in next versions for the 100% optimal conversion of grass, but this first version will also work nicely and give this option which is much asked by users)


    The update will be ready soon as a hotfix and will have a Beta period to make sure everything is as polished as possible and add an easy to use editor for the new Streamer module with integrated help (as it now has got many features and is rather complex to use in the current script Inspector). The speed it will come to the store depends on reviews the system receieves, so please remember to leave a review when possible as it helps a lot with the development.
     
    Last edited: Jun 19, 2016
    Ony and docsavage like this.
  48. toxtronyx

    toxtronyx

    Joined:
    Aug 21, 2014
    Posts:
    114
    Awesome!
     
  49. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Agreed:)
     
  50. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi nasos,

    as per conversation started here's the image. Don't know how to attach an image in a conversation. Sorry:)

    MassPlaceTest.png