Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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. Duusty

    Duusty

    Joined:
    May 14, 2013
    Posts:
    56
    any news? :)
     
  2. nasos_333

    nasos_333

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

    The spline system is done, so this is out of the way.

    I have finished most things now, and doing a final step of creating a brush generator, this will take the items and auto-create a brush, also it can take a Speedtree and do auto conversion as well. This is one extra step i had to do after lots of feedback about it, so it is easier to put together brushes and control them.

    Also will have to look a bit more in Map Magic integration, but this may come later in v2.x cycle to speed the initial release, as it is a special case.
     
    Rockwall33 likes this.
  3. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    A Unity 2018 version is ready for download, for everyone that may use the latest version.

    Let me know in a PM if the 2018 version is needed.

    The Unity 2018 version will also be submitted to the store this week (WIP).
     
  4. pixlweaver

    pixlweaver

    Joined:
    Dec 21, 2012
    Posts:
    92
    Any word on beta?
     
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    I am working around the clock to finalize it now, only thing missing is the brush creator which i am doing now and hopefully will soon have it released. I decided to add this aspect too, since was a common issue with v1.x that was asked, so i will streamline the creation of brush and put together LODs etc easilly, so the brush generation will be more automated and clear.
     
    pixlweaver and Acissathar like this.
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269



    Circular wind and snow are now integrated into the new v2.0 shaders and are tweaked (WIP). Also both will get many more options for more control over the effects.
     
    sharkapps likes this.
  7. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    Are there any runtime procedural methods included with InfiniGRASS? MapMagic integration or rule based automatic placement for example?
     
  8. Ruben_Chris

    Ruben_Chris

    Joined:
    Mar 10, 2013
    Posts:
    94
    @nasos_333 Hello! I bought InfiniGRASS a couple of days ago and I'm impressed by the system so far. However, there are a few things that I would like to bring up.

    Performance issues
    1. Editor is lagging a lot when I start drawing grass unless I click the "Ungrow in editor" button. I don't need to see the grass wave in the wind when in the editor. Is there a way to fix this without hitting the "ungrow in editor" button all the time? "Toggle Wind" and "Preview wind in editor" are both set to false, but I can still see the effect.
    2. When I add stones using the "Stones (with LODs)" brush, my vertex count goes up by hundreds of thousands of verticies which (of course) results in massive lag.

    There also seems to be an issue where parts of grass are "stretched" and doesn't appear to be in the right place. Provided a picture below:

    It seems to appear when I move away from the grass
     
    Last edited: Jul 8, 2018
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Hi Chris,

    The editor performance is an issue, i handle it by using multiple grass managers and "ungrow" each i dont edit and work only on one, also you can use the view editor distance to eliminate grass further from the editor camera to enchance speed more. In infiniGRASS v2.0 the editor performance is vastly improved due to the pooling and no batching need and more efficient RAM usuage.

    The brushes besides quads (main grass type) can be expensive in polygons, so try to use more sparse configuration (reduce density in brush and increase spread to cover more space).

    For the grass displacement, try to reduce the "stop motion distance" variable to zero and see if fixes it, this is per brush setting in the shader, so first select the brush with the icon and then set it.
     
  10. Ruben_Chris

    Ruben_Chris

    Joined:
    Mar 10, 2013
    Posts:
    94
    Thanks for the quick response!
    I managed to fix the grass displacement problem, but I noticed that InfiniGRASS seems to use a lot of my CPU power. In the profiler, INfiniDyGrassField.Update() stands for 8.2% of the usage, GrassChopCollider.Update() stands for 5%, InfiniGRASSManager.Update() stands for 2.5%. In addition to this, ControlCombineChildrenINfiniDyGrass.LateUpdate() eats up 16.6% and INfiniDyGrassField.LateUpdate() uses 3.6%. In total, InfiniGRASS stands for 39.9% of the CPU consumption. There are around 1000 grass patches, but it doesn't cover that much of my terrain.
    The actual rendering affects the CPU less than the updating of the InfiniGRASS components.

    Also, how do I setup player interaction? I've set the correct tag and checked the "Tag based player" checkbox, but it doesn't seem to affect the grass at all. I've also tried changing the stop motion variable. "Shader based interact" is also checked.

    By the way, I'm looking forward to 2.0 :)
    I have a big terrain, so I need those new features (currently mass planting just crashes my editor).
     
  11. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Try to create larger batch groups by increasing the static members count and batch radius. This will create much less overhead. In v2.0 there is a grid update system and split to many managers so will solve these issues as well automatically with no need to manage the grass on a higher level by the user.
     
  12. Ruben_Chris

    Ruben_Chris

    Joined:
    Mar 10, 2013
    Posts:
    94
    Hi again. I think the problem that I was facing was because the 1000 grass patches was located at pretty much the same place. When I found out how to adjust the brush size, it worked much better haha. Still new to the whole system :)
    I'm glad that problem is fixed. I also managed to fix the player interaction by checking the "Make grass interactive" checkbox in the grass brush, but every time my player walks on the grass, the grass shrinks. It seems to be linked to the interaction radius. When I set a lower interaction radius, the grass shrinks and when I set a higher interaction radius value, the grass grows and becomes enormous. Do you have any idea why this happens?
     
  13. jamesnw

    jamesnw

    Joined:
    Mar 23, 2013
    Posts:
    51
    The current version on the store is giving me a

    "Shader error in 'InfiniGRASS/Vertex Grass': invalid subscript 'posWorld' at line 454 (on d3d11)"
    "Shader error in 'InfiniGRASS/Vertex Grass Spec UnityGrass': invalid subscript 'posWorld' at line 549 (on d3d11)"
    "Shader error in 'InfiniGRASS/Vertex Grass Spec': invalid subscript 'posWorld' at line 476 (on d3d11)"
    (using Unity 2018.2.2f1 and PostProcessing v2)

    Was going to dock some stars off my review, but figured I'd give the courtesy of posting this first and a short time to help correct it. :p ;)
     
  14. nasos_333

    nasos_333

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

    Thanks a lot for the heads up, i have fixed all shaders and i will PM a patch asap.

    Also uploading a new version on the store
     
  15. jamesnw

    jamesnw

    Joined:
    Mar 23, 2013
    Posts:
    51
    Cool beans! Thanks dude. ;)
     
  16. jamesnw

    jamesnw

    Joined:
    Mar 23, 2013
    Posts:
    51
    Does this new version have a good runtime API to paint procedurally? (or you mean it's just a patch?) Just checking.
     
  17. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    You mean the patch i sent or the coming v2.0 ? In v2.0 there is a rule based system that can plant also in run time very fast whole terrains. And uses spline based placement as option too (area or along spline etc), with extra option for terrain manipulation (river generation etc)

    Run time painting would also be instant in v2.0 due to the pooling method used. I will make sure to add an option to plant at run time in specific spots too and a demo sample (like in v1.x planting demo) and will minimize the code required to do the planting so the new functions can be used as an API.
     
    Last edited: Aug 9, 2018
  18. jamesnw

    jamesnw

    Joined:
    Mar 23, 2013
    Posts:
    51
    What would be really nice is if I could give a list of vertices, triangles, and normals, and then your routine can auto-paint it based on the rules. :) I think such a thing would be very powerful since not everyone is using Unity's terrain system (I have a procedural world with threads calculating LOD [a dynamic mesh]). Might need a way to remove from said areas as well (point and radius perhaps) where the player might be digging into the ground. Any ETA on v2?
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    That would be possible, but i am not sure if would be efficient versus the raycasting against the mesh. The system can currently work on any terrain, on meshes too etc, so there is no Unity terrain limitation, other than the issue of splat map based rules (so when rules require a splat map, take it only when Unity terrain is used)

    I will consider it though as an extra higher layer for the planting methods and see how it behaves, would be a good option if can do some extra effects on the planting.

    Another feature i am considering is tinting the grass by the terrain color, in mesh terrains too. This mode would be inherent to the new method i use to create and position the grass and would also be a nice feature to have.

    About v2.0, i had some minor bugs to squeeze in the editor time editing, due to some extra optimizations i did which generated a few new issues, now these are solved as well and the system is 100% stable and in top form, now focusing again in the brush maker (which includes a sprite and LOD stages auto renderer for impostors) and will release the Beta soon after that usability focused aspect is finalized.
     
  20. jamesnw

    jamesnw

    Joined:
    Mar 23, 2013
    Posts:
    51
    In case this helps you, this is what I did:



    As mentioned, I have custom mesh data (created in a thread), thus I hold the original vertices, normals, and triangles and operated on it 100% with my own code (since Unity cannot run in separate threads). One day I may try using the job system, but so far it works just fine for now. The other LODs pull from the original mesh, which is spherical. It is the detailed source mesh I plan to "paint" (and hopefully save), and I do not use splat maps at all anywhere currently, nor do I plan to (just FYI). I had plans to implement my own generation (and I need this very soon, so time is limited), but if something else can work it will save me time.
     
  21. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Here is a sample of around player planting, this works by doing downwards raycastings, to grab the position, normal etc

    But the system can plant on anything, the raycast is not nessesary either, so i guess could plant on your mesh as well, note the planting in the video is on meshes, not Unitty terrain as well

     
  22. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    New feature for next InfiniGRASS version, around player customizable planting

     
  23. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    New feature for InfiniGRASS version 2.0, massive around player customizable planting and erasing at run time

     
  24. Amrid

    Amrid

    Joined:
    Apr 7, 2015
    Posts:
    4
    Hi,
    we wanted to use InfiniGrass in our game project. We just upgraded to unity 2018.2.12f1, and started testing.
    There seems to be a problem with regrowing grass on a custom mesh terrain.
    After ungrow/regrow operation random GrassPatches get really tiny grass, and about haf of them normal looking one.
    After trying regrow for a few times holders start to disappear on their own and console produces two errors.
    Are you aware of that problem? Or is it maybe unity itself conflicting in a way?

    How is InfiniGrass v2.0 going? Will we get it soon?


    These are the errors:

    1.
    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <f2e6809acb14476a81f399aeb800f8f2>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <f2e6809acb14476a81f399aeb800f8f2>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <f2e6809acb14476a81f399aeb800f8f2>:0)
    Artngame.INfiniDy.InfiniGRASSManagerEditor.OnInspectorGUI () (at Assets/InfiniGRASS/Scripts/Editor/InfiniGRASSManagerEditor.cs:2666)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1367)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    2.
    NullReferenceException: Object reference not set to an instance of an object
    Artngame.INfiniDy.InfiniGRASSManagerEditor.OnInspectorGUI () (at Assets/InfiniGRASS/Scripts/Editor/InfiniGRASSManagerEditor.cs:2736)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1367)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  25. nasos_333

    nasos_333

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

    I have not cone across this error. The grass on demo scene uses meshes and there is no issue with grow and ungrow, so my guess is that there is something in the specific scene that causes system to fail.

    You may send me the scene with just the grass and terrain to check locally.
     
  26. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    Can i use my own grass with this?
     
  27. Ruben_Chris

    Ruben_Chris

    Joined:
    Mar 10, 2013
    Posts:
    94
    Yes
     
  28. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    Cool.
    Is it possible to paint terrain texture/material with 3d grass attached?
     
  29. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    I am not sure on the question, you can paint 3d grass on terrain and have grass type changed based on splat map, or on meshes, but not based on texture.
     
  30. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    It's like procedural vegetation in Cryengine.
    You pick a material to paint on your terrain and attach your grass to that material, and you paint material and grass together.
     
  31. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    I need good tool that can paint grass like in other engines, next gen grass or whatever you call it.
    This is what i did with Unity tool, but of course performance are bad, draw calls high.
     
  32. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Do u use unity terrain ?
     
  33. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    I use Gaia.
     
  34. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    677
    GAIA uses Unity terrains
     
  35. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Indeed, this splat maps can be used to plant, with mass plant system. In coming v2.0 there is an auto plant based on splat maps for huge terrains, can plat whole terrains and even list of multiple terrains all at once.
     
  36. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    The most important for me is to have tool which can paint grass like in other engines. It must be able to align to the terrain normals, and to have control over density, hight, etc. I need good looking real grass, not sprites.
    Also it should reduce draw calls.

    Can i do that with this tool?
     
  37. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Yes, you have full control. In v2.0 also there is more efficient user interface, grid update system and memory hanling. I am not sure on all specs of other engines though so cant say on that
     
  38. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    New
    Excellent.
    You mentioned 2.0 version, but the current is 1.9.1? It's wip?

    About draw calls, let me give you an example how Cryengine does it. If you paint grass and have for example 10000 DP which is way too much, you just enable option called "automerge" and suddenly you have 200 DP. Enormous difference. And then there is overall draw calls optimization, especially for dx12.

    I don't know how efficient your tool is, but it would be very nice to have something similar for Unity. Also this ability to paint a texture/material and 3d grass together would be great. It gives you much better control. Don't know how hard would be to implement into your next version or versions?
     
  39. Ancient76

    Ancient76

    Joined:
    Nov 12, 2018
    Posts:
    19
    So this is the setup for custom grass:


    Can i paint grass mesh, larger grass patch that i made in 3ds max for example?
    Like this one:
     
  40. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    IMPORTANT note on Unity 2018.3

    When creating a new brush and open the prefab, the new way prefabs are handled updates the prefab state and creates error when prefab is used in the Grass Manager. I have created a patch that is available directly (send me invoice in PM and will send patch asap).

    Also just submitted the v1.9.3 of the system that corrects this issue, will be in the store sometimes next week and i recommend upgrade to it to make new brushes the proper way.
     
  41. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269

    WIP on volumetric grass and lighting
     
    Lex4art likes this.
  42. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    InfiniGRASS v1.9.6 has been released to Unity Asset store !!!

    v1.9.6 addressed an issue where attenuation was not taken fully into account in diffuse light and created a hard edge for local (point and spot) lights. Now light blending is handled smoothly with surroundings.

    Also added a mobile shader version that supports local lights, for more versatility (is now default in mobile grass, to change to older shader for even more performance just replace the shader in the material with the mobile variant that has no point light in the name)
     
  43. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Update:

    A LWRP version of the grass shader is now finalized and fully working, it will be released soon to the store.
     
  44. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269

    Latest work in InfiniGRASS v2.0 for LWRP (http://u3d.as/jiM), automatic ground adaptation to any mesh (layer controlled), lighting and combination with the Sky Master ULTIMATE (http://u3d.as/agN) LWRP - URP effects (volumetric clouds, sun shafts and fog)
     
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269



    WIP on InfiniGRASS v2.0, usage with Sky Master ULTIMATE and soft shadows
     
  46. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269

    InfiniGRASS Studio (v2.0) WIP - Single draw call grass system on SM3.0 and above platforms (includes most latest mobile phones).

    LWRP version is finalized and the system core will be released soon. In the core version of the InfiniGRASS Studio will be able to spread infinite amounts of grass (or any other mesh) with a single draw call (or up to 6 for all effects including shadows and local lights, for any amount of grass) and do permanent interaction and grass shaping, plus use some advanced features like multi texture single material option and much more.

    The InfiniGRASS Studio Core will be the first version, with focus on simplicity and the more complex InfiniGRASS Studio Pro version will follow later, with options to do batched billboards, grid based spread and update system, game time planting based on rules, grass patches pooling and much more, with focus on procedural worlds and grass generation.
     
    Last edited: Dec 1, 2019
    Freznosis and malkere like this.
  47. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269


    The complete URP conversion in nearly finished, all optimization systems are working 100% and the base shaders have been converted. Remains to convert all brushes to new shader, which will take a bit more because Unity has a bug that prevent using the new shader in the old imported materials.
     
  48. nu51313932

    nu51313932

    Joined:
    Oct 28, 2016
    Posts:
    81
    I use 30 field of view. The smallest grass is still very big for my project.. How can I fix this problem?
     
  49. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,269
    Hi, have you adjusted world scale before planting ? E.g put to 2 or 3, then press brush icon and plant and see if fixes issue. Also i have a demo scene with lower scale to check.

    As a last step can also adjust the prefabs of the brush to any scale as needed.

    Let me know for any more help as needed
     
  50. nu51313932

    nu51313932

    Joined:
    Oct 28, 2016
    Posts:
    81
    Thank you . I will try to fix by any way