Search Unity

[RELEASED] Vegetation Studio

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

  1. bok

    bok

    Joined:
    Feb 24, 2014
    Posts:
    35
    No, I don't have any water in my scene/project at the moment. :/
     
  2. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    @LennartJohansen what if I delete my shader profile and have the unitys standard and then the vegetation adapt to that (I hope t would cover all grass textures) and then bake vegetation and apply my shader? the vegetation would stay like it wore with standard unity shader?
     
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    That would not change anything. Vegetation Studio does not know about the shader at all. It only reads the splatmap and uses that with the rules. Baking will give the same result as run-time spawning.

    Can you send me a pm with some screenshots of the rules and your terrain area?

    Lennart
     
  4. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    1,622
    Hi!
    We just updated our Advanced Rock Pack - Link. It contain VS prefabs and instanced indirect support in our shaders.
    Now you could save fps with it ,so update your files if you already have it:)

    Most users probably know it but - rocks in action with vegetation studio:).


    We also fix few things like detail maps etc.
     
    Last edited: Mar 21, 2018
  5. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    yes I will do that later :) its behaving weirdly..
     
  6. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,024
    Thanks for those answers above, all that is good news. So I'll bake the billboards on each terrain tile, and then move all those out of the terrains and into a new folder in the World Streamer "work" scene, and set them up to load dynamically just like any other objects. Cool.

    So can you outline the procedure to get VS to work nicely with World Streamer streaming? As I understand it so far, it's something like this:

    1) Hook onto SceneManager.SceneLoaded to detect when new scenes are loaded, and search for terrains.

    2) When a terrain is found, instantiate a new Vegetation System prefab (which has our main Veg Package already assigned to it) in that scene and assign this terrain to it.

    That's essentially it, right? But you've also mentioned something about pooling...and are there other things that need to be set up for this to work efficiently?

    thanks
     
  7. spso

    spso

    Joined:
    Oct 11, 2017
    Posts:
    8
    Hello there,

    First of all: What an Awesome asset you`ve made. Thanks a million!

    I just have one question:
    If I change all my trees to use instanced indirect (using your modified speedtree shader), all works fine except I do not get any Billboards any more. Using just Instanced everythign works fine.

    Cheers and have a nice day,
    Simon

    P.S: and I just found out I get a :
    Build failed : Shader error in 'AwesomeTechnologies/Custom/VS_SpeedTreeIndirect': 'UnityApplyDitherCrossFade': cannot convert from 'struct v2f' to 'float2' at line 102 (on d3d11)

    I am on Unity 2017.3.1p2, 980TI using your latest release.

    Edit2:

    I continued testing and actually it seems the distances for switching between actual geometry and the billboards seem to be off and vastly different than in Instanced only mode.

    I use the standard settings of 100, 300, 20000 for Vegetation distances. However if I choose Instanced indirect those settings seem to have a different effect than in Instanced. There seems to be a gap between billboards and geometry.. like a ring of nothing between the two.
    I hope I am making sense here. :)

    Edit3: And another question, would it be possible to fade between billboards and geometry? To reduce popping?
     
    Last edited: Mar 21, 2018
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    1. If you look at the github there is a branch for 2017.3 and the speedtree shader.
    It looks like you are using the 5.6 version. You can find it here.

    2. I just added multi submesh support to instanced indirect, but it currently only works good on objects, plants and grass. I need to do some selection changes for trees and also get the shadow culling code working on the GPU also. This will be in an update soon. That is the missing trees in distance you get when having trees as instanced indirect.

    Lennart
     
    GingerDr73 and Mark_01 like this.
  9. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    868
    Hi @LennartJohansen , I'm looking to control the spawn prefabs a little more. Even the normal range is much to far for my spawns Is there a way to reduce much more? I tested reducing the foliage to 60 (too small really but just to test) and the spawns still seemed to spawn far away when at normal setting I would have expected 20 for a 1/3 distance. Is this a metre setting?
     
  10. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    Hi! Soo how to turn off "dont do S*** while im settings things up and I dont want to see real time changes because unity editor is slow as S***" ? My clicks counts like 15 minutes back in time... and im sitting like 5 minutes waiting when Im setting one rule"... yes I have turned off render vehetation....what else?
     
  11. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    On the advanced tab you can turn refresh to manual. Then you get a refresh button on the top of the VegetationTab and you can refresh when you want. Run-time all is as normal.

    Lennart
     
    mattis89 likes this.
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    Did not see the edit befor now. Unity 2018.1 finally allows me to inject the unity_LODFade settings. I have speedtree vertex fade running and will add the standard dither fade to billboards. But have a few things on the list before that.

    Lennart
     
    blitzvb likes this.
  13. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    What setting are you talking about? Sample Distance?

    Lennart
     
    mattis89 likes this.
  14. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    thank you for thinking of it all! :)
     
  15. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    I will try to set up an example pool with an example this week.
    It has been on my list to long.

    It will be 2 components. 1 that connects to loaded scenes, finds terrains and assigns a vegetation system, and the pool it will get the vegetation system from.

    Lennart
     
    gecko likes this.
  16. spso

    spso

    Joined:
    Oct 11, 2017
    Posts:
    8
    Awesome once again. Thanks for your quick reply. I am trembling with anticipation for the updates. ;)
    Cheers and have a nice day,
    Simon
     
  17. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    868

    The distance that prefabs spawn. Normal/long/very long. Normal is still too far for me. I only want prefabs to spawn very close to player without having to reduce the distance of vegetation.
     
  18. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    Hi. The 3 distances are directly connected to the distance bands used in the cell culling system. This gives a "free" distance check and events to load/unload. I will have to look at custom max distances on the items but this will require testing the distances to all tree/rock instances every frame when the camera moves.

    Lennart
     
    AndyNeoman likes this.
  19. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    I dont have a advanced tab
     
  20. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    There is an advanced tab on the Vegetation System component. It was added a couple of updates ago.

    Lennart
     
  21. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    updating now...
     
  22. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    I have problem with automatic update.It was ok few days ago, for example when I changed grass tint, scene refreshes automatically. Now it doesn't. I have both options unchecked in advanced tab. Is there any step I could be missing? When I hit play it updates. Worth noticing I'm working on multiple vegetation systems at once (each have own terrain).
     
  23. LennartJohansen

    LennartJohansen

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

    I had a look at it now and fixed a small bug.

    There is 2 types of refresh that happens when you change vegetation item settings.
    1. Rules changes that affect instance positions. These require respawn of the visible cells.
    2. Rules that modify materials. These just need to update the materials and will be updated in the next frame.

    What happend was that the materiall refresh did not sync between multiple vegetation systems.
    My guess is that you was looking at the terrain you was adjusting on when it worked.

    Material sync is fixed for the next update.

    Lennart
     
    Suavomirro and mattis89 like this.
  24. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    good button! I figured out the spawning rules.. but its still the squared brush that makes it look like that.. it should be round and nice edges... unity bugs out
     
  25. overmats

    overmats

    Joined:
    Jun 18, 2013
    Posts:
    5
    Hi Lennart,

    how do i change the size of painted persistance vegetation (a simple vegetation studio grass patch). It is only changing the size of the runtime vegetation. So now, if i whant to change the size, i have to delete the painted vegataion change the size and paint again. hope you can help and show me the correct way. thanks in advance

    Markus
     
    Last edited: Mar 23, 2018
  26. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    Thank you, in play mode it works in real time.
    Also I have small idea. When you're changing something in vegetation, let say which texture should be excluded, it immediatelly tries to update. Maybe it should do so if we click on scene/game window? Or add small checkbox. When I'm excluding multiple textures at a time it refreshes after every change and sometimes I would like if it change only when I hit "recalculate" or something. I mean something like mixing real time with some control when recalculate happens. I have now 4k*4k terrain with some dense vegetation and it takes awhile every time I'm changing something. It's most frustrating when I'm scaling vegetation.
     
  27. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    Go to the Advanced tab and enable manual refresh. You then get a button on the top of the Vegetation tab where you manually can refresh the vegetation.

    Lennart
     
  28. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    There is no automatic way to scale all vegetation in the persistent storage. Idea with the storage is store the instances 100% as the time of bake or manual paint. I will see if I can find a good way to do this, but will not be instant. If you have baked grass for the entire terrain it will have to manually scale all the instances in the storage.

    Lennart
     
  29. overmats

    overmats

    Joined:
    Jun 18, 2013
    Posts:
    5
    Hi Lennart,

    thank you for your answer. I use the painted grass for an architectural visualisation and need the exact manual placement of the grass. In this visualisation i do not use runtime spawn only the painted vegetation. So would be cool, if you find a solution for changing the size of the painted grass.

    regards,
    Markus
     
  30. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    I've encountered strange bug. When I starting play mode vegetation seems fine (screen 1) but after moment it dissapears for second and respawns without any rules (screen 2).
     

    Attached Files:

    • 1.png
      1.png
      File size:
      1.8 MB
      Views:
      357
    • 2.png
      2.png
      File size:
      2.5 MB
      Views:
      396
  31. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    could you send me a pm with some more info on your setup? Let us try to find out what happens.

    Lennart
     
  32. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    944
    Quick question about the curves for defining height/steepness/etc. when it comes to the texture rules - is there a way of getting the current x/y value of the node selected on the curve based on the scale(s) of the axes involved? For example, I may want a texture rule that I want it to start at an exact amount of steepness (sort of a visual indicator that this angle is too steep for the player to walk on).

    Thanks. :)
     
  33. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    I thought there was some readout there. I will have a look and make sure it is correct. I remember making it for the curves on the terrain texture splatmap generator.

    Lennart
     
  34. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    Is this the curves you are talking about? When you select the node you see the steepness/height in the corner.

    Lennart

     
  35. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    944
    I've probably never noticed it before. :confused: I'll check again next time I'm on my pc :)
     
  36. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    944
    Now I know why I didn't see them before - with the Unity light skin, the colour is black :confused:

    Untitled-2.jpg


    Edit: found a solution :D

    I went into the InspectorCurveEditor.cs file and changed

               PreLabel = new GUIStyle("ShurikenLabel");

    to
                PreLabel = new GUIStyle("ShurikenLabel")
    {
    normal = { textColor = Color.white }
    };
     
    Last edited: Mar 24, 2018
    mattis89 likes this.
  37. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    Thanks.
    I have added the fix. It will be included in the next update.

    Lennart
     
    blitzvb and mattis89 like this.
  38. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I'm wondering how the Plant category fits in the scheme of things? The manual says, "The difference between the areas is the default configuration for each item. Sample distance, Type, rotation etc.". However, trees have billboards and lods. Grass sprouts out of the ground at the Vegetation distance setting. In my experiments it seems plants act differently depending on the nature of the source mesh. Grass patch generated meshes act just like grass, and use Instanced Indirect, where as FBX based plants use Instanced, and seem to spawn further out than grass.

    What would good is to have a table that compares the vegetation item categories.
     
  39. BrokenVector

    BrokenVector

    Joined:
    Feb 2, 2017
    Posts:
    32
    Hi,
    I have a few quick questions before I pull the trigger on this asset:
    1. Does it allow persistent placement of vegetation? I use a streaming asset so it would be nice to keep this relatively the same when the player returns to a certain area.
    2. I have a 5k x 5k island with many tiles that are streamed via World Streamer. Different areas have different biomes. Can VS be applied differently based on the tile?
    3. Can areas be specialized such that there are forrested areas, meadow areas, brush areas, etc?
     
  40. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    1 - You can bake your vegetation. Here are links to to website
    https://www.awesometech.no/index.php/persistent-vegetation-storage/
    https://www.awesometech.no/index.php/persistent-vegetation-storage-package/

    2 - Each tile can have it's own Vegetation system with multiple packages attached.

    3 - There are some masking options but I didn't used them yet. There are plenty options to modify spawning rules. For example you can attach vegetation to texture so it's no problem to make different biomes.
     
    BrokenVector likes this.
  41. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    I have this small problem with spawning. My <small object> Rock with mesh collider and touch react overlaps with <tree> Poplar with capsule collider and collision detection. Is there any way to fix it? More on screens. This happens not so often but it's visible.
     

    Attached Files:

  42. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    298
    @LennartJohansen
    Is it possible to change the density of vegetation for the persistent storage? I was told this was just around the corner a little before christmas last year, and im starting to think I need to forget about this...
     
  43. LennartJohansen

    LennartJohansen

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

    1. Yes, there is a persistent storage where you can store manual painted vegetatuion. This can also be baked from procedural rules and spawned from 3rd party tools using an API.
    But the procedural rules is based on a seed and will be the same each time you spawn an area.

    2. Yes, you can have a different vegetation package for each tile.

    3. Yes, you set up the vegetation packages with rules. These can be based on terrain textures, heights, masks etc. You decide this.

    Lennart
     
    BrokenVector likes this.
  44. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    I added support for vegetation masks affection the persistent storage a while ago. after this change it is easy to add support for lowering the density of the persistent storage. This will basically remove some of the instances based on the density setting.

    But when looking at this a couple of issues came up.

    If you today have the grass density set to 0.5 when you bake you get this density baked to the persistent storage.
    By default it would then remove 50% of the instances while loading a cell and you are left with 25% of the vegetation.

    To get around this vegetation would have to be baked based on a density of 1 and then thinned at cell spawn.
    This would for most users be strange as you would expect the baked instances to be 100% of what you have spawned.

    I need to get some easy to understand settings for this to not get it confusing for users.
    This is still on the list but needs some more thought.

    Lennart
     
  45. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    The colliders are not used for collision detection. They do not really exist before you are close to the camera. This is currently to slow and does not work multithreaded when spawning vegetation. Vegetation Studio has a built in collision detection grid used for trees, plan is to extend this to objects and large objects also, but I need some more changes to make sure spawn order is always the same for these objects also.

    This is the collision detection option on each vegetation item.

    For now you could bake out the tree colliders to the scene and build an obstacle map for the rocks.

    https://www.awesometech.no/index.php/obstacle-mask-creator/

    Lennart
     
    Suavomirro likes this.
  46. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    298
    Hi,
    you mentioned the drawback, or rather a requirement for this to work. I would definitely like to use persistent storage but would also like to provide the option to vary the density to better match user hardware.

    well hopefully people here could provide some feedback for what would be helpful. I think a simple message box in the persistent storage component bake tab with a warning if density was not 1 would be enough.
     
  47. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    One option could be to introduce a "Persistent Storage Density" setting for each vegetation type (grass, plants, trees...) This would be a 0-1 setting and you could adjust this in addition to the normal run-time spawning density...
    Default to 1...

    What do you think?

    Lennart
     
  48. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    298
    i think, that would also work
     
  49. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,310
    Hi.
    I will try to explain.
    • Grass: Spawns up to vegetation distance, default rotation is to follow ground normal and scale to fit the extra area the slope gives
    • Plants: Spawns up to vegetation distance, default rotation is around Y axis
    • Objects: Spawns up to vegetation distance, default rotation is around Y axis, has option for colliders
    • Trees: Spawns to additional mesh tree distance, billboards and colliders, collision detection with other trees
    • Large Objects: Spawns up to additional mesh tree distance and has colliders
    What you see with some plants using instanced rendering showing a larger distance than with instanced indirect is based on a limitation not design.

    When rendering instanced it is to slow to scale or cull each plant/grass instance every frame as you move the camera. This would have to be done on the CPU. In these cases the vegetation is selected based on the internal cell distance. It is possible to do this in a shader, but needs a modified shader like the included grass shader.
    This is why the plants will show a bit longer for visible cells that has part of the cell outside of vegetation distance.

    When rendering instanced indirect this distance tests can be done on the GPU in the compute shader pass and all vegetation will have the correct set distance.

    Lennart
     
    Dorian-Dowse likes this.
  50. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    491
    Why is that?