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

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Basically what Morten just answered you. MapMagic or any other system can spawn trees to the terrain and you can import them to Vegetation Studio. You get manual control to delete and edit like you see on this video.



    If you have rocks or other items as GameObjects in the scene these can also be imported to Vegetation Studio. Thee is a scene vegetation importer where you can make a profile and use this to match objects based on names, layers and tags.
    See here for more info.

    Lennart

     
  2. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Thank you Lennart,

    I will purchase your asset today :)
     
    LennartJohansen likes this.
  3. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    That just shows how much we've become fools in this modern age. :rolleyes:
     
    Alverik and hippocoder like this.
  4. jlocke

    jlocke

    Joined:
    Dec 16, 2017
    Posts:
    62
    Thanks a lot for your open answer. Yes, i can understand.
    You mentioned in last part of your reply "Terrafirma". Is that a new terrain asset ? We appreciate World Machine hat we use a lot with a small engine my team developed for Houdini, but if we had something fast in unity editor, we would prefer
     
  5. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352
    jlocke likes this.
  6. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. That is a new terrain asset, not for generation of terrain but a replacement for the unity terrain mesh. We still have a bit of work to do before we open op for a beta.

    Lennart
     
    Mark_01, jlocke and antoripa like this.
  7. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Development update.

    I submitted an update to Vegetation Studio to asset store today. It has mostly smaller fixes and changes for better compability with other assets.

    Changelog can be found here.

    There is also a new Billboard Atlas renderer for CTI (custom tree importer) trees. The CTI shaders have been updated to support Vegetation Studio. Asset packages using this tree shader like Tropical Forest Pack needs an update for this but that is on the way.

    For the next update I will focus on adding support for run-time density adjustments and Vegetation Masks for baked vegetation in the persistent storage. Also some better control when baking vegetation to the storage.

    Lennart
     
    Alverik, elbows, Baraff and 10 others like this.
  8. jlocke

    jlocke

    Joined:
    Dec 16, 2017
    Posts:
    62
    Thank you for your answer. I got it. I will discuss with my team next weak and eventually we will proceed with your asset. From the review it looks like a must,
     
  9. jlocke

    jlocke

    Joined:
    Dec 16, 2017
    Posts:
    62
  10. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    So got VS and dropped in some mesh trees and Speedtree trees. The billboards on both aren't rendering correctly for some reason. Backgrounds are all visible it's like there should be some alpha transparency there but there is none.

    This is on 2017.3 beta with Linear/deferred.

    upload_2017-12-19_0-29-26.png
     
  11. LennartJohansen

    LennartJohansen

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

    This is a bug that could happen on some GPUs, I sent you a PM with a patch now. The issue is resolved in the update submitted yesterday.

    Lennart
     
  12. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ya that fixed it thanks!
     
  13. belkovandrew

    belkovandrew

    Joined:
    Nov 19, 2014
    Posts:
    22
    It is really hard to understand what to do and how to set up a scene. I have MapMagic+CTS, in CTS I use 10 textures, VS gives 8-12-16 etc, ok, I choose 12. I have assigned it to MapMagic but nothing happens, no errors. Could you please make a solid step-to-step tutorial? Also the documentation is frustrating and does not explain anything at all, no idea how to set up a scene. I followed youtube tutorial but still no impact.

    1. I add VS component to my scene, then I moved VegetationSystem to MapMagics main terrain. And set up everything for VS and MM
    2. I create VS profile, set up 12 textures and add my grass meshes
    3. ??? Nothing happens?
     
    Last edited: Dec 19, 2017
  14. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. Sending you a private message with some questions. If we find some missing steps for the MapMagic setup I will post it here and update documentation.

    Lennart
     
  15. Gewald

    Gewald

    Joined:
    May 30, 2017
    Posts:
    13
    I have a question on vegetation mask areas. I created one mask area around a house with the vegetation mask area script. How do I create another mask? (Say, around a section of road?). Do I add a vegetation mask area script for each vegetation mask that I need to make?
     
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. Normally you would add it to the object that you want to mask. This is beacuse the mask will move, rotate and scale with the object. There is also a function to calculate the hull. Button on the inspector. This will help you set up the outline of the object.

    For roads you should try the VegetationMaskLine. just follow the road and set a width. You can also add additional range and noise to get grass growing more natural around paths, trees a couple of more meters away from the path etc.

    Lennart
     
    Mark_01 likes this.
  17. Gewald

    Gewald

    Joined:
    May 30, 2017
    Posts:
    13
    Thank You. Just used both methods, and they work great.
     
    LennartJohansen likes this.
  18. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Great, what you can do also is add pre configures masks to prefabs. This way the vegetation adapts when you add the prefabs to the terrain.

    Lennart
     
    Mark_01 likes this.
  19. obstudio

    obstudio

    Joined:
    Sep 30, 2016
    Posts:
    58
    hi. I'm trying to use VS with EasyRoads3D but trees and grass is still growing on road. Using vegetation mask is a pretty good option but it need to be make manually. EasyRoads3D can remove trees and grass from road but only as they are added to unity terrain in old way (not VS).
    Can you look at it ? I know I can import existing terrain with trees etc but I prefer to use VS rules to control vegetation.
    BR
    Marcin
     
  20. LennartJohansen

    LennartJohansen

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

    Vegetation Studio does not know when EasyRoads3D creates a new road. It should be an easy integration but has to be done on the EasyRoads3D asset. When a new road is created the spline can be sampled and the points added to a VegetationMaskLine. There is a simple API for this.

    Lennart
     
    twobob and blitzvb like this.
  21. obstudio

    obstudio

    Joined:
    Sep 30, 2016
    Posts:
    58
    thanks for reply
     
  22. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    The EasyRoads3D developer contacted me a while ago to look at integration. I will follow up on this.

    Lennart
     
    twobob likes this.
  23. Game-Armada

    Game-Armada

    Joined:
    Apr 29, 2013
    Posts:
    66
    Hi, can I render grass like this with the shader included?
    upload_2017-12-20_13-46-30.png
     
  24. obstudio

    obstudio

    Joined:
    Sep 30, 2016
    Posts:
    58
    nice to hear this. thanks
     
  25. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    Greetings.. sorry if this has been covered before but I didn't see it so far.

    I'm planning on using World Streamer, not because I want huge terrains but because I want to break areas like 4km sq into small areas for speed.

    I looked at your map magic integration and I am assuming (thats a horrible word) that if I set up the full terrain and texture it first with CTS and Vegitation Studio, and save that profile, then what I should do is each time a new terraign is loaded with World Streamer, I should add that profile to the new segment by program and everything should work as normal?

    or would it be better to take the basic terrain as created by CTS and then just add a Veg Studio component to each one... I'm not planning a huge number of splits in the terrain so a 4x4 km will probably be split into 500 meter square so will be 64 smaller terrains.

    Regards

    M
     
  26. LennartJohansen

    LennartJohansen

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

    You can do this a few ways.

    1. You manually set up the 64 terrains with a VegetationSystem object/component as a child of the terrain. This will then be loaded with the terrain when you load the scene with the terrain.

    2. We create a script that listens to the SceneManager.sceneLoaded event and in this event we search the loaded scene for Terrains, Instantiate a prefab we make with the VegetationSystem component as a child of the terrain and assign the terrain to it. If you plan to use the persistent storage we also need to find the correct storage for that terrain and assign it. This setup will make it easier to change VegetationStudio settings since you do not have the multiple copies in all the scenes.

    3. Depending on your visible range and terrain size we could set up some kind of pooling system for the VegetationSystems. It would work a bit like option 2 but when a terrain become visible we get a VegetationSystem object from the pool. At unload we return it.

    The upside of this is that with terrains of the same size we can use the HotswapTerrain function on the vegetationSystem component this will reuse the internal quadtree, cell structure etc making it faster to init.

    Lennart
     
  27. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. The built-in grass shader does not have any translucency, but I think you can get close. There is an inclided Grass Patch Generator tool that helps you build up grass patches from your Texture2D grass. Have a look here.

    There is also a few grass shaders from other assets that has uppdated to support the Instanced Indirect rendering Vegetation Studio is using. More on they way.

    Lennart
     
    Mark_01 likes this.
  28. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    hmmm okay thanks. I like the idea of a pool system. I'm going to be away for the next week or so, but that will give me plenty of time to think about this and if I may, I will get back to you for some ideas if I start getting lost :)

    Regards

    M
     
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Send me a PM when you are back. I plan to make the pool to include anyway. If you are up for it we can use your setup as a testcase?

    Lennart
     
    MaliceA4Thought likes this.
  30. MaliceA4Thought

    MaliceA4Thought

    Joined:
    Feb 25, 2011
    Posts:
    406
    will do.. It'll be around 5th Jan or thereabouts.

    M
     
    LennartJohansen likes this.
  31. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    55
    I have a question on importing a vegetation/tree item. I have to pull in the tree into the tree slot, and it populates the tree all over the terrain. I can then adjust the settings from there. But, what if I want the tree in the scene, but, I only want it to plant with masks in certain areas. How do i import the tree into the package, but, tell it not to spawn on the terrain?
     
  32. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. You are on the right track.

    When adding a new tree you do it like you did. Drag and drop on the tree prefab slot. By default it will spawn with some randomized rules, height, steepness, sample distance and you can change all this.

    If you want the trees to only show up on a mask you can do as follows.
    I do not know if you are talking about the VegetationMasks or a TextureMask. I will explain both approaches.

    1. VegetationMaskArea is a component you can add to any gameObject in the scene. It allows you to create a polygon area that can mask out but also include vegetation. Look here for more info

    Add a VegetationMaskArea to the scene as shown in the link and then configure the localized vegetation



    You select a vegetation Type from the list. It can be any number we just have to make sure it matches the vegetation you want there.

    Then on the VegeationItem settings (tree) you go to the vegetation mask setting. Select Use with vegetation mask and selecty the same number. Now this tree is set to only show up on areas that include this type.



    2. Using a texture mask.
    I will assume you have a created texture that matches the terrain 1:1
    Go to the Mask tab on the Vegetation System component and add a new texture mask. There is several options. Find the one that matches your texture. a RGBA texture mask will allow you to select a channel to sample.



    See here for more info.

    Then on the VegetationItem (tree) you go to the texture Mask rules.



    Select a include texture mask rule. Add the texture mask you added to the system and configure the value.
    This will make the tree spawn only on the area that matches your selection in the mask.
     
    Mark_01 likes this.
  33. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I'm very interested in this, since my use case is a 10x10 matrix of 1000x1000 m terrains. Also using MapMagic (but with MicroSplat) and looking at streaming alternatives. Will also be using persistent storage. A tight integration here I think would be very useful to many, especially if MicroSplat's need for a second material for each terrain in the Terrain Blending module were accommodated.
     
    boysenberry likes this.
  34. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will let you know here when we have something running. Just send me a message then to get an early copy.

    Lennart
     
    PeterB likes this.
  35. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! So how good is this? I have tried almost all vegetation system there is.. and none meet my requirements..

    I can spawn with gaia & gena and import to this asset ALOT of trees and grass? Does it have the power to render trees with alot of polygon? Without brutal lag.
    Does still have a good performance without using ugly billboards trees?
    Does it have touch bending when you walk past grass and it cones back up?

    Does it render stones in the same way as grass & trees? Meaning I can have alot? How about occlusion culling?

    Sell the asset to me.. I didnt get any wiser looking at videos I want the technical details.

    But I have the feeling I need this in my BIG open world.. BIG! :)
     
  36. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    So I'm thinking maybe there is an issue with shadow culling? It seems for what is in visual range the numbers are a bit off. The only difference between the below images is the trees cast shadows setting.

    This is 2017.3

    upload_2017-12-22_3-14-1.png

    upload_2017-12-22_3-14-47.png


    upload_2017-12-22_3-15-29.png

    upload_2017-12-22_3-16-8.png
     
  37. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Thanks. I will have a look. I will send you a PM for some additional info.

    Lennart
     
  38. LennartJohansen

    LennartJohansen

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

    1. Vegetation Studio has an import system that can import trees from the Unity terrain. This way you can spawn trees with Gaia and another tool and import. For a good result on grass you need to set up the spawning rules in Vegetation Studio. Adam is working on native Vegetation Studio support for Gaia. When this is done you can spawn trees and grass direct from Gaia to the persistent storage in Vegetation Studio, using the API.

    2. Vegetation Studio is designed to use the Instanced and Instanced Indirect rendering APIs of Unity. The internal structure is designed for a lower CPU use and with instancing there is less drawcalls. While this optimizes the rendering you still need a modern graphics card capable of handling all the polygons and pixels. What you gain is less waiting time on the GPU and state changes.

    3. The distance you can set before billboard distance on trees all depends on your target hardware and density. All polygons in the tree meshes still needs to be rendered.

    4. When using the included grass shader there is a Touch React system that will bend grass against colliders. Have a look here for more info.

    5. You can render stones the same way as grass and trees. It requires a shader that supports instancing. Ideally you want a shader that supports instanced indirect. That will allow for GPU frustum culling and more instances.
    I added a guide for shader upgrades here.

    6. Vegetation Studio has an internal cell structure and does culling in 3 steps. First step is a selection of potential visible cells based on the camera position and the visible vegetation range (excluding billboards)

    These cells are then culled using the culling group API to get the current visible cells.

    For instanced indirect the individual instances are then culled on the GPU against the frustum before creating the final render lists with LODs. This is to get out the invisible instances on partial visible cells.

    I hope this helps a bit.

    Just send me a pm if you have more questions

    Lennart
     
    Mark_01 likes this.
  39. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Would anyone know if ForestVision trees work with VS?
    They have some very nice looking tree creation, but would like to know if they can be used before I picked them up.

    I just picked up VS, and I am looking forward to exploring its possibilities.
     
  40. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I'm on a Mac and Unity 2017.3 and am wondering whether someone else on the same platform also has found that

    1) Grass rendered Instanced indirect doesn't work even with the included Vegetation Studio grass shader. OpenGL or Metal doesn't matter: all grass has to be switched to Indirect, even in the demo scene. This of course includes the prefabs produced by the Grass Patch Generator.

    2) I get no billboard shadows, even though they are enabled in the Billboard System.

    3) There's no wind bending on non-SpeedTree trees.

    I'm on High Sierra, latest update.
    MacBook Pro 2,9 GHz,
    dual GPUs: Intel HD Graphics 630 + Radeon Pro 560
    VS 1.0.1.0
     
  41. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi, I will get a copy and do a test.

    Lennart
     
  42. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394

    Hi.

    1. OpenGL on mac does not support shader model 5.0 and you need to switch the rendering to Instanced. On Metal it should work good.

    2. What is your shadow distance in Unity? Billboard shadows is part of the normal shadow system and does not get shadows after the normal max shadow range.

    3. What tree shader do you use? Some trees like Advanced Foliage Shader and others need to have a component added to inject the wind to the shaders.

    I will send you a pm about the Metal problem and instanced indirect.

    Lennart
     
  43. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    839
    Thanks!
    Looking forward to the result!

    David
     
  44. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Its simple ... if you have a BIG outdoor world, there is just no alternative to VS. Period.
    Without it, you're going to have a BIG EMPTY outdoor world.
    It's that easy to sell it to you.

    Thats not to say its going to free up so many resources that you can do everything else you dream of doing. But its going to free up many times more than any other solution you can string together, so its really a no-brainer.

    As the game designer, you're responsible to make it all work, sometimes that takes wizardry. The bigger and more complex the game levels, the more wizardry. VS delivers you that wizardry - for outdoor / vegetation. And you'll probably want Lennart to make something for all your other assets too!

    Had you said you're building a small game level that's mostly indoor etc ... well then, you can question whether you need VS. In an outdoor world level, its non-optional.
     
    mattis89 likes this.
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    that sounds a little bit biased as there are several alternatives.
     
  46. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Hi Lars, well - all opinions are biased, even yours! :)

    There's the short answer and the long.
    The short is : get it, its best.
    The long is try X, Y, and Z, pull hair out, swap Y for W and integrate and change workflow, chase alternatives, pull more hair out. Then get it ... once you have learned its best. It's now cost 3 times as much and taken 6 months.

    A handful of (other) assets is only partially going to help with large outdoor environments (unless we are talking a desert!). And none are going to deliver the results VS just brings right off the bat. Some will come close in some areas, but not all. Additionally they're going to crowd and confuse the workflow, where VS just works, and works well. To get maximum vegetation density in large outdoor environments and still have decent performance for (other) things, VS is the answer.

    As much as competitors would like it to be otherwise, there's no decent alternative : that's my opinion and experience (via some long experiences).

    As for OP requesting tech videos ... I always liked this (old) one. It says a lot ...

     
    PeterB and blitzvb like this.
  47. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    I have triee them all.. VS delivers everything I need :)
     
    Rowlan and mwituni like this.
  48. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I'm answering Lennart's questions here too, in case someone else has the same problem. (Everything else works perfectly.)

    This page: https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html would suggest that Metal on Mac doesn't support Shader Model 4.6 or 5.0, only 4.5.

    It's the default range.

    I'm using the default nature/bark/leaf shader at this stage, so nothing special.
     
  49. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    I didn't test on mac, so what kind of feature are we missing?
     
  50. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I'm still hoping this is due to some kind of misconfiguration on my part, but even if it isn't, the massive speed gain yielded by instanced rendering is still a game changer. Even if VS can't render indirect instanced grass on Metal right now (and remember, Apple's Metal implementation is a little ... special) VS still makes things possible which simply weren't possible before without huge effort. The rest of the synergies that VS bring are still there. Apple switched to Metal2 in High Sierra and there are updates still to come in that area.
     
    Last edited: Dec 25, 2017
Thread Status:
Not open for further replies.