Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[RELEASED] Vegetation Studio

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

  1. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    56
    Hi.

    >Vegetation that has been baked or manually painted can be deleted. Run-time spawned procedural vegetation has to be controlled by rules or vegetation masks.

    Now, I understand.
    Thank you!
     
  2. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    44
    Hi!

    I recently bought Vegetation Studio and have been testing it a little bit. So far I gotta say I really enjoy it, very nifty!
    In my particular setup though, it turns out that my water plane is at a negative value for various reasons. Vegetation Studio only allows (quite logically...) for the water plane to be at 0 at the lowest.

    I guess it's a long shot but there wouldn't be a way to change that somehow?

    Thanks!
     
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. You can set the sea/water level on the settings tab of the Vegetation System. All rules are relative to this height.

    https://www.awesometech.no/index.ph...vegetation-system/vegetation-system-settings/

    Lennart
     
  4. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    44
    Hah! I missed that it was all relative. I assumed it was an absolute value, doh!
    Thanks :)
     
  5. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    It was made relative to make it easy to change sea level. This way you can adjust this. Splatmap rules and vegetation will then automatic follow the new sea level.

    Lennart
     
    combatsheep likes this.
  6. sunseeker1988

    sunseeker1988

    Joined:
    Jul 10, 2014
    Posts:
    386
    How do I change the Vegetation Storage Package during runtime via c#. I want to build multiple vegetationStoragePackages and swap them based on conditions I have set.
     
  7. NoobDoAAA

    NoobDoAAA

    Joined:
    May 7, 2018
    Posts:
    11
    How big is the performance difference between Vegetation Studio and Vegetation Studio Pro in Unity 2018.3?
    Do you have some test results?
    Many thanks.
     
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    The data sent to the GPU from Vegetation Studio and Vegetation Studio Pro has not changed much. The work on the GPU is almost the same.

    One GPU change is that increased spawning speed with the job system that allows for bigger internal cells and that gives you a bit faster merging of cells on the GPU.

    The big change in performance is on the CPU. Faster spawning when new cells become visible. Less main thread work on creating render lists, frustum culling, LOD selection etc since these tasks now uses jobs/burst on all cores. If you have a project that is CPU bound you would get better FPS or give you more time to do other game code.

    In addition to this there is a new biome system, support for mesh terrains, multiple terrains and cameras per vegetation system and more. There is a "whats new page" on the website.

    Lennart
     
    P_Jong and NoobDoAAA like this.
  9. LennartJohansen

    LennartJohansen

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

    You can add multiple vegetation packages to the VegetationSystem component in the editor.
    Here on the settings tab.

    Then you can change between them run-time with this static function on the VegetationStudioManager API.

    Code (csharp):
    1.  
    2.  
    3. public static void SetVegetationPackage(int index, bool resetCullingGroup)
    4.  
    5.  
    Lennart

    Image 864.png
     
    sunseeker1988 and P_Jong like this.
  10. tgentry

    tgentry

    Joined:
    Feb 11, 2013
    Posts:
    27
    Trying to use this for the first time in a new project. And I get errors "Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/Utility/JobCullingGroup/JobCullingGroup.cs(36,37): error CS0246: The type or namespace name `IJobParallelForFilter' could not be found. Are you missing an assembly reference?" "Assets/AwesomeTechnologies/VegetationStudioPro/Runtime/BillboardSystem/BillboardGenerator.cs(60,20): error CS0246: The type or namespace name `NativeList' could not be found. Are you missing an assembly reference?" etc

    I have the Burst, Collections, Jobs Mathematics and PP all loaded from Package manager.

    What else am I missing?

    Thanks
     
  11. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    NativeList is in collections and IJobParallelForFilter in Jobs. Do you have .net 4x and API compability to 4.x?
    Unity 2018.2.11 +

    Just send me a direct message to debug if you want.

    Lennart
     
  12. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    44
    Hi,

    Sorry if this sounds a bit like a stupid question but I've been checking the documentation and can't really find anything about shadows. It is impossible to get direct shadows from a (directional for example) light on vegetation and/or objects? Or am I missing something?

    The only thing I can find is the potential use of a shadowmap for trees and large objects (but I guess that also depends on the terrain shaders. For info, I'm currently using RTP together with vegetation studio)

    Thanks!
     
  13. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Shadows are controlled by Unity. The shadow distance, cascades and on each light. In addition to this there is setting on the Render tab that can turn on and off the shadows of each category (grass, plants, trees, objects and large objects) for editor and playmode.

    Lennart
     
  14. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    181
    Goodnight

    I ignore the reason, since I have done it dozens of times, but the TOUCH REACT does not work. Suddenly.
    I have done many tests, changes, reinstallations ... and nothing. There is no way.

    I attach an image

    Thank you.

    NOTOUCH.jpg


    I tried with another car

    NOTOUCH2.jpg
     
    Last edited: Nov 23, 2018
  15. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
    Could you change the render distance for grass a bit and put a fadeout in there?
    Like "grass distance 100 meters to 120 meters", whereas 100 meters is 100% grass and 120 meters is 0% grass?

    I guess the ratio of work vs. outcome wouldn't be too bad.
     
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. What shader does the plants use?
    If you join the Discord server and message me I can help you to debug. Much easier with a text chat.

    Lennart
     
  17. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Rendering instanced indirect it would be possible to "scale" out the vegetation over a set distance. For instanced rendering it would take a bit to much work to change this every frame. Hard on CPU

    I will look at it.

    In Vegetatation Studio Pro using the Job system I added a Distance Falloff rule to reduce distance density based on the current camera view.

    Lennart
     
    FargleBargle likes this.
  18. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    804
    I was talking about pro, sorry.

    I'll try the distance falloff, I didn't think about looking in the prefab settings, thank you.
     
  19. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    179
    So.... does that mean, if one camera renders a tree, the other camera in the same area wont see the first cameras tree, but a different tree. But in the EXACT same spot? Or would the vegitation layout differ slightly?
     
  20. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Let me try to explain. If you have multiple cameras with different viewpoint in the terrain you want them each to have a selection of vegetation and LODs etc based on their own viewpoint.

    They would all render the same vegetation, trees is in the same location but on one camera it might be a billboard and on another a LOD0 mesh tree because that camera is closer.

    Lennart
     
  21. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    179
    Ah, sweet.
     
  22. sunseeker1988

    sunseeker1988

    Joined:
    Jul 10, 2014
    Posts:
    386
    Hi,

    Is there a way to select vegetation to not be affected by wind. Even better, would it be too ahrd to include a weight system so that vegetation with "stronger" stems do not blow as wildly as grass in the wind? This would gie a more natural look. Some of the plants are blowing in the wind like a sheet of tissue paper.
     
  23. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    179
    Is there anyway to attach scripts to trees and such? I tried sticking one on a prefab but dont think it worked
     
  24. VirtusH

    VirtusH

    Joined:
    Aug 18, 2015
    Posts:
    14
    Hi, I'm having a lot of issues with the billboard system.
    The generated textures are all over the place, they chop off sometimes up to half of trees. Other times trunks don't render.
    Here's a gif of just one of the problematic billboards. This tree uses one mesh and one material.

    https://gyazo.com/3cbebb334524202720d45b3c96cc55e0
     
  25. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    44
    Hey, thanks for the answer.
    Maybe it's more a general Unity question than Vegetation Studio specific, but no matter what I try I can't get either the grass nor the detail objects to cast shadows.
    Is it really doable? I mean I've cranked up every quality/light/terrain setting I can think of to the max to no avail.

    Am I missing something here?
    (for info I'm in linear/deferred, ultra quality, etc...)
     
  26. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. The wind is controlled by the shader and would have to be disabled there or on the source that sets the wind speed.
    What shaders are you using?

    Hi. The vegetation does not exist as GameObjects when rendered instanced. This is one of the big time saving changes. There is however a couple of systems you can use.

    If you assign a collider to the tree/rock the collider system will create run-time colliders. There is an event when colliders are added and removed. You can add your scripts here.

    Have a look here for more info.

    You can also use the run-time prefab spawner to add particle effects, falling leaves etc.

    https://www.awesometech.no/index.php/runtime-prefab-spawner/

    Did you turn on grass and plant shadows on the Render Tab? If you join the discord server and message me I can help you debug. Link is in my signature.

    Lennart
     
    tcourbet likes this.
  27. mozi_ru

    mozi_ru

    Joined:
    Nov 2, 2012
    Posts:
    9
    Hey, can you please rebuild the heightmapUtil.dll with static CRT in order to remove the dependency?
     
  28. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    44
    Oh wow, this is embarrassing... completely missed the shadows box in the render settings.....
    Hum, sorry! And thanks for the answer :)
     
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. Not tried that before but I will give it a try. I guess I can static link the MFC requirements in the dll.
    Sending you a pm.

    Lennart
     
  30. mozi_ru

    mozi_ru

    Joined:
    Nov 2, 2012
    Posts:
    9
    Thank you!
     
  31. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    I have a static linked version if someone else needs it. I will do some more testing before I add it to a release version.

    Lennart
     
  32. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    179
    Ok, so using playmaker, cause i cant script worth S*** haha, but i figured out how to attach scripts to trees as they spawn ect. And harvest them. Is there any easy way to make a single rendered tree disapear?
     
  33. sunseeker1988

    sunseeker1988

    Joined:
    Jul 10, 2014
    Posts:
    386
    Im adding 2d grass and plants inside vegetation studio under the add vegetation items section.
     
  34. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. If you make custom grass patches with the Grass Patch Generator you can adjust how much and if they should bend at all. Have a look here. Speed is the same with these as when adding 2D grass direct.

    Lennart
     
  35. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    181
  36. TSI25

    TSI25

    Joined:
    Sep 22, 2013
    Posts:
    9

    We are also running into this issue where the .dll can't be found. How should we go about switching to a c# version of the code, is that located somewhere in the project? We located a script next to the HeightmapUtil.dll files called HeightmapUtilDLL.cs, but when we include the VS_USE_HEIGHTMAP_DLL symbol and disable the original .dlls we get the same error. We also tried deleting the .dll files but it seems pretty clear that the HeightmapUtilDLL class is reliant on the .dlls because it will error out at runtime without them.

    Is there somewhere else that we should look for that c# version of the code?
     
  37. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. If you add the VS_NO_HEIGHTMAP_DLL compiler define it uses a c# version of the code. The c++ dll is a bit faster but requires Visual Studio c++ Runtime installed. This week I made a static compiled version that does not need the run-time installed anymore. I want to test it a bit more before replacing the one in the asset.

    Here is a link to the new dll. Just replace it.

    Lennart
     
  38. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
  39. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    83
    When using vegetation studio, it puts items over each other (trees inside trees or inside rocks - all generated by vegetation studio). So I couldn't find any setting to limit distance between generated vegetation. Is there a solution for that?
     
  40. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    281
    Should be an easy fix:

    Under the "position" section,
    activate "Collision Detection" (that makes sure they aren't placed where another tree is)
    and set your distance apart from each other with "Sample Distance" (you can set how far each tree is from each other so branches do collide as well)
     
    Amitloaf and llJIMBOBll like this.
  41. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    168
    One of my clients said that he couldn't see the tree on his computer. Is this because his GPU is too old? Does the rendering of Vegetation Studio have requirements for computer configuration?
     
  42. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Hi. In addition to what @dsilverthorn responded there is also a Obstacle Mask Creator component. This can build an obstacle mask you can add as a texture mask and use to exclude areas. You can find the documentation here. In addition to objects in the scene you can also bake out rocks temporary with the SceneVegetationBaker component and include those in the mask.

    Lennart
     
    dsilverthorn likes this.
  43. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,270
    Vegetation Studio requires computer with graphics cards that support Shader Model 5.0 This is needed to use compute shaders and instanced indirect rendering.

    Lennart
     
  44. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,301
  45. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    83
    Didn't work for me. It seems it doesn't affect this. Attached screenshot of two trees touching even though sample distance is 10 meters. They are both the same model also.
     

    Attached Files:

  46. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    281
    Are they 2 different tree types?
    If so make sure everything is checked on all trees.

    That does look like a problem if they are the same.

    There are a lot of tweaks that can be done.

    Question
    Have you baked veg yet. If so make sure you clear it before making changes. Otherwise it will show the baked also. I’ve done that one before.

    Maybe someone else has another thing to try. I’ll keep thinking on it, but I’m not at the computer right now to check.
     
  47. StevanJay

    StevanJay

    Joined:
    Feb 5, 2014
    Posts:
    73
    Hello! So I`m a little confused about the setup for SpeedTree trees in VSPro... I downloaded the shaders from GitHub, but then noticed that there are also shaders already in the VSPro package - are these the same, which should I be using? I replace the shaders on my trees, and set them to instanced indirect. Then the setup guide says to select the Render tab to enable compute shaders and GPU culling, but I can`t seem to find those options... Is this handled automatically in VSPro now, or I`m just being blind...?

    In any case, I`m getting a huge GPU hit when I add SpeedTree trees into the scene, and it doesn`t seem to make any difference which shaders I use, so I`m pretty sure there`s something I`m not doing right!

    Thanks... :)
     
  48. StevanJay

    StevanJay

    Joined:
    Feb 5, 2014
    Posts:
    73
    Yeah, that was one of the things confusing me a little - the SpeedTree guide only talks about grass, but then it does state elsewhere that Trees can be instanced indirect also.....

    One other thing I did just notice, regarding my poor GPU performance with the SpeedTrees, is that ticking "Graphics Jobs (Experimental)" in PlayerSetting gives a huge improvement - kinda assuming that plays in with VSPro, should that box be ticked...??
     
  49. Slaghton

    Slaghton

    Joined:
    Sep 9, 2013
    Posts:
    129
    Woops, didn't delete my comment fast enough ha. Figured I might of been wrong. I'll test that out myself since you might be on to something and do more digging.

    Edit Update:
    Are you using the correct shader version? Theres a 5.6, a 2017, and a 2018 version. I was using 5.6 in 2017. Testing now

    Edit2:Tested correct shader version, same fps, hm.
     
    Last edited: Dec 6, 2018
  50. StevanJay

    StevanJay

    Joined:
    Feb 5, 2014
    Posts:
    73
    Aha! Just discovered that there's a dedicated VSPro forum, which is probably where I should have started this discussion!

    Anyway, looking there I discovered that in VSPro the SpeedTree shaders are replaced automatically, ne need to use the GitHub versions... Which explains why I saw no difference when I manually replaced them... ;)

    So I updated my graphics drivers, ticked the graphics jobs setting, fixed a couple of SpeedTrees that had some issues, and optimised my LOD and draw distances some - with all that, getting some pretty decent performance now... :)