Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

[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,582
    That's the plan! Going to also make sure I integrate CTS' grass mask for out of range grass or make my own optimized approach for it :)
     
    Hexaedre and wood333 like this.
  2. guidoponzini

    guidoponzini

    Joined:
    Oct 4, 2015
    Posts:
    55
    Very good news... In my project I'm using Microsplat and it's a killer shader, great for looking and performance, one of the most impressive (and I tried most of them, before I used RTP and tested also CTS)...

    @ElroyUnity a suggestion: for a 2.5km x 2.5km terrain a sector precision of 10 (default) it's ok or should be optimized? It can help to add a more dense vegetation (actually I'm keeping 10 in sector precision and 0.34 in foliage coverage with 200 of view fade)
     
    ElroyUnity likes this.
  3. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey -
    Sector precision on UNTerrain is only for interactable trees and its multi-threaded, so around 10 is fine :)
    Regarding the dense vegetation, not really, the biggest issue atm with the current uNature is the way the grids work and so resolution support is broken, you can try to increase the amount of "Max generatable density" but other than that there's not much to do :/.

    This is the main thing that I am focusing on with the new uNature - how to get double the amount of grass with the current uNature performance which is already super fast. So far been getting some really great results and when the beta starts hopefully it will be visible :)
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    3,715
    MicroSplat and MegaSplat will both output a render of the terrain's albedo map, which can be used to tint the grass. MicroSplat currently ships with grassmap support for Vegitation Studio, but if you want I can add a module to support it for unature as well. The same feature can be achieved in MegaSplat via it's Macro Texturing system.
     
    Alverik, ftejada, boysenberry and 5 others like this.
  5. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    109
    That would be very very nice as I am using Unature with MapMagic and Megasplat. I can't wait for it. :)


    I have an issue with the grass distance on my MapMagic terrain. When I adjust the Fade Distance parameter (both general and per grass), the grass doesn't show further than 100 units, approximatively.
    I haven't saw anything in the MapMagic settings that have an influence on the grass distance.

    For the advanced shader, have you consider to add the possibility to pack the Ambient Occlusion in the Normal's alpha chanel, in order to save space ? Or maybe let us choose manualy wich chanel we wanna use, so we could use a normalAO texture on both slots and choose to take the alpha chanel on the Ambient Occlusion slot.
     
    ElroyUnity likes this.
  6. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Absolutely amazing! Will be in touch in the next couple of weeks and bring it into the remastered uNature :).
     
    Last edited: Oct 12, 2017
  7. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Are you changing it through MapMagic or through the foliage manager? Are you also applying the changes after doing so?


    Yes absolutely, that's the plan, in fact added lots of compression into new uNature and I mean LOTS. the whole memory usage is insanely impressive now. I feel like I am just talking too much, but I will definitely show some results in the next few weeks :)
     
  8. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    109
    Problem solved. The Material Cutoff value was damn too high.

    Well, I am quite hyped now. :)

    Do you plan to add fancy stuff like support for translucency texture and emissive texture ? Partially glowing grass could look really nice.
     
    ElroyUnity likes this.
  9. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Yes! I also plan on adding my own generic fire burning system but some of it might come in later updates :)
     
    wood333 likes this.
  10. Kelos

    Kelos

    Joined:
    May 27, 2014
    Posts:
    11
    I cann't find documentation anywhere (publicly available). So i will ask my questions here:

    1) I have dynamically generated Voxel terrain. It comes in form of small chunck meshes. Meshes are recreating, as player moves (LOD). I have sort of map of different grass destribution.

    2) I want to be able to change planted grass - eg cut grass, plant wheat, etc.

    Is this possible with your grass solution? What kind of data i would need to provide for grass planting?

    3) As i understand, your trees solution only for Unity Terrain? You mentioned something about UTrees. Any news there?
     
    ElroyUnity likes this.
  11. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey, feel free!

    2) Yes of course, simply use FoliageCore_MainManager.instance.SetDetailLayer just like in unity but use world coordinates :)

    All you need to provide is an index from the uNature prototype and densities. IDs are very easy to get, let me know when you get to it and will let you know the easiest way according to your situation :)

    3) "As i understand, your trees solution only for Unity Terrain? You mentioned something about UTrees. Any news there?"
    Yes as of now. The new version will have a new trees solution for both performance and interaction, its a secret though ;)
     
  12. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Hi @ElroyUnity

    Couldn't tell from your tutorial videos as you always used terrain, but does uNature allow painting grass (both mesh and texture-based), as well as trees to static meshes (with colliders)? I don't use a terrain.

    Thank you.
     
    ElroyUnity likes this.
  13. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey-

    Grass yes, trees no (As of now ;))
     
  14. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Thank you for the reply. But are the trees still sent to the GPU, or do you need to use a terrain for that?
     
    ElroyUnity likes this.
  15. Kelos

    Kelos

    Joined:
    May 27, 2014
    Posts:
    11
    And what do i need from mesh? UV mapping for detail map, or does it work just in X-Z coordinates?
     
  16. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    At the moment, the trees system is only interaction, no special performance or anything like that. So at the moment its not that special. New version will bring some major changes, but will expand on that in the future when I have something to show :)
     
  17. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    It works in X-Z coordinates :)
     
  18. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,171
    Hi
    A few questions and problems:
    1) Can I use this only for grass and ignore trees? I already wrote my own tree system and I'm happy with it so I don't need trees to be touched.
    2) My terrain is already done with all trees and grass positioned properly. Does uNature keep them? It seems that it auto generates the grass while I walk so it destroys whatever painting I've done using gaia and other tools.
    3) I installed the asset, added quick unature and after a while calculating, all my grass is gone from the terrain. I had to recover from a backup. Why would my grass be gone? When I hit play it's not there either.
     
    ElroyUnity likes this.
  19. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    1) Yes, simply don't attach UNTerrain and disable the tree toggles on the UNSeeker.

    2) Yes, once you copy foliage (either from UNTerrain or Window/uNature/Helpers/Copy Foliage From Selected Terrains

    3) did you put the terrain layer as the generation mask in the foliage manager? did you also attach UNSeeker to the camera?
     
  20. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,171
    Nope, i just followed the pdf tutorial, added Quicksetup_applyUnature. How should I do it then to not lose my existing terrain? I don't find anything on the pdf
     
    ElroyUnity likes this.
  21. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    You can use the backup feature on the UNTerrain.
    Send me your contact details (skype if possible) in PM so I can help you better!
     
  22. Mighto360

    Mighto360

    Joined:
    Sep 15, 2016
    Posts:
    68
    "Interactable Trees" Does that mean I can have scripts on trees?
     
    ElroyUnity likes this.
  23. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Not precisely. You can interact with a dummy collision that represents the tree and then the system converts that terrain tree into an actual object when you want to run scripts on that tree :)
     
    wood333 likes this.
  24. Mighto360

    Mighto360

    Joined:
    Sep 15, 2016
    Posts:
    68
    And then does it turn back into a tree when you move away?
     
    ElroyUnity likes this.
  25. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Not built-in but very easy to implement. Great idea, will do that!
    The main idea is that you can turn it into an object, you don't have to.
     
  26. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    @ElroyUnity

    Running 2017.2.0f3 and got the following errors on import into a blank project:

    Code (csharp):
    1. Assertion failed: Assertion failed on expression: 'scriptParameterClass != NULL'
    2. Assertion failed: Assertion failed on expression: 'scriptParameterClass != NULL'
    3. Binary to YAML conversion: type UInt16 is unsupported
    4. Binary to YAML conversion: type UInt16 is unsupported
    5. Binary to YAML conversion: type UInt16 is unsupported
    6. Binary to YAML conversion: type UInt16 is unsupported
    7. Binary to YAML conversion: type UInt16 is unsupported
    Also, every time the project is opened, an instance of the first error always shows up.
     
    ElroyUnity likes this.
  27. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Interesting, I will try that today and see why its happening, although doesn't seem to be a uNature issue from the logs. Will give it a shot!

    Also guys just a reminder, the remastered version beta will come out somewhere in novemeber (not promised, might be a bit later than that). Once I am closer to the release date I will start recruiting testers. :)
     
    Mark_01 likes this.
  28. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Thank you. Just need 2017.2, but only install uNature in a blank project.
     
    ElroyUnity likes this.
  29. GarretPolk

    GarretPolk

    Joined:
    May 26, 2013
    Posts:
    49
    I've implemented cutting down grass in my game, but these changes are being preserved when I load a new fresh game (without exiting the application). Is there an easy way to restore terrain details back to their original state? I've tried calling ApplyBackup() at runtime but that doesn't work.

    Thanks.
     
    ElroyUnity likes this.
  30. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Cutting uNature grass or unity grass? unity grass is being preserved but uNature isn't. Preserving the unity details isn't really a feature... sorry for that :)
     
  31. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    381
    hi there
    after i trying to change foliage area resolution my grass disappear and i got this spam of error

    ArgumentNullException: Argument cannot be null.
    Parameter name: value
    UnityEngine.MaterialPropertyBlock.SetTexture (Int32 nameID, UnityEngine.Texture value) (at C:/buildslave/unity/build/Runtime/Export/Graphics.cs:469)
    uNature.Core.FoliageClasses.RenderingQueueInstance.Render (UnityEngine.MaterialPropertyBlock mBlock, UnityEngine.Camera camera, UnityEngine.Plane[] cameraPlanes, Vector3 normalizedCameraPosition, Boolean instancingEnabled) (at Assets/uNature/Scripts/Core/Utility/RenderingPipelineUtility.cs:496)
    uNature.Core.FoliageClasses.RenderingQueue.Render (UnityEngine.Camera camera, UnityEngine.Plane[] cameraPlanes) (at Assets/uNature/Scripts/Core/Utility/RenderingPipelineUtility.cs:313)
    uNature.Core.FoliageClasses.RenderingPipielineUtility.RenderQueue (uNature.Core.FoliageClasses.RenderingQueueReceiver receiver, UnityEngine.Camera camera) (at Assets/uNature/Scripts/Core/Utility/RenderingPipelineUtility.cs:152)
    uNature.Core.FoliageClasses.FoliageMeshManager.DrawEditorCameras () (at Assets/uNature/Scripts/Core/Foilage/GPU_Utilities/FoliageMeshManager.cs:509)
    uNature.Core.FoliageClasses.FoliageMeshManager.Update () (at Assets/uNature/Scripts/Core/Foilage/GPU_Utilities/FoliageMeshManager.cs:497)
    uNature.Core.FoliageClasses.FoliageCore_MainManager.Update () (at Assets/uNature/Scripts/Core/Foilage/GPU_Utilities/FoliageCore_MainManager.cs:315)
     
    ElroyUnity likes this.
  32. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey, changing the resolution atm is not supported, coming soon in the remastered version though. the beta will be available in november :)
     
  33. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Any luck, @ElroyUnity?
     
    ElroyUnity likes this.
  34. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey - not yet, downloading the unity version now and will check it out :)
    Are they permanent errors (doesn't allow you to play the game) or just errors that happen once and disappear
     
  35. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Appears on project launch, and every single time the game is run.
     
    ElroyUnity likes this.
  36. GarretPolk

    GarretPolk

    Joined:
    May 26, 2013
    Posts:
    49
    Cutting uNature grass using GetDetailLayer()/SetDetailLayer().
     
    ElroyUnity likes this.
  37. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey, just checked, can't reproduce :/. What version are you using? (uNature)

    Interesting, what version are you using?
     
  38. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Latest. Only got uNature a week ago.
     
    ElroyUnity likes this.
  39. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Fair enough. Send me your skype privately and I will take a look from your POV. But if its not really crucial (doesn't stop you from playing) it should be fine. Probably just a unity bug.
     
  40. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    Nothing to see. Just creating a new project in 2017.2.0f3 and installing uNature instantly reproduces it. Guessing you're on a Mac (lots of Mac OS inconsistent line ending warnings on import), so I'm curious if you have a copy of Bootcamp to test on. This could be a Windows thing, which concerns me.
     
    ElroyUnity likes this.
  41. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    I am on windows :)
     
  42. lod3

    lod3

    Joined:
    Mar 21, 2012
    Posts:
    621
    ElroyUnity likes this.
  43. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
  44. GarretPolk

    GarretPolk

    Joined:
    May 26, 2013
    Posts:
    49
    2.2.1
     
    ElroyUnity likes this.
  45. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Interesting, I will try to reproduce it today and let you know!
     
  46. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,079
    I have a big terrain.. with alot of trees, 8x8km to be exact.. and much different grass.. Does this system support only NONE-mesh variants of grass? does it support any other types of trees away from speed trees? I have alot of custom shaders.. will this use unity terrains or can I use advanced foliage shader 5 on this? Can I spawn with Gena, or only unity terrrain paint?

    linear or gamma?
    forward or deffered?
    shadows, lightning maps and such?

    Thanks,

    AstralStorm Games
     
    ElroyUnity likes this.
  47. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Hey,

    Does this system support only NONE-mesh variants of grass?

    No, you can use mesh-grass as long as it has 1 mesh and 1 material. Furthermore, if you have an LODGroup attached it will read the lods and use them in the system.

    does it support any other types of trees away from speed trees?

    Current version doesn't optimize trees, it only makes them interactable. New version that is being remastered will have support for trees (similar to the grass system)

    will this use unity terrains or can I use advanced foliage shader 5 on this?

    The grass system has a custom shader. You can integrate different shaders but its a bit complicated for shaders like AFS. I do plan to revisit that in the remastered version as it might not need a custom shader.

    Can I spawn with Gena, or only unity terrrain paint?

    Well, no direct copy from terrain, but you can just recopy the foliage every time you make changes to the terrain. Sorry if it sounds reptitive but remastered version supports direct terrain input.

    linear or gamma?

    Both

    forward or deffered?
    Both, haven't heard any issues regarding that. Been using both in my projects as well.

    shadows, lightning maps and such?
    Shadows - supported BUT not recommended for dense areas as its super heavy. Working on a solution for that for the new version to make it lighting fast. More news when I get closer to the beta ;)
    Note, that I do recommend using HBAO as it provides a neat effect for depth in the grass without sacrificing a lot of performance.

    Light maps are not supported, might revisit it in the remastered version though
     
    jimmikaelkael and ftejada like this.
  48. GarretPolk

    GarretPolk

    Joined:
    May 26, 2013
    Posts:
    49
    I was able to restore the grass by calling ApplyBackup() then InsertFoliageFromTerrain() when starting a new game.
     
    ElroyUnity likes this.
  49. ElroyUnity

    ElroyUnity

    Joined:
    May 20, 2015
    Posts:
    1,582
    Fair, I will research and add that into the bug list :)
     
  50. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    544
    Need an advice, my grasses (not mesh) are flying about 5 cm away from the ground. What can I do to fix that? I'm using RTP shader for the terrain if it's matter.
     
    ElroyUnity likes this.