Search Unity

[NEW PATCH] uNature - GPU, Interactable Grass. Interactable Trees, MultiThreading and more!

Discussion in 'Assets and Asset Store' started by ElroyUnity, Apr 29, 2016.

?

Pre-release Integrations

Poll closed Nov 29, 2016.
  1. TerrainComposer2

    43.1%
  2. GAIA

    54.9%
  3. GENA

    49.0%
  4. World Creator

    13.7%
  5. World Streamer

    37.3%
  6. Map Magic

    27.5%
  7. Landscape Builder

    0 vote(s)
    0.0%
  8. SkyMaster ( Weather )

    7.8%
  9. InfiniGrass, AFS, DX11 (Integration will provide built-in shader support)

    33.3%
Multiple votes are allowed.
  1. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Uhmm what do you mean? do you have a screen shot? Also do you have tesselation enabled?
     
  2. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Experienced the same. Sometimes the grass ends up floating, even if painting on a flat surface. I've just been erasing and re-painting over and over when it happens to get rid of it. A Y offset would be good to have.
     
    ElroyUnity likes this.
  3. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Fair, never saw that but will add!
     
  4. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Yes, tessellation is on. Flat surface, grass doesn't touch the ground. I will try to play with RTP settings to see if it is really a tessellation issue. But if you could add an offset it would be awesome.
     
    ElroyUnity likes this.
  5. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Fair enough :) Will add offset!
     
    montyfi and lod3 like this.
  6. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Thank you!
     
    ElroyUnity likes this.
  7. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    My pleasure. I hope to include a fix this week with mostly errors fixing. Will include offset in it and next up would be map saving changes to be faster and have it consume less memory and then the new remastered uNature.
     
    wood333 and montyfi like this.
  8. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Another question, how to increase grass density in uNature?
    Attached picture is for max density 20. I have increased terrain detail resolution to 2048 and can draw huge amount of grass using terrain tool, but uNature just ignores that parameter? Terrain is small 200x200x100
    grass.png
     
    ElroyUnity likes this.
  9. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Asset store uNature has issues with resolutions and so it doesnt align to the terrain resolution. That's mainly because the grass is managed in a world grid and the grass isn't really per-surface. That's changed in the new uNature but even so, it seems like the density is still WAY too low in the picture. If you use the uNature brush, set it up to max density does it still draw this low density?
     
  10. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Yes, on that picture brush is set to max 20 and per texture also set to 20. But you said the new version will be ready this week? That's fine for me, I can wait.
     
    ElroyUnity likes this.
  11. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Just FYI, it looks better if I mix 4 prototypes. Not good, but better.
    grass.png
     
    ElroyUnity likes this.
  12. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey - not the remastered but a version with some fixes :)

    Regarding density - send me your skype in a pm I will have a look. Shouldnt really be that weird looking...
     
  13. GarretPolk

    GarretPolk

    Joined:
    May 26, 2013
    Posts:
    49
    uNature creates massive scene files. Even the uNature demo scene "ForestDemoScene_Terrain.unity" is 168MB !! I'm assuming UN is storing its data in a very inefficient manner in the scene file. Do you have any improvement planned for this in the future?

    I can't use uNature in it's current form like this. My scene files are bloating 50-200 MB depending on the terrain size.
     
    ElroyUnity likes this.
  14. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yes you are correct. In the middle of finishing a patch. I hope to submit it by friday, sorry for the major inconvinience!
     
  15. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    Hi yesterday I bought your asset. It seems good but I hit some struggles fitting asset to my case.

    1.) I will need to set size & resolution of "Default Chunk" gameobjects with Foliage_Core_Chunk script to 1024 ( to fit my terrain grid)

    2) Why I need this is because I would like to give chunks reference directly to HM & NM from RTP asset. This will cause another issue as it seems that you use HM and NM sepratedly... but this can save 1 Sampler and also it will be able to share one map with terrain so i can change both with once. When terrain change in runtime. Issue is to have same chunk size of terrain as uNature, to make it work. Rewrite parts which reads chunk normal map and Heighmap to feed it with my way... .Adding preview of that combinated map for maybe inspiration (R-height first 8bits, G - height last 8bits, B- X normal, A - Z normal):


    3) Can I somehow remove unused chunks (like I need just 3x3 not 40*40 so it could also save some performance, at least that feeling having on scene 1600 unused objects with colliders...). I am not sure to test if I can simply remove chunks from Foliage_Core_sector and delete them and nothing will crash...


    4.) I noticed that grass is spawned on grid directly so you can see lines and order. I could not find anything which could spread them more randomly.


    I know you have deep documentation (177 pages), but if you can tell me anything from mind it would save me a lot of time. Seems promisive althought and I believe I will be able to fix these issues and then just give it 5 stars :)
     
    Last edited: Nov 13, 2017
    ElroyUnity likes this.
  16. Sailing

    Sailing

    Joined:
    Sep 6, 2015
    Posts:
    12
    i can see the grass in editor and don't see in game mode, i have add "UNSeeker" component, and still can't see the grass in game mode.
     

    Attached Files:

    ElroyUnity likes this.
  17. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    1) Not possible with the current asset store version, will only be possible with the remastered version. Infact, the remastered version makes this all much easier because instead of being a grid of 40x40 its actually per-surface and so you just attach it to the terrain and it fits to the terrain :).

    2) Yep exactly, bad decision from my end, I might push that as a fix in the friday patch. (in the remastered version uNature only uses 2 maps for everything, so no 1 map per prototype and stuff)

    3) Give it a shot, I haven't actually ever tried to remove them. But either way they shouldn't be harmful. If not possible to remove them completely just remove their colliders. Should do the trick.

    4) Try playing with the spread in the prototype. if doesn't work it might be the lods that aren't tweaked properly and so try to disable them (make sure to enable them later on tho after you fix the lod settings as they are very important)
     
  18. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    That's really strange, send me your skype on a PM so we can screen share. It will be easier to solve it that way :)
     
  19. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    @Elroy great to hear you will save some of my time by that patch. So I will work more on grass shaders and trying to solve issues which can be solved out of your scripts :) Thanks. I took a look to 4) and all prototypes have spread Noise of 2. Which was taken from terrain and it should spread well not much uniformly.
     
    ElroyUnity likes this.
  20. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Seeing this as well. New test scene with just a quad surface and a medium-sized patch of grass is already 44MB.

    Seems you can safely delete unused chunks. I only use 4, so there was a lot of grid going to waste. Didn't see any change.

    @ElroyUnity So glad to hear collision of chunks can be disabled. Working with purely mesh surfaces (no terrain), and I was constantly getting grass painting on chunks well beneath the playing ground that I had to keep erasing. Makes painting so much easier. Mind if I inquire as to the purpose of the chunks having collision at all? Doesn't seem like a location one would want there to be foliage.
     
    ElroyUnity likes this.
  21. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    I think it has colliders just to be clickable in editor ;) But did not studied it deeply yet.
     
    ElroyUnity likes this.
  22. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    No problem!
    And regarding spread - weird... maybe the width and height noise is too low? try increasing it

    Oh I see good to hear regarding the chunks, regarding why they have colliders - so you can paint on them of course. the grids are essentially paintable areas, in the remastered version as mentioned before its a lot easier because the paintable area is actually the surface and not the grid which makes it a lot simpler.


    Regarding scene size - yep... nothing I can do till the patch is released (hopefully this friday as I mentioned) or remastered version (which is a bit further away)
     
  23. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yep both to be selectable by the mouse (so you can inspect it in the bottom of the main manager window) and so the brush can identify the surface with a raycast (Which could be changed, but still needed the colliders for the first cause)
     
  24. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Well fingers crossed for this Friday then (unless remastered is planned within 3 weeks from now). And will this fix be seamless, or will all grass need to be painted again?
     
    ElroyUnity likes this.
  25. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Repaint unfortunately as I am rewriting the maps approach :)
     
    lod3 likes this.
  26. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    That's fine. Thank you for the heads up; will save me a lot of wasted work.
     
    ElroyUnity likes this.
  27. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Anytime! keep me updated if you have any more questions!
     
  28. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    Well I am about to finish my Issue 1): answered as impossible :D Everything now seems correct working on 3*3 1km square chunks. Maps for chunks are correctly generated, Instance for terrain created on correct place only issue it freeze as I come closer to grass level... I will investigate, it seems like there are some data in RenderingQueueInstance which are still old (so broken with changes) On the other hand it tries to render! means it knows that there is a really grass! Which is good new, saying it is on the good way.
     
    ElroyUnity likes this.
  29. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Uhmm interesting... keep me updated on that!
     
  30. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    OK I found what caused Issue. Also I am pretty sure It threw error few times even before I touched it. The issue is RenderingPipelineUtility.cs:262 KeyNotFoundException: The given key was not present in the dictionary.

    This is pretty weird it was caused by prototypes last 2 prototypes and only on few spots and for few frames... Strange also is, that it says 33 prototypes despite as far as I count I have 29 attached to terrain and uNature. Anyway this row was replaced with:

    renderingQueue.queueInstance.TryGetValue(prototypes[prototypeIndex].id, out renderingQueueInstance);

    which check if this issue happens or not and since that time unity editor never crashed...


    Same issue throws FoliageManagerInstance 572... As I look on this whole function (row 563) it does absolutely nothing and whole function can be removed)

    Also I see at FoliageCore_MainManager 740 empty if... does it have any purpose?
     
    Last edited: Nov 14, 2017
    ElroyUnity likes this.
  31. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey, yea those are completely removed in the new patch, sorry for letting you wait on this and fixing it on your own :)
     
  32. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    My sorry that I am right now trying to implement your asset :D I always need something special, as it does not work for my case without touching it. Maybe only SSAO I bought works :D

    Well can I ask you what are these textures?
    They are grassMaps per prototype in Foliage manager instance. It should define where that grass grows right? But all looks same and it does not make me a sense how is it encoded whyt it uses 2 channels with such noise. Just asking because I would expect something like 4 channel atlases (4 prototypes per 1 texture) Just copying values from terrain and merging them to separated channels. This seems way complex, so I am asking to learn something new about coding :) P.S. I am not right sure if unity uses 256 range per prototype maybe not... it would mean even more protypes per texture.
     
    Last edited: Nov 14, 2017
    ElroyUnity likes this.
  33. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey, these textures include perlin and noise and densities. This approach is wrong and already fixed in the remastered version. Will try to include it in the friday patch :)
     
  34. Kusras

    Kusras

    Joined:
    Jul 9, 2015
    Posts:
    134
    OK, in other words, do not touch my asset, because something great will come. Well great to hear. So I will focus on grass shader and keep waiting. I am adding just one my problem I will solve, not needed to be included, but maybe you will take it as a good idea too. I will make one texture layer called mask. because in my game I need to cut my grass on places and grow it again (players build buildings so I cut grass under structures). What was pity in classic terrain was, that I had to set all layers separatedly, store their data, for future structure removal and so grass recovery. Which is not absolutely fastest so I will do one mask layer which will multiply probability of grass. So you can easily remove all grass at once or restore them, because data in all prototype growth textures remain unchanged. As said I have to do it anyway. Just saying if you would like to make it too it would just save me some time, but not sure how is it needed by other customers / you :)
     
    ElroyUnity likes this.
  35. GarretPolk

    GarretPolk

    Joined:
    May 26, 2013
    Posts:
    49
    I ran into this issue as well. Try changing the "Material Cutoff" slider in each prototype. It makes a big difference to the 'size' of each grass texture.

    I made a video explaining some sliders and how they affect density.
     
    mattis89, montyfi and ElroyUnity like this.
  36. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Mask layers will be added of course!
    you will also be able to manipulate the shape of the vegetation using it.
    For now you can just use the FoliageCore_MainManager.instance.SetDetailLayer for this purpose which should work just fine :)

    Great video! Thanks for posting :)
     
  37. Sailing

    Sailing

    Joined:
    Sep 6, 2015
    Posts:
    12
    hi ,Elroy, I got these errors on IOS when I load scene, and it crash.

    2017-11-16 23:21:02.567895+0800 UnknowWorld[7738:1638875] Compiler failed with XPC_ERROR_CONNECTION_INTERRUPTED

    2017-11-16 23:21:12.795596+0800 UnknowWorld[7738:1638697] Compiler failed with XPC_ERROR_CONNECTION_INTERRUPTED
     
    ElroyUnity likes this.
  38. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey,
    Unfortunately it doesn't tell me much :/ Do you have an editor log? (if it happened on the editor) or output log if it was on IOS
     
  39. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    @ElroyUnity

    How are things looking for the patch today? And will this only be submitted to the store, or can we send you our invoice to get a copy to avoid waiting for it to appear on the Asset Store?
     
    ElroyUnity likes this.
  40. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey,
    You will be able to get it before submission, I will probably have it done only this weekend (somewhere around Sunday) mainly because a few bugs were reported yday regarding IOS and more, going to fix it and then send it to you all :)
     
  41. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    Would it be too much of a bother for an interim patch that changes how you store foliage? This at least allows work to begin since you stated grass will require re-painting post-change.
     
    ElroyUnity likes this.
  42. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Yea it's a bit problematic because its a bit buggy as of now, working on a fix as fast as possible... sorry for that! Once done it will be released straight away :)
     
  43. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Hi Elroy! I'm testing dynamic terrain generation with MapMagic version 1.8.4 and uNature version 2.2.1 (+ your Oct 8th MM patch v0.2). I have followed all the integration steps on https://gitlab.com/denispahunov/mapmagic/wikis/Problem_solving.

    Unfortunately, this combination isn't working reliably for me. No issues are 100% reproducible, but all of the following are happening regularly for me:
    * Grass appearing hundreds of meters above or below dynamically generated MM terrain tiles.
    * Grass appearing with 100% uNature coverage for certain terrain tiles, even though these terrains contain only a small amount of grass in limited areas.
    * uNature vegetation disappearing after 10-15 MM terrain tiles have been generated, with a "IndexOutOfRangeException: Array index is out of range." being thrown inside the uNature code.

    Is MM integration expected to be functional right now, or should I wait 'till the next release?
    I'm happy to set up a testcase to reproduce each of these as much as possible if it would be useful.
     
    ElroyUnity likes this.
  44. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Hey!

    Yea the map magic integration is super unstable atm, its due to how the system works (asset store uNature that is), best bet atm is waiting for the remastered or actually I could write my own output generator just for uNature, might work the best. I will research that and keep you updated!
     
  45. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    679
    So does this mean it's possible that it won't be part of tomorrow's patch?
     
    ElroyUnity likes this.
  46. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    The maps stuff? they will be :)
     
    lod3 likes this.
  47. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Elroy - a custom MM output generator would be fantastic. I would anticipate that approach to be not only more reliable, but significantly more efficient as well.

    Where I'm at right now, uNature is interesting to me for three reasons. Compared to Unity's terrain vegetation system your solution is faster, looks more realistic, and doesn't suffer from chunk-based point lighting that destroys the immersion of my night scenes. I understand that you have many other customer use cases to consider and prioritize, just wanted to provide a MM-oriented workflow perspective.
     
    ElroyUnity likes this.
  48. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    A little update regarding the update -
    The new update includes a new approach for map saving which reduces memory usage drastically by adding compression and making the system only use 2 maps (heights and density). Before, a density map was used for each prototype, now its used once globally. There's a limit though, it limits you to drawing only 2 prototypes at once on the same point, which is not that bad, that limitation is increased to 4 in the remastered version, but not possible to implement in the asset store version just yet.

    I am working hard on it, but its a bit buggy atm, I hope to finish it today, but if not then it will come out soon enough, I really don't want to force it too much but I promise it will come out soon (as I said, hopefully today)

    Will keep you all updated!
     
    mattis89 likes this.
  49. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151

    Drastically memory redusage is nice...25gb gone is drastic :D so.. maybe I dont need to buy 16gb ram more then :D
     
    ElroyUnity likes this.
  50. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,588
    Haha yep!, I hope it will fix all of your issues with the ram usage, been a tough thing to counter because its so different than the remastered version but doing my best to get it into the asset store version for you guys :)