Search Unity

World Building InfiniGRASS STUDIO✅-Massively optimized,interactive & non uniform volume grass for procedural worlds

Discussion in 'Tools In Progress' started by nasos_333, Aug 24, 2015.

  1. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Is there a way to have grass blow outward from a central point, like the effect of a helicopter landing? It's not something I necessarily need, just wondering.
     
  2. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    This is planned for next version, and is rather trivial to do (since the shader does for example directional displacement as of v1.5 in shader), and is more a matter of organizing it and integration to the Inspector with controller and parametrization etc that takes more time to do.

    This can also be done with a number of varieties, like straight outwards frm a point wind or circular around a point (e.g the helicopter case would use a combination of both modes) etc, i will play with the possibilities and try to implement as many as possible

    I will post a video as soon as i have the first version refined.
     
  3. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Wow, that sounds pretty great.
     
    nasos_333 likes this.
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I am working on the shaders now for linear color space and with a few changes i got a first version of the local wind, it is a very first attempt and will need a lot more refinement for the final effect, but gives a feeling of how the system will work.

     
    Steve-Tack likes this.
  5. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    @nasos_333 Haha, that's looking good already. Cool effect.
     
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    This still misses one wind component, the waving from the center of the wind generator outward, and turbulence according to that as well, i will post a video soon with the full effect.

    Also the transition region needs some extra work and a few clamps as well to limit the effect when wind is higher.
     
    Steve-Tack likes this.
  7. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I really like the helicopter demo (thanks @Steve Tack for asking for one). I can see so many uses for your tool. Is that "helicopter demo" included in one of your examples or demos with InfiniGRASS?

    The underwater use of grass is what I really find useful also. Have you tried InfiniGRASS with a ocean system like Ceto? I can see it useful for a scuba diving type game.
     
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    No, the sample is something i put together in a few minutes using the current shader, so will need a lot more work for final effect and integrate the effects in a controller so it is full featured. I will make sure to add in next version, together with seasonal changes and other features.

    I have mainly tested with my Sky Master water and i will do tests with the new FFT waves and shading systems as well. I do not own any other water packs, so i cannot test individually, though i dont see reason why it would not work.

    I am also in the process of adapting the system better for linear color space, where specular needs some refinement (color is same across both modes from my tests)
     
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Before (first pic) and after the Linear Color space fix (last two pics)


    I have now found the solution to linear color space issue and specular.
    The trick is to change in the grass shaders the lines
    Code (csharp):
    1.  
    2. finalColor += specular * _SpecularPower;
    3.  
    to
    Code (csharp):
    1.  
    2. finalColor += pow(specular * _SpecularPower,2.2);
    3.  
    this fixes the specular and both pushes it further back as in gamma and enchances its brightness, thus get the proper effect.

    I will make sure to offer an option in the shaders for linear as well in next versions, so there wont be any code changes required (just a variable set to 1 to enable linear space)
     
    Last edited: Apr 3, 2016
  10. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Thanks for the info. Looking forward to you water demonstration

    Do you have a demo of a human character walking in tall grass (2 meters high) for example?
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I dont have a specific such demo, but i plan to create a demo that will allow painting of grass of various sizes and styles and this should be covered, plus i will make sure to have some pre-painted tall interactive grass, both scripted and shader varieties.
     
  12. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348


    A guide to code changes for Linear Color space in the "InfiniGRASS_Transp_Wind_FENCE 1-ROOF" shader (latest shader supporting temporal interaction)

    The changes will make spacular in linear mode (middle pic in linear before the changes, last pic in linear after the changes) behave as in Gamma rendering (top pic).
     
  13. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348




    Local wind WIP
     
    Steve-Tack likes this.
  14. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Looking good!
     
    nasos_333 likes this.
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Thanks. I am now tweaking and will integrate with the inspector too.
     
  16. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    A note for smaller grass scales

    In lower scales, first reduce the wind and turbulence factors and also the "Stop motion distance" paramater that govers the new interaction shader radius of interactivity, until the required result is achieved.

    The "Stop motion distance" is a per material property, so make sure to first press the specific grass icon and then apply the value.

    Also add a windzone first, since without one the system will not pass the wind/turbulence properly to the shader (mainly because it also gets the directionality from the windzone)

    Here is also a video showing the painting in smaller scales for reference:

     
    Last edited: Apr 10, 2016
  17. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    jdraper3 and Steve-Tack like this.
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348



    New grass type WIP, Daisy Flower in full 3D and specially optimized to enable large densities. The shader requires some extra work for the bend points regulation on wind.
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348





    Lots and lots of the new optimized Daisy flowers 3D brush and multiple image effects in full HD and shadow detail.

    Performance on my old 2010 PC (core 2 duo CPU). LODs are not enabled in this demo as well, all flowers are full detail in any distance in the scene.
     
    jdraper3 likes this.
  20. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Video with the new optimized Daisy flowers 3D brush.
     
  21. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    got an updated apk to check if performance has improved since last year? I see lot of new "optimized" stuff so I'm hoping we can finally use it on regular mobile devices
     
  22. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I dont have a new one and indeed there have been various optimizations, so i will try to create one this weekend and will post the link here.

    You have already tested the APK with the SM2.0 grass ?
     
  23. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    yep and it was pretty slow on a regular android phone, that's why i'm curious to see an update
     
  24. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    ok, i will try to export a new one with the new tweaks and enchancements this weekend and post it here
     
  25. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Wondering if this is actually something you can use in a game?

    All the samples and videos show extremely limited areas. If you have like a 3rd person camera walking around a large area - will this asset work?

    What kind of hardware would be required for a large open area with fairly complete ground coverage?
     
  26. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348





    It works in any kind of area, you can fill big grass fields without much issue, even with very big distances (fully controllable, so you are no longer limited by grass disappearance like in Unity terrain)

    The system has multiple adjustable LOD stages and cutoff distance, so it takes care of vast areas by using these features and you can even use multiple grass managers to enable your own higher level LOD as well, to fully control what is activated and and what time.

    Here is a performance demo with big amount of grass (without even using LODs in this demo)
    InfiniGRASS - Vertex grass performance demohttps://dl.dropboxusercontent.com/u/79230236/INFINIDY/INFINIGRASS/INFINIGRASSv15 DEMO_VERTEX_GRASS.html

    The only limitation is the physical limit of RAM (but RAM is very plentiful nowadays even on mobile) and overdraw (in case you use too thick or unoptimized in placement transparent grass variant, you can get little penalty even with full thick grass, it will only start to show issue with vast amounts of very overlapping grass, which should be avoided in any case as it gives little to the look and it even makes it harder to see the full beauty if there is too much overlap)
     
  27. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348



    New system for distant forests (first WIP, many more brushes to be created with the same idea)

    Sky Master ULTIMATE volumetric gradient fog is used in the pics.
     
  28. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    TIPS ON GRASS PAINTING in editor

    A few tips on grass painting.

    1. To stop the camera rotation when painting, while holding the right mouse button (pressed), click on another mouse button (left or middle) once, without leaving the right button. This will lock the camera rotation (i will add this info in next version to be easier to find too) as long as the right mouse button is pressed.
    2. To stop grass painting while the camera rotates, while in painting mode you can hold the left "ctrl" button to lock the camera and rotate without painting. This way you can paint in the area where the camera looks (so rotation wont affect the painting much) and by presing "ctrl" move the camera to target another area etc, so you can do that along with the mouse clicks method above, based on what is best for each situation.
    3. The Editor view distance parameter-slider will reduce the load of grass far away, so grass painting can be faster in the editor (where unity has the editor overhead, in play mode is always super fast)
    4. Grass can be erased per patch collider or en mass using the Mass Erase feature
    5. There is a minimum paint distance parameter, with which continous painting will not create grass in distance lower than the defined, while the mouse is pressed and dragged. Use so the right mouse button can be held in place without adding more grass until moved at least above the defined distance from the last stroke.
    6. Grass wont be painted on collider other than the one the mouse hits, this way it is easier to create grass among stones with precision (e.g. stones with colliders without the PPaint tag or hit on ground which will again not paint on the stones even if they have PPaint tag as the collider will differ).
     
  29. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348








    Distant forest system (InfiniGRASS v1.7) and Sky Master ULTIMATE volumetric fog
     
  30. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348


    Distant forest WIP
     
  31. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Last edited: Apr 25, 2016
  32. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    did this ever happen? :?
     
  33. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Unfortunately i did not have the time yet due to multiple deadlines, i will try to coming week to find some to do the demo.
     
  34. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
  35. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Original speedTree without InfiniGRASS system


    SpeedTree using InfiniGRASS system and shaders






    UPDATE:


    While working on the creation of a SpeedTree templete for use with InfiniGRASS, I found an issue with the LOD sytem when only 64K models are created (SpeedTree trees have many polygons, thus the issue came out since some batches had only 64K groups).

    The issue was one check missed in the ControlCombineChildrenInfiniGRASS.cs script

    Line 759

    should be

    Code (csharp):
    1.  
    2. & (Destroy_list.Count > 0 || Destroy_list64.Count > 0)
    3.  
    instead of

    Code (csharp):
    1.  
    2. & Destroy_list.Count > 0
    3.  
    I will include this fix in v1.7 of the system as well.

    I cannot include the SpeedTree templetes in the project (due to licensing issues), but i can send a pack to everyone insterested directly, on PM request.
     
    Last edited: Apr 26, 2016
  36. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Thanks. Yeah, it runs pretty slow on even a modern device (17 fps!!). I would create a sample without the dual faces, also an option to disable the shadows on the demo to compare (shadows may be slowing it down a lot, and it wouldn't be the fault of the grass system). Lastly, how much grass is there? it doesn't look like much but it's hard to tell.
     
  37. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    That is strange, i get 24-25fps on my device that is a modern but basic one (around $100) (http://i.imgur.com/GLGWBw8.png). What device is used for the testing ?

    If the target for example is the class of non gaming mobiles, then there will be severe limitations in the use, for example shadows should probably be removed and dual facing is also tricky. I am no sure about overdraw either on such low systems.

    I will try more things, like dual faces and LODs etc, but for such cases i would recommend going with a billboard solution without shadows (like Unity grass) and not full 3D grass, plus very low draw distances. To get the infiniGRASS look you need to have full 3D grass, plus shadows and having that on lower end mobiles is not yet possible i think.

    That said, the game with InfiniGRASS system can still benefit with the batching of objects and freedom in placement, so if you have a grass that is weaker mobile friendly, it might help it (or any other 3D objects) with grouping, LODs and batching, but it cant overcome the base problems of less powerfull systems which are mostly rendering - shadowing related and hold things like grass back.

    I will do some more tests to try and get to the lowest possible setting for weaker platforms, but i dont expect to have a nice look with that. Also I will try vertex grass variant, since this might be more mobile friendly and add the option to turn shadows on/off for checking the differenee.
     
  38. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348


    Some work with SpeedTree optimization using InfiniGRASS
     
  39. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    I'm using a Samsung Galaxy Core which is a quad core device. It runs all games at the highest quality without problem. I'm sure I can get 25fps on a galaxy s6 or s7, but that's not even close to the average player phone.

    Most the mobile games do not use real time shadows, so it can be disabled easily. And billboarding doesn't work well on many phones because it uses transparency. Ironically it runs faster 64k vertices than a full screen grass billboard because of that.

    I think it can easily handle the grass if you deactivate shadows and dual face.
     
  40. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I see. Perhaps then there is something that globally affects things, one could be the shadows for sure. I will also check the vertex grass to avoid transparency.

    I will create the next demo with testing various options in mind, so will have options to compare the various versions and see what works and what not, that would be globally usefull i guess for testing on mobile.

    My phone for reference is a VF-795, with Android 5.1, maybe it has a strong GPU for its class though, but in general it is a cheap model (around 100$).
     
  41. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    We need to detect the type of grass (for a cover system). We can do that with Unity Terrain grass/detail meshes. We're waiting for the GAIA-friendly version of infiniGrass (and I'm not sure how that'll work) -- but once that version is out, will there be a way to detect what type of grass/bush the player-character is standing in?
     
  42. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    The grass is batched per grass type, so it is already possible to check by iterating the batchers and see what types are near the hero. If we need perfect precision though is a bit more tricky (due to performance issue mainly, since we need to iterate the grass grower positions as well, while with less precision only the first in the batch would give an approximation, considering bathces are created in a user specified distance for its members)

    If there is a split to multiple grass Managers, this behavior can also be LODed so less batchers are iterated for example

    I suppose if i had a Unity terrain grass (or GAIA grass which is same thing since GAIA ends up with a Unity terrain from what i know) which is placed through texture and converted my grass to that, then you could query the texture to see the grass type, so when i do the converter, i will make sure to enable such exposure of type based on texture as option (if it still makes sense after the conversion).
     
  43. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Thanks for reply. I think I understood that as good news.

    When do you expect to have GAIA support?
     
  44. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    I am not sure when yet, since it is a rather complex affair from my initial tests. I have the means to read the terrain grass and trees but not yet the means to properly spread my grass based on this, as the Unity grass and trees work rather differently from mine, so there is no easy way to convert optimally.

    It is easy to do a 1:1 conversion, but that would not give the full benefit of the system and would limit its power.

    I will be working on this the later half of this month, soon after Sky Master v3.4 releases and in parallel with my new pack that will require this functionality as well, so i hope will go fast at that point that will have full focus.

    I will try to add a script that will give the grass types around the hero in v1.7 as well in an optimal way, have added it in the to do list.
     
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348





    The new Version 1.7 of InfiniGRASS will come next week and have the following features:

    - New distant forest system
    - New Daisy 3D brush
    - New Red Tree brush
    - New local circular wind shader (helicopter emulation)
    - Fix issue with LODs and 64K batched models
    - Fix issue where GrassChopCollider script is attached to grass automatically
    - Add option to not apply default settings when brush icons are pressed (same for wind)
    - Show currently grabbed terrain in Inspector, to know where Mass Planting is happening

    i will add to the list as the v1.7 progresses

    Everything shown in the images is possible with InfiniGRASS v1.7 (and Sky Master ULTIMATE for the gradient based volumetric fog, lighting, river shader and filters)
     
  46. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    hi, any chances of releasing an updated apk with the option to disable shadows and dual face?
     
  47. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Yes, but i cannot say when it will be ready though, probably later next week is my guess, depends on how the current projects go. I will get to it soon after v1.7 is finilized and submitted early next week (or in the weekend).
     
  48. nasos_333

    nasos_333

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

    A tip when using grown in play time grass (after an ungrow). If grass seems to be missing (even though it shows fine in editor), this is due to the raycast distance being too high and the raycast hits another object, thus preventing grass creation (as the hit surface is not the one grass was painted on).

    To solve this issue, based on world scale, lower the "Raycast distance" parameter (brush Painting section in Grass Manager) for the required brushes, so the raycast happens closer to the surface.
     
  49. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Last edited: May 18, 2016
    Lex4art likes this.
  50. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348

    InfiniGRASS 1.7 - Forest Edge
    InfiniGRASS v1.7 - 3D Daisy brush
     
    Last edited: May 25, 2016