Search Unity

[RELEASED] Vegetation Studio

Discussion in 'Assets and Asset Store' started by LennartJohansen, Jun 23, 2017.

Thread Status:
Not open for further replies.
  1. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
  2. froslie

    froslie

    Joined:
    Apr 20, 2015
    Posts:
    18
    I am trying hide/ show vegetation studio during runtime. For example, I have bare terrain and then turn all of the vegetation on.

    Have tried enable/ disable the object containing the asset; am trying a cullingMask.

    Any advice will be greatly appreciated!

    Vegetation studio continues to be a wonderful asset!
     
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Can Vegetation Studio be used without a terrain object?
     
  4. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,783
    Soon :)
     
    FargleBargle, Mark_01 and blitzvb like this.
  5. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Fantastic. :)

    I don't at all mind a terrain being a part of the workflow, but being able to export to a mesh and keep stuff like landmarks is important.
     
  6. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    196
    Does anybody know where the micro splat integration video and guide is? I thought it was in this thread somewhere but I can not find it anymore.
     
  7. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
  8. JohnTomorrow

    JohnTomorrow

    Joined:
    Apr 19, 2013
    Posts:
    135
    Hello, I am new to Vegetation Studio. We are using it in conjunction with MapMagic runtime generation. In the profiler I am seeing huge numbers which contribute to frame drops. Can anything be done about this? Any optimizations or settings I should consider?
     
  9. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    numbers of what? more information perhaps screenshots would be quite helpful
     
    Last edited: Feb 9, 2018
  10. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    If you send me a pm with a profiler screenshot and some more info of your setup, terrain sizes etc. I can try to help you with setup.

    Lennart
     
  11. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    What unity version and platform are you using? I can try to find the error and see what I can do with it.

    Lennart
     
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Was it this guide?

    Lennart
     
  13. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will send you a pm.

    Lennart
     
  14. SuperNewbee

    SuperNewbee

    Joined:
    Jun 2, 2012
    Posts:
    196
    Yes. thanks
     
  15. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello Lennart, When there will be avliable smooth lod beetween speed tree, Any progress in this feature? It is very important, for optimization, speed tree without smooth lod looks horrible :)
     
    blitzvb likes this.
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes, have a running prototype. It will be done with a modified speedtree shader. Setup is simple just change from the default to the new. Shader will also support instanced indirect for speedtree grass.

    This will be finished after mesh terrain support is done.

    Lennart
     
    RonnyDance, blitzvb, lawsochi and 4 others like this.
  17. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Unity 5.6.5, Veg. Stud.: 1.1.0.7 and first seen this bug in 1.1.0.0 (In 1.0.x.x the bug was not available)
    I have a heavy issue with your asset. This blocks working with Unity, the crash comes very sporadic:

    bandicam 2018-02-11 01-45-54-524.jpg

    Then all the work is lost and I have to wait to for Unity after loading the projects again (reimport stuffs).
    The Backtrace shows (Not sure the names matches exactly):

    AwesomeTechnologies.Touchreact.TrSceneView.Detector.UpdateEditorCallback

    However, Unity is pretty bad in telling us what is wrong, this could be another issue, even if the backtrace shows your asset. Plase check this in your code.
     
  18. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Don't you have the option to send the crash report to unity? Unity crashed for me once recently and it was trying to send the state of my machine to them.
     
  19. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    And then waiting 1-2 years to have a fix for it or not? Could you provide Vegetation Studio 1.0.0.0, whatever the first version was? I also updated at the same time unity to 5.6.5 (from 5.6.4), but the last thing was Vegetation Studio. I will also try to downgrade Unity to 5.6.4, after I check a bit better the crash.
     
  20. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. I will send you a pm to get some more info.

    Lennart
     
    mkgame likes this.
  21. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    I was just trying to find out how Horizon[ON] of @Becoming and Vegetation Studio can work together. I think they work together very well. I'm using the terrain and Vegetation Studio as sandbox where the dragon can fly around. Horizon[ON] was integrated for immersion. In case someone wants to see it and create similar, this is how it looks like after a first 1-hour-development-test:

     
  22. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Thanks for your help! Downgraded Unity to 5.6.3 seems to be solved the problem. Still no crashes under Unity 5.6.3.
     
  23. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Since people noticed I was using the Touch React System in the video above and asked how to do it several times now I thought I'd give the instructions because the official tutorial is tl;dr :D

    • add a gameobject, e. g. a Sphere
    • add the TouchReactCollider.cs script to the Sphere
    • add a Collider (in my case a Sphere Collider) to the Sphere and set it to Trigger

    Yes, that's it ;)

    Also there's some kind of beauty in a sphere rolling down the hill :)

     
  24. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I was also wondering why it's not working for me and well it seems that it's because of my Invector Thirdperson Controller for the Character. By using a Collider with isTrigger the Controller uses the isTrigger method for internal invector events. So VS does not get any events I suppose. I have attached the Capsule Collider to the Controller perhaps there is another way by creating it outside the controller so VS can use the IsTrigger method. The Collider is detected by the VS Touch React System in Debug mode. But still TouchReact does not work with the InvectorController as I can see. With Objects like Stones etc. which are spawned by VS it works fine...

    How do you guys fix the spawn vegetation on vegetation issue?
    Both have Collision Detection enabled. The tree does have a capsule collider and the stone a mesh collider. Still they are spawned over each other.
    collision.JPG

    Cheers
    Ronny
     
    Last edited: Feb 12, 2018
  25. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Vegetation Studio was not the reason, just a victim! These crashes stopped after I removed the Library folder and Unity rebuilt it from the .meta files. This took me about 8h, but this is a known issue...
     
    Rowlan likes this.
  26. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    I will do a more detailed guide for a setup of the car example and Touch React.
    I can also add a small sample scene in the next update of the asset.

    When the guide is ready I will post it here.

    Lennart
     
    Goodgulf likes this.
  27. dajyareo

    dajyareo

    Joined:
    Dec 7, 2014
    Posts:
    11
    Looking into buying this... but one must-have feature for us is the ability to remove trees/grass at runtime based on collisions. Is this possible with this asset?
     
  28. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Thanks, @LennartJohansen for your assistance on multi-terrain VS instances!

    A few specific questions follow, hopefully quick:
    • I don't see where we can set the distance for shadow rendering. That is, I see the toggle for shadows and billboard shadows but not a way to set the maximum distance from the render camera for shadows to render.
    • The range at which trees become billboards (10-700 units) in 'Vegetation Distance' is a bit tight; can I override this? I am aware of the 'Additional mesh tree distance' field but would like to increase its range (0-1000), too.
    An example frame is shown below, where only the near foreground trees are shadowed; the mid-frame trees without shadows stand out without shadows, particularly at the trunk/terrain intersection:



    I would resolve this shadow line by scaling the scene, but I am importing GIS landmarks that assume 1 unity = 1 meter, so scaling the whole scene would be difficult given these upstream connections.
     
    Last edited: Feb 13, 2018
  29. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Any suggestions for a strictly aerial viewpoint with large forests? If anyone has figured out useful strategies for a case where the viewer is always in flight, I'd love to know.

    Below are a few things I've been unable to do that this forum's regulars may have solved, e.g.:
    • Is there a way to ring the perimeter of a large dynamically spawned VS forest with 'hero' trees? It would be very helpful to surround masses of low-poly trees with a perimeter zone of high resolution hero trees. I could paint the perimeter but that would be likely require a lot of manual intervention, and I ran into the trouble I note below:
    • Is special setup required to paint trees in the persistent vegetation storage? I have created a persistent vegetation package and can place individual instances of tree species within that package using CTRL-click in 'Edit Vegetation', but can't seem to delete them with CTRL-SHIFT-click; also, direct painting with the available brush shapes has no effect in 'Paint Vegetation'. In the latter case, I see the tool shape but click-dragging does not add trees for me.
     
    Last edited: Feb 13, 2018
  30. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    Yes, this is possible. Depending on your setup there is multiple ways of interacting with the vegetation like that.

    1. There is a vegetation Mask system that allows you to create areas based on polygons run-time. These areas can filter out or even add new vegetation. Have a look here and here for more info.

    2. You can use the VegetationItem Mask for removing single instances of trees etc. There is a simple harvesting script in the demo scene that allows you to remove trees when you click it with an axe.

    3. The persistent storage system allows you to bake the result of the spawning rules with manually placed vegetation or imported from 3rd party tools. It has an API that allows you to add and remove individual instances of vegetation.

    4. For vegetation supporting instanced indirect rendering there is also a run-time mask. This mask is sampled every frame in the compute shader render loop and allows you to mask out vegetation.

    This lava example is done with the run-time mask.



    Lennart
     
  31. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    1. The shadow distance is controlled by the distance set for the scene in unity. Go to the menu Editor/Project Settings/Quality to set this to the distance you want.

    2. Hi. The additional mesh tree range is only limited by the setup in the inspector code. I increased it to 1000 meter now for the next update.

    If you want to do it yourself now open the VegetationSystemEditor.cs file and go to line 985. Replace the 700 with the distance you want.

    Code (csharp):
    1.  
    2. float newDistance = EditorGUILayout.Slider("Vegetation distance", _vegetationSystem.GetVegetationDistance(), 10f, 700f);
    3.  
    Lennart
     
  32. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    1. To add a perimeter of hero trees around other trees you can use the VegetationMaskLine. Have a look here.
    you can set the width of the line to the width of hero trees you want and add nodes for where the perimiter will be.
    You then add localized vegetation to the mask and set it to a VegetationType.

    On the hero tree you add to the VegetationPackage you set the same VegetationType. Those trees will now grow in the area of the line mask.

    2. when you hold Ctrl-Shift you should see a ring/click area by the base of the trees. click that to remove.
    The paint vegetation tool os for painting grass and plants, not individual trees.

    Have a look at this video for an example of editing trees manually.

    Lennart

     
  33. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
    Would it be possible to get a custom grass shader to work with the touch react system?
    I've made a grass shader in the amplify shader tool that supports translucency which works fine with VS except the touch react.
     
  34. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Maybe, problem is to get it to work in Amplity. It needs some custom code to sample the touch buffer and modify the vertices. You can probably do this by editing the compiled shader from Amplify, or is there a custom code node now?

    send me a pm and we look at it.
     
  35. nl2012

    nl2012

    Joined:
    Sep 29, 2017
    Posts:
    17
    First off, Veg studio is absolutely a brilliant piece of work. I can do just about everything i want do with the progam.Dense forests and field with great drawcalls and FPS One thing i don't seemed to get working (read all manuals and saw the vids) how do i paint f.e. a path like in the vids that automaticly removes all vergetation at the places where i paint. I tried the mask options (with textures) no no result. I sure i'am missing something or it is my english. My terrain is a Gaia terrain. (masking object works fine). Even a link to the discribing piece of documentation will do fine. thank you
     
  36. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394

    Hi. To do this you need to set up terrain texture exclude rules.

    What you do is select each VegetationItem (tree/grass/plants) that you want to exclude from where you paint a texture. Then set up a texture rule like this. In this example it will remove the vegetation item if the density of the location is from 0.1 -1 (10-100%)

    You can add mutliple terrain textures like this.



    Have a look here for more info.

    Lennart
     
    Mark_01 likes this.
  37. nl2012

    nl2012

    Joined:
    Sep 29, 2017
    Posts:
    17
    Thanks Lennart, that helped allot, thank you for your quick response!
     
  38. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    25
    We are using world creator to automatically generate our terrains based off of a height map that we can edit at any time. Our workflow calls for hand painted vegetation, so we are using persistent storage. But after the terrain has been regenerated, persistent storage data does not align with the new terrain.

    Is there a way to refresh the persistent data alignment? Or is it feasible for us to write such a tool ourselves?
     
  39. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Unity is currently doing a Hover Racer tutorial on their youtube channel. And they are so awesome to provide the source code of it. The obvious thing for me to do was to replace the desert and rocks with Vegetation Studio :D I had to use the Vegetation Mask Line for the first time in order to remove the trees from the race track, it's an awesome tool.

    Well, then one thing led to the other, I wanted to adjust the environment and add Enviro (sorry for cross-post there) etc. In case you guys want to see how it looks like, here it is:



    I especially like how the grass lights up in the dark from the hover racer's thrusters :)
     
    Last edited: Feb 14, 2018
    Malbers, pcg and FargleBargle like this.
  40. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    you would like to reallign the vegetation in the persistent storrage to the new heightmap? All of it or just a part you change?

    Lennart
     
  41. PiAnkh

    PiAnkh

    Joined:
    Apr 20, 2013
    Posts:
    126
    Lennart,

    Could you say something about baking the vegetation to the persistent storage?
    Am I right in thinking that this is what you do when you are finished and it will be a more efficient during run-time?
    Assuming of course that you do not need any dynamic run-time masking etc

    thanks
     
  42. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    First, from the last update you can now use vegetation masks run-time to mask vegetation in the persistent storage.
    You can enable this functionality per vegetation item on the persistent storage.



    The persistent storage has many use cases.

    1. You can "bake" the results of the run-time spawn rules to the storage. This you can do on the Bake tab on the Persistent Vegetation Storage component. It will then pre-generate all instances based on the current rules. Turn of run-time spawning on each vegetation item and load them from the storage run-time.

    This gives you faster load time as the cost of saving each instance in the storage. The storage is optimized for fast loading and stores the instances ready in the same cell structure as the vegetation system.

    2. If you paint manually using the tools in the persistent storage it will be stored and can be loaded together with run-time spawned vegetation.

    3. The storage has an API. Your game or 3rd party tools can use this API to add vegetation to the storage. This way you can use other tools also to generate vegetation for your terrain and have Vegetation Studio render it.

    4. There is an importer module. You can use this to import scene objects based on name, tags and layer as well as importin trees direct from the unity terrain.

    Lennart
     
    PiAnkh and Seneral like this.
  43. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    25
    All of it. Also things should reorient based off of new surface normals.
     
  44. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    368
    Quique-Martinez likes this.
  45. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will send you a pm explaining how you could add this.

    Lennart
     
  46. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    I seem to have no problem adding masks to multiple terrains, and they cull trees as expected in the Editor (see below, top).

    But after splitting the terrains with WorldStreamer and opening the corresponding player scene for the split terrains, the masks are ignored (see below,bottom).



    The white circle in the Editor view (top) shows one mask region which is ignored when the terrain is loaded at runtime (bottom circle) as we can see trees here.

    Has anyone seen this?

    To add masks I'm doing the following:
    • Add ‘Vegetation Mask Area’ script to relevant terrain
    • CTRL-click to define mask, and CTRL-SHIFT-click to delete initial default mask points (‘nodes’)
    The "VegetationSystem" objects are children to the terrains, and they travel with WS as @LennartJohansen suggested. But not the masks, it seems. Baking the vegetation may be a workaround but I'd prefer not to have to do that.
     
  47. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    When baking trees from multiple terrains with a single Persistent Vegetation Storage container, I see that VS seems to conflate trees from different terrains, creating phantom species instances like the hovering trees shown below at left in the white oval:



    Creating a different storage container for each terrain might work, but with dozens of terrains that's a fair amount of housekeeping required to keep them straight.

    I didn't see anything about this in the documentation or here in the forum, has this been addressed before and does anyone have any bright ideas?
     
  48. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Calling a WorldStreamer split while more than one VS ‘VegetationSystem’ is active (I have one for each terrain) can cause the Unity Editor to crash; stopping the VS ‘VegetationSystem’ instances before splitting seems to work.
     
  49. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
Thread Status:
Not open for further replies.