Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Vegetation Studio

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

  1. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. Yes. The speedtree shaders are replaced run-time in Vegetation Studio Pro. This is done with new shader controller system. That also exposes custom UI to the interfaces and saves custom settings.

    Lennart
     
  2. Slaghton

    Slaghton

    Joined:
    Sep 9, 2013
    Posts:
    136
    Glad it worked out for you! In regular veg studio, instancing makes my trees drop the scene fps and indirect even more xD. Indirect instancing does work on grass and large objects though.

    If I manually change the speedtree shader to github indirect one on tree, the trees spawn normally but with worse performance in indirect mode. If i leave speedtree shader on trees by default and choose indirect, it spawns all trees in one location in front of me, tanking fps. Probably doing something wrong. Think i spent like 15-20hours so far tinkering with settings, doing builds, and testing fps :u.
     
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. The default speedtree shader does not support instanced indirect. That is why I made the version on github.
    Normally indirect should be faster but I can help you debug.

    Hi. If you could join the discord server and message me there I can help you to look at it. Easier with a text chat.
    Discord link is in my signature.

    Lennart
     
  4. Slaghton

    Slaghton

    Joined:
    Sep 9, 2013
    Posts:
    136
    Played with shaders + did more benchmarks and I think I got how everything works now.

    I think there may have been some weird bug happening when switching shaders around though. Like, I think if I made a new material and then swapped it to instance indirect github shader it would kinda be buggy, but if i created a new material, then changed it to use veg studio grass shader, then swapped it to use indirect grass github shader it would work normally. Honestly, im not quite sure anymore at this point xD.

    Annyways, I believe I got everything figured out and everything is working on my end. Thanks for reaching out!
     
  5. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    248
    i bought the asset and I crash every 5 minutes. It's very annoying. it look amazing, but I can't just work with it. I'm using unity 2017.3.1f1 on a GTX 1060

    there are maybe 10 tree species, the density is nothing crazy view distance is 100m. When i turn on rendering, it just close unity without any warning after just a few second.

    Anyone have an idea of what I can do ?
    it's such a pain that you can't control default density or reduce it before activating trees as it would maybe allow me to have less item on screen... but even in close up view it crash.

    pretty annoying and render the asset a bit useless at this point.
     
  6. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. Can you message me on the discord server? I can try to help. Easier with a text chat.

    Link is in my signature.

    Lennart
     
  7. DrewMelton

    DrewMelton

    Joined:
    Sep 24, 2015
    Posts:
    89
    Well, I sent an email a few days ago, but I guess it doesn't work. I'll just post my questions here instead.

    This thread is way too big to read, so hopefully these questions are too redundant.

    1. How do I get the vegetation studio to show in the editor while the game is playing? It does this in the demo, but I can't find the setting to keep it on in my scene once I hit play.

    2. How do I set it to not show vegetation outside of the camera? In the demo, it looks like the camera's line of sight affects where the vegetation is seen, but my game shows everything. I know because the tri count went up in the millions, but it goes down if I put a giant mask in the scene. I have more than one camera since this is a top-down RTS game, but I thought I set up the cameras correctly. Maybe there is something obvious I'm missing.

    Thanks.
     
  8. Amitloaf

    Amitloaf

    Joined:
    Jan 30, 2012
    Posts:
    93
    It's the same tree and we never baked yet. It's all runtime. If you need help finding this bug in any way, I'm willing to help.
    Edit: All the trees are placed with beacons and all of them have masks
     
    Last edited: Dec 8, 2018
  9. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    248
    Link to the github shader ? im using some speedtree, maybe it's why i experience the crash all the time !?
     
  10. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    88
    So far love the system. I do have a Quick Question.

    Under Localized Vegetation Placement, how do you edit the Selected Item names (it just says "1. Item"), and the names for Vegetation Type (It just says "Vegetation Type 4") ? I can't seem to find it in the documentation or on these forums.I'd like to at least rename Vegetation Type # to something like "Forest" or "grassland", so i don't forget what Biodome i'm using to setup.
     
  11. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,493
    I was watching the video where the car is driving through the grass and leaving a displacement of where the car has been.
    How do I set that up exactly. Trying to get it to do that with my character walking through the grass.
     
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. Do you mind joining the discord server and message me there. Easier to debug with a text chat.

    Here is the link. Make sure you use the correct branch depending on your unity version.

    Hi. You select the same VegetationTypeID on the masks and on one or more VegetationItems. It id done this way and not a direct connection to a vegetation item to get masks to work with multiple vegetation packages. A summer and a winter package could each have some items showing up in the same mask. If you want to rename it, it is an enum in the VegetationPackage.cs file. Make sure you keep the int number for the enums.

    The tire track effect was done by adding trail renderers to the car wheels. The renderer must use the included touch reach material in Vegetation Studio. Then set to the same layer as assigned on the TouchReact component. You then exclude this layer from your main camera. This way the trails from the car will be rendered in the touch react mask.

    Lennart
     
  13. SickaGamer

    SickaGamer

    Joined:
    Jan 15, 2018
    Posts:
    1,013
    Are there any tutorial videos on setting up biomes and then implementing them?
     
  14. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    248
    what do you mean ? the link talk about unity 5.6 ? im on 2017.3.1f1
     
  15. Hen7

    Hen7

    Joined:
    Aug 6, 2018
    Posts:
    6
    upload_2018-12-11_9-32-36.png

    What am I missing?
    (2018.3.0b12)
     
  16. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,493
    Hmm doesn't seem to be working for me.

    • I added a trail render to each foot bone of my character
    • Set the layer of both foot bones to TransparentFX which is layer 1
    • On the Materials Array for each Trail Renderer i gave element 0 the material TouchReact. Which is in vegetation studio package.
    • Then on the TouchReactSystem component I set the Touch React layer to 1
    • On my Main camera I have layer 1 unselected on Culling Mask

    The grass doesn't lay down when my character is moving through the grass. Affected area is set to 50 meters.

    Here are my Trail Renderer settings. Which are default. Maybe this is the issue.
    Probably is. I honestly not even sure whats going on here. I've never even used this component before.

     
    Last edited: Dec 12, 2018
  17. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    There is multiple branches in the github repository. Select the correct for your Unity version.

    Lennart
     
  18. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    The trail renderer has to be adjusted to be at the height of where the wheels touch the ground and a width that matches. You should see the trail in the sceneview following when the car/character walks.

    Lennart
     
  19. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    What are you trying to do?

    Lennart
     
  20. Hen7

    Hen7

    Joined:
    Aug 6, 2018
    Posts:
    6
    The grass in the image spawn over the rock texture, although it is marked as excluded?
     
  21. Chesney

    Chesney

    Joined:
    Jan 31, 2016
    Posts:
    9
    Hello, I have recently purchased vegetation studio and for the life of me cannot get the wind to work. I added in the advanced foliage pack and used the CTS profile for terrain and forest pack profile for vegetation studio. No wind. it has found my wind zone and I have tried changing the wind zones and properties. The shaders used have wind properties. Any advice would be appreciated.
     
  22. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. I think the Advanced Foliage Pack has a separate script for wind you need to add. It should be there as a prefab. Wind is controlled direct by shaders.

    Do you mind joining the discord server and message me there. easier to debug with a text chat.
    Link in my signature.

    Lennart
     
  23. Chesney

    Chesney

    Joined:
    Jan 31, 2016
    Posts:
    9
    I cannot believe it was there all along, thank you so much. Vegetation studio is legendary, I absolutely love it!
    Many thanks,

    Steven.
     
  24. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,493
    Im really confused about wind. Why is there wind settings on vegetation studio if its controller by shaders?
    I have a issue right now where I can't slow the wind up lol.

    So pretty much I should just make my own wind control script?
     
  25. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    The vegetation studio wind setting controls the wind on the vegetation studio grass shader.
    But since every shader are implemented different it can not controll other 3rd party shaders.

    In VS Pro I implemented a shader controller system that allows for 3rd party wind components. The wind settings for FAE and NatureManufacture are now exposed there automatic and follow the main wind speed.

    Other will probably be added later. it depends on the shader developer. This is added using reflection to allow the wind controllers to ship with other assets.

    Lennart
     
  26. DrewMelton

    DrewMelton

    Joined:
    Sep 24, 2015
    Posts:
    89
    Why did I never get an answer to my questions? My email was ignored, and my forum post was ignored. I've probably been waiting over two weeks for answers to what I thought were a couple simple questions. Scroll up like a dozen posts for my questions.
     
  27. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    86
    Where can I find documentation for the mesh terrain function?
     
  28. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. Sorry for missing your questions. I try to answer everything but somethimes it could happen. I did an email search but could not find any email

    1. When in editor mode all vegetation selection is done by the active sceneview camera. You will only see vegetation in the gameview if they see the same area. When in gamemode this switches. The assigned gameview camera is used for all selection and rendering. You will only see the frustum culled vegetation in the sceneview if they see the same area.
    There is a "render direct to camera" setting on the render tab that will tell unity to only make the vegetation visible to the assigned camera.

    2. If you have multiple cameras you need to have one vegetation system per camera. (they can share a vegetation pakage) then set the render direct to camera on the render tab of each vegetation system. This way they only see the vegetation of the same camera. In Vegetation Studio Pro this is changed a bit. There you can assign multiple cameras (with the same render direct setting) to a single vegetation system.

    Lennart
     
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. Here is the MeshTerrain info. This is a Vegetation Studio Pro component.

    Lennart
     
  30. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    86
    Thanks. When will this be added to the non pro version? I've been waiting for this forever
     
  31. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    I did a prototype but came out with some issues. It is a bit to slow to sample without the job/burst speed increase. It also was more complicated to add the interface without breaking any serialization and current projects. The Unity terrain has to be sampled using the same interface. I will not do any changes that break users project when upgrading.

    I have not given up on the idea but I need to replan a bit on how It could be integrated.

    Lennart
     
  32. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    86
    Ok. Could it maybe be done as a separate "add-on"? So only users that need that function can install it.
    They use this in Microsplat where users can download add-ons to the main script.

    (You can even charge extra for that add-on)
     
  33. DrewMelton

    DrewMelton

    Joined:
    Sep 24, 2015
    Posts:
    89
    Thanks. I'll check it out.
     
  34. Ivoryjw

    Ivoryjw

    Joined:
    May 20, 2018
    Posts:
    31
    Hello there. I'm really enjoy Vegetation Studio right now and currently my favorite tool out of all the assets I use.
    But I have a question.
    I'm making a options menu for my game and I want one of the options to be setting Vegetation Distance, grass casting shadow, and other settings through the vegetation system.
    I'm currently having trouble setting it up so I wonder if you can give me a hand in having these options. Or is it even possible to do it?
     
  35. LennartJohansen

    LennartJohansen

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

    there is static function on the VegetationStudioManager to set distances

    Code (csharp):
    1.  
    2. public static void SetVegetationDistance(float distance)
    3. public static void SetTreeDistance(float distance)
    4. public static void SetBillboardDistance(float distance)
    5.  
    this will set the distances for all the vegetation systems in the scene.
    The VegetationSystem component also has these functions if you want to control only 1 vegetation system.

    to set shadows you need to get a reference to the VegetationSystem component. This has a public VegetationSettings object that has shadow settings.

    Code (csharp):
    1.  
    2.  
    3. public bool GrassShadows = false;
    4. public bool PlantShadows = false;
    5. public bool TreeShadows = true;
    6. public bool ObjectShadows = false;
    7. public bool LargeObjectShadows = true;
    8.  
    9. public bool EditorGrassShadows = false;
    10. public bool EditorPlantShadows = false;
    11. public bool EditorTreeShadows = false;
    12. public bool EditorObjectShadows = false;
    13. public bool EditorLargeObjectShadows = false;
    14.  
    15.  
    setting these will take effect the next render pass.

    Lennart
     
  36. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Christmas

    I will try to drop by to answer messages during Christmas/New year but my response might be a bit slower than normal. Trying to take a few days off.

    Have a good holiday.

    Lennart
     
    sarum, tcourbet, Rowlan and 2 others like this.
  37. Ivoryjw

    Ivoryjw

    Joined:
    May 20, 2018
    Posts:
    31
    Okay I see. Thanks LennartJohansen and again, great work on this asset.
     
  38. Unplug

    Unplug

    Joined:
    Aug 23, 2014
    Posts:
    248
    Got it thanks
     
  39. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    537
    Merry Christmas everyone!
    View attachment 349942
    I had fun putting this card together and thought I would share it with everyone. :)

    Snow and haze by Weather Maker
    Landscape by Landscape Builder and World Creator 1
    Clouds by Fog Volume 3
    Trees by Forest Vision
    Placement by Vegetation Studio
     
    Last edited: Dec 25, 2018
    sarum likes this.
  40. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    46
    Hi! I'm aware it's christmas and I might not get an answer for a while but heh!

    I'm not sure if I'm missing something but I think I might have a small bug with the wind.
    I have multiple terrains set up and I use a Vegetation System (and package) per terrain. I only have one WindZone for the level.

    pic that shows the setup:


    At the moment, it seems that only the first system controls the wind. If I set that system's wind parameters to 0, none of the other terrains' vegetation will have any wind.
    And in similar fashion, if I change any of the other systems' wind parameters, nothing happens with that terrain's vegetation .

    It feels like a bug, but maybe I misunderstood something somehow!
     
  41. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. What happens here is that most shaders get wind from a global shader variable that is set. That saves the render loop from updating the wind on all materials/material property blocks. Updating this takes time and needs a manager system that know of all wind instances.

    With multiple systems adjusting wind only the last one that runs will affect the wind.

    Lennart
     
  42. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    542
    Hi there,

    I'm seting up a scene and i've some questions regarding the instantiated objects. Is it possible to use custom scripts added to trees or trunks or rocks? I can't see how it could be done. The objective is to set a material to interact with each different object (Bullet impacts). Trees would be wood, rocks rock, and so on. Since the colliders are created by the system, i'm a bit stucked on this. Any help?
     
  43. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    Hi. The trees and rocks are not GameObjects and can not have scripts direct. They are all instances in a data structure that is culled and rendered with the instancing API. There is however a solution that might work for you.

    Have a look here

    When a collider is added to a vegetationItem the collider system will create colliders when close to the camera. The collider system has create and destroy events you can connect to. Here you get access to the GameObject/Collider for the tree and you can add your scripts. Have a look at the link

    Lennart
     
    Danirey likes this.
  44. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    542
    Thanks Lennart, i will.
     
  45. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    542
    Perfect. Implemented and working. Any performance cost with this approach?

    Thanks a lot!
     
  46. mmonje

    mmonje

    Joined:
    Apr 26, 2015
    Posts:
    4
    Hello

    I do not speak English, this I have translated, I hope it is understood.

    I'm trying to use Vegetation Studio, in a game I did. It looks pretty good, but I've encountered some problems.

    The scenes take a long time to load, although they are very small.

    3:35 It takes too long to make visible the scenes that use Vegetation Studio and vice versa also when they become invisible. Use SetActive (false) and SetActive (true) to make the different scenes invisible and visible.

    7:00 The grass disappears, I have also observed it in some rocks.

    7:34 The grass crosses the rock when the character passes underneath.

     
  47. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    You need to add the components but that only happens when a tree comes in range. Not every frame.

    Lennart
     
    Danirey likes this.
  48. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,384
    1. How big is your scene? How many vegetation items? Using larger vegetation cells and vegetation baked to the persistent storage will help init speed.

    2. The issue here is culling. You have vegetation painted on the mesh rock and it is high above the ground. The culling system does not know of this rock mesh. We can increase the culling range. Easy fix.
    Could you join the discord server and message me? I can show you where to change.

    3. This is the touch reach syste, What it does is move the vertexes of the grass under the touch bend colliders. There is no easy fix for this. You will have to disable the touch react collider component in locations like this. Maybe make a small trigger collider that does this for you when going under the bridge.

    Lennart
     
  49. mmonje

    mmonje

    Joined:
    Apr 26, 2015
    Posts:
    4
    Thank you

    I find it hard to interpret the translations in English, so I do not get involved in English speaking forums. The translations are very bad and difficult to interpret, besides I am dyslexic. I have a hard time reading.

    The scene is small, one kilometer long and one wide, 1024x1024. Among trees, grass and stones has 12 objects, rocks and grass uses "Instanced Indirect".

    The vegetation is persistent "Cell count: 2704". I'm not sure how the vegetation cell size changes. I do not know where the culling range is changed.

    Problem 3, can be solved as you said, it's easy.

    Reach about 60 FPS with my computer.

    Windows 10
    Core (TM) i3-6100 CPU
    8 GB RAM
    NVIDIA GeForce GTX 1050 2 GB

    Isla.jpg
     
  50. mmonje

    mmonje

    Joined:
    Apr 26, 2015
    Posts:
    4
    I have already fixed the bridge rock and the disappearing grass, now the only thing that worries me is how long it takes the scene to become visible and invisible.
     
unityunity