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

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Is there any antialiasing support in VS?

    I saw a thread in this forum on aliasing for VR in the special case of screen space shadows, but any suggestions for flat screen antialiasing in VS? At 1080p pixel crawling is strong, especially in high contrast regions such as distant trees against the sky.
     
  2. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    For now I'll proceed with baking all vegetation, but for the future it would be very helpful to permit VS+WS integration without needing to do that.
     
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. The persistent storage is per terrain. Vegetation packages can be shared between terrain.

    The storage is optimized for loading and holds the same cell structure as the terrain internally. It is stored relative to terrain positition in order to support floating origin scenes.

    What I think happens is that worldstreamer adds the VegetationMask to one of the scenes even if it covers multiple. This way it is not loaded for one of the terrain.

    I will send you a pm with some things we can try.

    Edit: Another option could be that the VegetationStudioManager object ended up in one of the scenes? This manages all the VegetationMasks in the scene.

    Lennart
     
    Last edited: Feb 16, 2018
  4. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi, you can use any antialiasing solution with VS.

    Lennart
     
  5. @LennartJohansen

    It seems a lot of us are working on multi-terrain setup and terrain-streaming mechanisms, it would be great to include the specialties in the documentation (maybe even example for the pooling - just to encourage this great adventure).
     
  6. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Good point, I will try make some guides.

    Lennart
     
  7. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Does anyone have any suggestions for aliasing tools that help with VS models?

    I'm using Beautify's DOF controls to blur the horizon tree line a bit, but the pixel crawling without aliasing is still quite problematic.
     
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I use the temporal AA in the free Unity Post Processing Stack. You can find it here.

    Lennart
     
  9. nomax5

    nomax5

    Joined:
    Jan 27, 2011
    Posts:
    365
    Question about Bushes

    I’m trying to make an English hedgerow but there aren’t a lot of Bush assets around.
    I have some old bushes that I Believe they were made using the Unity tree creator thing
    here is a picture:


    I want to use them with Vegetation Studio and have them react to light correctly like PBR.
    How do I go about updating / converting them?

    What would your advice be?

    Roy
     
    FullMe7alJacke7 likes this.
  10. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Thanks, I was aware of the Unity Post-Processing stack but it really helps to know you've had good experience with it.

    After a bit of testing I found that the temporal AA you suggested works nicely, with two important caveats:
    • Set ‘Jitter:spread’ to min (0.1) to prevent large surfaces with multiple shaders from strobing
    • Turn off the inbuilt Unity geometry AA: e.g., :Edit: Project Settings:Quality:Anti-aliasing OFF
     
    treshold likes this.
  11. FengShuiSTAR

    FengShuiSTAR

    Joined:
    Nov 23, 2016
    Posts:
    4
    Hello there! The vegetation does not show up when I do a Camera.RenderToCubemap. Any ideas how to make it work?

    Edit: I put the code in LateUpdate and now it works :) (I'm toying with the new Stereo 360 rendering methods and it works fine with your asset just so you know!)
     
    Last edited: Feb 18, 2018
  12. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Hi ! Does VS work on Mac ? AMD GPU
     
  13. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. You can use Vegetation Studio on Mac. In order to get instanced indirect rendering to work you need to enable Metal as rendering API. If you want to use OpenGL you need to set the grass to use Instanced rendering.

    Lennart
     
  14. LennartJohansen

    LennartJohansen

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

    You would have to use a tree shader that supports PBR lighting. Have you tried the Advanced Foliage Shader?
    I have not tried an upgrade from Tree Creator trees but I think it would work. Better to ask on the AFS forum to be sure.

    Lennart
     
  15. SimumakDevs

    SimumakDevs

    Joined:
    Feb 13, 2018
    Posts:
    11
  16. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Im sorry if this has been asked already, but can I use Vegetation Studio on IOS and Android platforms?
     
  17. LennartJohansen

    LennartJohansen

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

    Vegetation Studio is designed to use compute shaders and the new instanced/instanced indirect graphics APIs.
    While you can get it running on the latest models if ios and android mobiles I recommend pc or console hardware for best performance. on ios you probably need to set it to use instanced rendering, I do not think instanced indirect is supported yet.

    for shader model 5.0 support you need an android platform with OpenGL ES 3.1+AEP

    Lennart
     
  18. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi @LennartJohansen, I hope you are well. I had a method that updated the grass (root darkening etc) when it rained but it no longer works. Is there new API I can script too for changes to the grass look at runtime. I'm specifically trying to give it wetlook when my weather system is raining. (this is using your grass indirect instanced shader).
     
  19. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. You would have to loop the materials in the VegetationSystem component. Find the public VegetationModelInfoList and update the materials. Test for the shader you want or the index (i) of the vegetationItem you want to change.

    I will try to make an API where you can request materials based on shader name and/or VegetationItemID and you can update those.

    Code (csharp):
    1.  
    2.  
    3. for (int i = 0; i <= VegetationModelInfoList.Count - 1; i++)
    4. {      
    5.             for (int j = 0; j <= VegetationModelInfoList[i].VegetationMaterialsLOD0.Length - 1; j++)
    6.             {
    7.                // test for your shader and update the material
    8.             }
    9.  
    10.             for (int j = 0; j <= VegetationModelInfoList[i].VegetationMaterialsLOD1.Length - 1; j++)
    11.             {
    12.                  // test for your shader and update the material
    13.             }
    14.  
    15.             for (int j = 0; j <= VegetationModelInfoList[i].VegetationMaterialsLOD2.Length - 1; j++)
    16.             {
    17.                 // test for your shader and update the material
    18.             }
    19.  }
    20.  
    Let me know if you have any issues

    Lennart
     
    treshold likes this.
  20. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hey there, I +1 the requests for info on streaming. I just picked up VS today and have plans to use WorldStreamer as well.
     
    Lurking-Ninja likes this.
  21. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    I bought Cascade the other day and had to try the Vegetation Studio integration. It's awesome :) Vegetation Studio mask generation at the click of a button.

    dragon2.jpg
     
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,300
    I always thought I needed trees. Turned out that grass alone can be nice too :)

    dragon3.jpg
    dragon5.jpg

    Some more with Cascade (apologies for cross-post there, but I wanted to give credit to both assets)

    dragon6.jpg
    dragon7.jpg
     
  23. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Needs more fire. : D

     
  24. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Does anyone have any tips or tricks to set texture exclusions to keep vegetation from being on them? I have 8 textures and 20 plants, do I have to go to each of the 20 plants individually and set each one to not show up on the textures? That seems like a very counter productive way to go about it. Is there a way to at least do it from the texture and just say "dont spawn any veg on this texture at all"?
     
  25. LennartJohansen

    LennartJohansen

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

    For now you need to set this up per plant, but I will add a set of global exclude rules you can add for all vegetation.

    Lennart
     
    Mark_01 likes this.
  26. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Understood. I appreciate it. I was hoping someone might have workaround, like copy and pasting out of meta files or something, you never know, lol.
     
  27. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I just picked this up today when I saw the price go down a bit. Looks great, can't wait to try it out.
     
    Rowlan likes this.
  28. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    you can add one grass. set up the exclude rule and duplicate it a few times. then change the textures and spawn rules.
     
  29. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi all
    we have released Cascade 1.0.1 ver2 that is live on Unity Asset Store
    We improved the integration with Awesome Vegetation Studio.
    Assets work fully in sync. Thanks @LennartJohansen for his great asset,

     
  30. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Ah, there we go. : D That works, lol. I have some 20+ I wanted to use, so it would have been a pain. I guess that leads to my next question, how many types are too many? Same with terrain textures, I saw somewhere it said it's not a good idea to use more than 4 because of each one requiring 4 of something? I can't remember if it was draws or what it was. I am using CTS though, I don't know if that makes a difference?
     
  31. AdminArdagor

    AdminArdagor

    Joined:
    Feb 6, 2018
    Posts:
    42
    Good afternoon, Lennart.
    Baked Vegetation is easy to re-position/delete manually.
    So What if I bake all the "run-time spawn" vegetation into Baked Vegetation? Any kind of loss, lowes FPS ?
    (or I shouldn't do it on a big terrain, because "run-time spawn" vegetation is preferable and "better", and faster and so on?)
    Or no difference?
    Thank you!
     
  32. LennartJohansen

    LennartJohansen

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

    Rendering speed of the vegetation is the same if it is spawned run-time or loaded from the storage, but loading from the storage is faster when moving around the terrain. You get faster load time at the cost of diskspace/memory to hold the instances.

    Each method has some benefits over the other

    Run-time spawning
    • Will spawn vegetation on run-time procedural terrains
    • Changes if you change splat or heightmap run-time. You call an update function with the changed bounds
    • No need to store millions of vegetation instances on very large terrains
    • Density change from a setting. Lower density grass on low end computers etc.
    Loading from storage
    • Faster loading
    • Manual edit of vegetation.
    • Import trees from existing terrains
    • API for 3rd party tools adding instances
    VegetationMasks will work run-time with both solutions.

    Lennart
     
    blitzvb, Mark_01 and AdminArdagor like this.
  33. LennartJohansen

    LennartJohansen

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

    With CTS you can use up to 16 textures with a single pass of the terrain rendering. The original unity terrain shader has to do a pass per 4 textures.

    There is no problem to do 20+ prototypes, but less prototypes usually gives more of each grass/plant type and larger batches that can be instanced together. Less drawcalls...

    Lennart
     
  34. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    352

    Will the ability to change vegetation density be added to persistent storage as well?
     
  35. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes, I want to add reducing density, but increasing will not be possible.

    Lennart
     
    Mark_01 and Lars-Steenhoff like this.
  36. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    120
    Any tips for further increasing performance out of Speed Tree and VS?

    I'm using GPU Instancing and I'm only getting a 10 or 20% performance increase from regular speed tree with VS. Not nearly enough for VR.
     
  37. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    If Vegetation Studio ‘Vegetation Mask Area’ scripts are enabled, the Vegetation Studio terrain raise/lower mode will not lower terrain points when SHIFT is held, perhaps because the script locks out SHIFT which it traps when deleting mask points. Raising terrain points works. Disabling the scripts allows the terrain edit tools to trap the SHIFT key.
     
  38. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    You have the VegetationMaskArea on the same gameobject as the terrain?

    Lennart
     
  39. LennartJohansen

    LennartJohansen

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

    I will send you a pm to look at your setup. See if there is any adjustments to do.

    Lennart
     
  40. KevinCain

    KevinCain

    Joined:
    Nov 8, 2016
    Posts:
    85
    Yes, I have several masks on the terrain's gameObject.
     
  41. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Try to create a new GameObject to add the masks to. It can be a child of the terrain if you want. They do not have to be on the terrain. That should fix the shift key issue and you would gain the ability to move, rotate and scale the masks with changing the gameobject transform.

    Lennart
     
  42. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I am using a Vegetation Mask for spawning different trees and grasses on a location.
    In this vegetation mask which is pretty big I have created an object which is a field of prefabs. This one also has a Vegetation Mask which should exclude the trees of the big mask before or should simply remove all trees.
    How do I handle this? Right now nothing is removed at all. The trees have the option "Use with Vegetation Mask" Vegetation Type 1.

    And an option question:
    Couldn't get his fixed. No one has the same issue?

    Cheers
    Ronny
     
  43. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    I get some errors when building for linux:

    Despite the errors the build is successful and the resulting dedicated server works (has no graphics card).
     
  44. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Touch React

    Hi. We just found a small setup issue with the grass touch bend system and Enviro. It turns out that enviro uses layer 31 for some invisible rendering to a camera buffer. Vegetation Studio does the same. Change the layer on the Touch React component (setting in the inspector) to some other layer you do not use. I have changed the default layer to 29 for the next update of Vegetation Studio.

    Lennart
     
  45. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    The compile error is on my list. I will try to reproduce and fix it. It is only used in the editor. Should not affect any build.

    Lennart
     
  46. LennartJohansen

    LennartJohansen

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

    1. could you try to set this up in a simple project and send me on a pm? Then we look at how it should work.
    2. The collision detection on trees is using an internal grid system to detect collision. It currently only works on trees. The colliders are not used for this detection. Raycasting is currently to slow and only single threaded, but it looks like the Job system might open up for this soon...

    Lennart
     
  47. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    I wonder if either of these have to do with why I cant see my player through the camera? My player is set to layer 31, but in Enviro I have Satellite and Moon either on their own blank layer and I have camera and player set properly for their prefabs. I think Opsive TPS or some other asset has my player set to 31, can't remember which off hand.
     
  48. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    You could have a layer setup problem, but it is not the same problem as this. This issue would only affect a touch buffer rendered to the GPU.

    Lennart
     
  49. Fortitude3D

    Fortitude3D

    Joined:
    Sep 7, 2017
    Posts:
    155
    Very nice project, well done sir :)
     
    LennartJohansen likes this.
  50. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Yeah, sorry, I was mostly thinking out loud. I changed VS to use layer 15, so I think that my player now is the only thing using 31. You said Enviro uses 31 for invisible rendering, and my player is invisible, so made me wonder. Is it only that moon and satellite options though? I changed their drops downs to new layers, or is there something else coded somewhere that is outside of those?
     
Thread Status:
Not open for further replies.