Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

InfiniGRASS v2.0 - Next gen interactive & true non uniform volume grass, procedural worlds, pooling

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

  1. TehReason

    TehReason

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

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    6,988
    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.
     
    XaloX likes this.
  3. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    6,988
    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. pxlweaver

    pxlweaver

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

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    6,988
    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.
     
    pxlweaver and Acissathar like this.
  6. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    6,988



    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:
    889
    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:
    72
    @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:
    6,988
    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:
    72
    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:
    6,988
    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:
    72
    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:
    24
    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:
    6,988
    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:
    24
    Cool beans! Thanks dude. ;)
     
  16. jamesnw

    jamesnw

    Joined:
    Mar 23, 2013
    Posts:
    24
    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:
    6,988
    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:
    24
    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:
    6,988
    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:
    24
    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:
    6,988
    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:
    6,988
    New feature for next InfiniGRASS version, around player customizable planting

     
  23. nasos_333

    nasos_333

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