Search Unity

[Released] Vegetation Studio Pro

Discussion in 'Assets and Asset Store' started by LennartJohansen, Jun 29, 2018.

  1. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Vegetation Studio Pro
    Hi.

    I would like to showcase new product we have been working on.

    Vegetation Studio Pro is a version of Vegetation Studio using the new Job system and Burst compiler from the core. All editor and run-time generation of vegetation is multithreaded and optimized using the new burst compiler.

    VS Pro will be released as a new asset, but there will be an upgrade path for current Vegetation Studio users and a time limited additional discount at release time.

    Development of the current Vegetation Studio version will continue as planned and some of the new functionality like mesh terrain support, instanced indirect tree support and billboard upgrades will arrive shortly for the current version.

    Current minimum Unity version is Unity 2018.2 but this will probably increase to 2018.3 during the beta.

    What is new!
    • Core technology using the new Job system and Burst compiler for increased speed and multi-threading. Live update in Editor when changing rules.
    • Single Vegetation System component supporting multiple terrains
    • Single Vegetation System component supporting multiple cameras
    • Biomes. New biome system that allows you to define biome areas on your terrains, each with its own vegetation package and splatmap rules.
    • Support for Mesh Terrains and Raycast terrains in addition to normal Unity terrains
    • Shader Controller system. This allows 3rd party shaders to expose UI elements and control run-time material changes. Controllers with support for several of the most used vegetation shaders are already included
    • Wind controller system. Like the shader controller allows for 3rd party wind settings.
    • Instanced indirect tree support

    We are getting ready for a beta and current Vegetation System users can sign up to join.
    A signup form to be included in the beta and get download access is in development. I will post here in the forum when it’s ready.

    More info on system requirements and a brief functionality overview can be found here

    Update: Vegetation Studio users can now sign up to get beta access as soon as it is ready. You can find the signup form here.

    Lennart
     
    Last edited: Oct 28, 2018
    dooly123, Mark_01, umcherrel and 17 others like this.
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Biomes

    The new biome system allows you to define areas on your terrains and assign a vegetation package with a ruleset for that area. This area can also have its own set of splatmap rules. It will work with any terrain shader, but needs all biomes to use a subset of the total textures added to the terrain.

    The following videos shows a demo terrain using multiple biome areas. We made this together with Nature Manufacture to show at Unite Berlin 2018.

    We are also working together with Nature Manufacture to create a series of pre-configured biome asset packages that will help developers quickly set up multi biome terrains. These can of course be customized for the individual developers need...

    We will post more info on this soon.



    Example of biome area editing



    Biome rule configuration



    I will keep posting updates here.


    Lennart
     
    ChrisDorn, malkere, pcg and 15 others like this.
  3. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
  4. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
  5. MortenGulden

    MortenGulden

    Joined:
    Mar 15, 2015
    Posts:
    19
    So, this thing is what you'd expect, just way more powerful in every way.
     
    P_Jong likes this.
  6. evilangel89

    evilangel89

    Joined:
    Feb 8, 2017
    Posts:
    269
    Amazing work Lennart.
     
    P_Jong likes this.
  7. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    632
    WOW looks great!

    I was going to ask on PM to avoid looking dumb .. :oops::(

    Basically asking if this is " dummy proof " meaning that you do not need to know how to code
    to get the benefits of this package ?

    I would like to ask to, if people do not upgrade for what ever reason, will it make sense for you to
    keep developing two versions of VS ?

    Thanks in advance for your time.
     
    P_Jong likes this.
  8. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Wow, even more amazing!
     
    P_Jong likes this.
  9. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    That looks indeed great, from a technical point of view using Unity cutting edge tech as well as the art used in the demos is just gorgeous.

    I would be interested to see a performance comparison between Vegetation Studio and Vegetation Studio Pro.

    I'm not a fan of is the intense logo use at the top of each Component though. I believe, if you replace the logos with Component icons, it would fit much nicer in Unity's UI and doesn't steal precious Inspector space. These icons would not only be displayed in the Inspector, but also in the Scene View for that particular item, just like any other Unity Component. I find this normally really useful.
     
    one_one and Lars-Steenhoff like this.
  10. MortenGulden

    MortenGulden

    Joined:
    Mar 15, 2015
    Posts:
    19
    It's much more artist friendly in that mostly everything is real time in editor in VS Pro (no more waiting a sec after adjusting something!), otherwise it's the same (well, except for all the new stuff).
     
    Mark_01 likes this.
  11. LennartJohansen

    LennartJohansen

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

    1. All the core job system and burst compiler use is under the hood and you do not need to think about it.
    Like the current Vegetation System version most of what you need to set up can be done with UI only, but there is an API for users that want to extend the system or fit it better to their own needs.

    2. I will continue developing and supporting both versions. For a long time most users do not want to upgrade or can not upgrade to a system that will require 2018.3 when complete. Pro version will probably be more for new projects or people in a position to upgrade and want to benefit of some of the new technology that Unity is adding.

    The reason for developing a new version is that the benefits of the new multithreading and compiler is to good to not use, it allows for more complex rulesets and faster generation.

    Lennart
     
    umcherrel, d1favero, P_Jong and 2 others like this.
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394

    1. I will try to get a feature comparison between the versions done when beta is started. Until then you can test for yourself as soon as the beta starts.

    2. The logos is all controlled by a single base editor class. I will add a setting for you to turn this off everywhere. 10 lines of code.

    Lennart
     
  13. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Looks great but would love to see better blending between 2 biomes, looking at the video's their seems be be hard edges visible especially on the terrain texturing.
     
  14. MortenGulden

    MortenGulden

    Joined:
    Mar 15, 2015
    Posts:
    19
    That's fully adjustable, and there are improvements in the ruleset for scaling vegetation at the edges that work very well. I think it's an artistic choice and mostly a consequence of having an unreasonable amount of very different biomes in a small area for demo purposes.
     
  15. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    There is curves and noise settings for blend in each direction. I think you can get it to blend they way you want. In the videos there is also a terrain shader height blend in the mix of this.

    But any ideas for improvements and additional rules for the blending is welcome. Let me know when you have played a bit with it.

    Lennart
     
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Shader Controller classes

    Hi. I will do a series of posts explaining some of the new features.

    In order to get 3rd party shaders integrated better with I added a system to create shader controller classes. These are found by reflection and can be included in 3rd party assets but I will also create and include several.

    These classes can expose settings to the Vegetation System UI that will serialize and save with the Vegetation Package.


    Here is an example for the shader UI for the grass from Nature Manufacture.

    The shader class will also get a callback for setting wind and when a material needs updating.
    This way you can add custom logic to the material update.

    The speedtree support is added this way. It contains a bit more custom logic. I will share it here.



    The default behavior if the speedtree controller is to replace the speedtree shader with a custom version that supports instanced indirect rendering. This is done run-time and will not change the original prefab.

    In addition to this it exposes different tint setting for bark and foliage.

    Code (csharp):
    1.  
    2.  
    3. #if VEGETATION_STUDIO_PRO
    4. using AwesomeTechnologies.VegetationSystem;
    5. using UnityEngine;
    6.  
    7. namespace AwesomeTechnologies.Shaders
    8. {
    9.     public class SpeedtreeShaderController : IShaderController
    10.     {
    11.         public bool MatchShader(string shaderName)
    12.         {
    13.             return (shaderName == "Nature/SpeedTree");
    14.         }
    15.  
    16.         public bool MatchBillboardShader(Material[] materials)
    17.         {
    18.             return false;
    19.         }
    20.  
    21.         public ShaderControllerSettings Settings { get; set; }
    22.  
    23.  
    24.         public void CreateDefaultSettings(Material[] materials)
    25.         {
    26.             Settings = new ShaderControllerSettings
    27.             {
    28.                 Heading = "SpeedTree settings",
    29.                 Description = "",
    30.                 LODFadePercentage = true,
    31.                 LODFadeCrossfade = true,
    32.                 SampleWind = true,
    33.                 DynamicHUE = true,
    34.                 BillboardHDWind = false                                              
    35.             };
    36.  
    37.             Settings.AddBooleanProperty("ReplaceShader", "Replace shader", "This will replace the speedtree shader with a Vegetation Studio version that supports instancd indirect", true);
    38.  
    39.             Settings.AddLabelProperty("Foliage settings");
    40.             Settings.AddColorProperty("FoliageHue", "Foliage HUE variation", "",
    41.                 ShaderControllerSettings.GetColorFromMaterials(materials, "_HueVariation"));
    42.             Settings.AddColorProperty("FoliageTintColor", "Foliage tint color", "",
    43.                 ShaderControllerSettings.GetColorFromMaterials(materials, "_Color"));
    44.  
    45.             Settings.AddLabelProperty("Bark settings");
    46.             Settings.AddColorProperty("BarkHue", "Bark HUE variation", "",
    47.                 ShaderControllerSettings.GetColorFromMaterials(materials, "_HueVariation"));
    48.             Settings.AddColorProperty("BarkTintColor", "Bark tint color", "",
    49.                 ShaderControllerSettings.GetColorFromMaterials(materials, "_Color"));
    50.         }
    51.        
    52.         public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
    53.         {
    54.             if (Settings == null) return;
    55.             Color foliageHueVariation = Settings.GetColorPropertyValue("FoliageHue");
    56.             Color barkHueVariation = Settings.GetColorPropertyValue("BarkHue");
    57.             Color foliageTintColor = Settings.GetColorPropertyValue("FoliageTintColor");
    58.             Color barkTintColor = Settings.GetColorPropertyValue("BarkTintColor");
    59.             bool replaceShader = Settings.GetBooleanPropertyValue("ReplaceShader");
    60.  
    61.             material.SetFloat("_Cutoff", material.GetFloat("_Cutoff"));
    62.          
    63.             if (HasKeyword(material,"GEOM_TYPE_BRANCH"))
    64.             {
    65.                 material.SetColor("_HueVariation", barkHueVariation);
    66.                 material.SetColor("_Color", barkTintColor);
    67.             }
    68.             else
    69.             {
    70.                 material.SetColor("_HueVariation", foliageHueVariation);
    71.                 material.SetColor("_Color", foliageTintColor);
    72.             }
    73.            
    74.             if (replaceShader)
    75.             {
    76.                 if (material.shader.name != "AwesomeTechnologies/VS_SpeedTree")
    77.                 {
    78.                     material.shader = Shader.Find("AwesomeTechnologies/VS_SpeedTree");
    79.  
    80.                 }
    81.             }
    82.             else
    83.             {
    84.                 if (material.shader.name != "Nature/SpeedTree")
    85.                 {
    86.                     material.shader = Shader.Find("Nature/SpeedTree");
    87.                 }
    88.             }
    89.         }
    90.  
    91.         bool HasKeyword(Material material, string keyword)
    92.         {
    93.             for (int i = 0; i <= material.shaderKeywords.Length - 1; i++)
    94.             {
    95.                 if (material.shaderKeywords[i].Contains(keyword))
    96.                 {
    97.                     return true;
    98.                 }
    99.             }
    100.             return false;
    101.         }
    102.  
    103.         public void UpdateWind(Material material, WindSettings windSettings)
    104.         {
    105.            
    106.         }
    107.     }
    108. }
    109. #endif
    110.  
    111.  
    The class needs to implement the functions on the IShaderController interface to be detected by Vegetation Studio Pro.

    The match shader function is used to detect what shaders the controller supports. this could be multiple shaders.

    Match billboard shader is used to detect custom billboard shaders in prefabs with LODGroups and exclude those from rendering. The billboard system in vegetation studio will take over this.

    Code (csharp):
    1.  
    2.   public bool MatchShader(string shaderName)
    3.         {
    4.             return (shaderName == "Nature/SpeedTree");
    5.         }
    6.  
    7.         public bool MatchBillboardShader(Material[] materials)
    8.         {
    9.             return false;
    10.         }
    11.  
    CreateDefaultSettings is called the first time the controller is initialized. It allows you to set capabilities of the shader like instanced indirect support. With this set to true this will be the default render setting for the shader. Also fading, billboard wind etc.

    it then allows you to add properties for the UI and saving. Floats, labels, colors, booleans etc.
    These are saved in the vegetation package and you can read them back to use in the UpdateMaterial call.

    Code (csharp):
    1.  
    2.   public void CreateDefaultSettings(Material[] materials)
    3.         {
    4.             Settings = new ShaderControllerSettings
    5.             {
    6.                 Heading = "SpeedTree settings",
    7.                 Description = "",
    8.                 LODFadePercentage = true,
    9.                 LODFadeCrossfade = true,
    10.                 SampleWind = true,
    11.                 DynamicHUE = true,
    12.                 BillboardHDWind = false                                              
    13.             };
    14.  
    15.             Settings.AddBooleanProperty("ReplaceShader", "Replace shader", "This will replace the speedtree shader with a Vegetation Studio version that supports instancd indirect", true);
    16.  
    17.             Settings.AddLabelProperty("Foliage settings");
    18.             Settings.AddColorProperty("FoliageHue", "Foliage HUE variation", "",
    19.  
    20.  
    When a material needs to refresh the UpdateMaterial function is called. Here you can read back properties and set material properties as needed. It also gets access to EnvironmentSettings that holds info like snow cover, wetness etc from a global setting for all vegetation. Shaders that support this can then update.

    Code (csharp):
    1.  
    2.   public void UpdateMaterial(Material material, EnvironmentSettings environmentSettings)
    3.         {
    4.             if (Settings == null) return;
    5.             Color foliageHueVariation = Settings.GetColorPropertyValue("FoliageHue");
    6.             Color barkHueVariation = Settings.GetColorPropertyValue("BarkHue");
    7.             Color foliageTintColor = Settings.GetColorPropertyValue("FoliageTintColor");
    8.             Color barkTintColor = Settings.GetColorPropertyValue("BarkTintColor");
    9.             bool replaceShader = Settings.GetBooleanPropertyValue("ReplaceShader");
    10.  
    11.             material.SetFloat("_Cutoff", material.GetFloat("_Cutoff"));
    12.  
    Lennart
     
    ftejada likes this.
  17. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    I'm not sure if this is an example or actual code from VS.

    You know this, which is why I'm not certain about that piece of code, because Unity Technologies recommends in various performance related talks to use cached property identifiers rather than strings to get/set shader values.
     
  18. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    This usually happens only one time at init or in editor when the user changes the inspector values.
    if this was happening in a render loop or often I agree with you.

    properties set on the compute shaders etc all use idenifiers.

    Lennart
     
    Peter77 likes this.
  19. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    Please, please add me to your beta... :)

    Just wondering ... by adding the whole biome configuration with textures and everything you pretty much remove the need for products like the upcoming Earthshaping TerraPainter and all but the core heightmap generation of procedural products like MapMagic...?
     
  20. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. There will be a signup form for the beta soon. I will post it here. Form makes it easier to make sure I do not forget anyone.

    Everyone has a different workflow for generating their terrains. You can use the biomes with VS splatmap generation or you can use any other tools, like Gaia, MapMagic, TerraPainter etc to generate the splats.

    you can then use the biome masks just to define areas and blend vegetation between them.

    Goal is to make it flexible and let people work with the tools they know and like.

    Lennart
     
    Mark_01 likes this.
  21. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    About biomes and multiple terrain tiles...?

    If you have multiple terrain tiles - as in really big terrains (1024x512 procedurally generated terrains of 1km2), is the correct workflow to define biome stack and biome mask area in global-space (covering ALL the terrain tiles) or to setup stack and mask areas for each terrain tile...?
    (Just want to make sure the workflow supports even this scenario).
     
  22. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    A single biome area mask can be on multiple terrains.

    The workflow is:

    You create one vegetation package for each biome you want to make. Then add them all to the Vegetation System component.



    You select one of these as default biome. This will be used on the entire terrain except for where you have other biomes.

    You then create biome area masks for the areas you want biomes and assign a biome type to each mask. If you want to stack biomes you need to set the biome sort order. Higher sort order on top.

    to set up a world with run-time loading or run-time generated terrains you will have to define your world when setting up the vegetation system. As an example you can define a 16x16km world. The area will be initialized at statup and you can then add and remove terrains from this area run-time.

    I am working on this part and floating origin support now.

    for a massive world as you are talking about you would have to split this up in multiple sub areas. 500 000 terrains and the area needed will not be possible in a single vegetation system setup. Just the internal structure would eat up your memory and you would get floating point issues with cell rects, masks and other prolems. even with a floating origin.

    Lennart
     
    tapawafo likes this.
  23. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    632
    Sounds good, So another question would be what about or if* people have a long term 2017.4 game/project
    and can upgrade to 2018Xf for new games/projects ... would they be able to use both VS versions ? Or use VS Pro for Unity2017.4 as well ?
     
  24. LennartJohansen

    LennartJohansen

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

    I will continue development on both versions. You can use any version depending on your project.

    To use VS pro (final version) you will need at lest 2018.3+. It will not be possible to port VS Pro back to older Unity versions since it is based on the new Unity tech they are adding now.

    For any project needing older Unity versions the standard Vegetation Studio is they way to go.

    Lennart
     
    Mark_01 likes this.
  25. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    632
    Great! Sorry to be a PIA .. I assume this to mean that if people bought VS for 2017.4 And pay's for the upgrade
    VS Pro for 2018 X that the will be able to use both versions for just the upgrade cost ? I assume this is correct,
    want to confirm.

    As I do intend to get the upgrade as well, but most or a lot of assets are still for 2017 and or 5.6X
     
  26. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. If you bought the current version and get the new (with the upgrade price) you will have both assets and get updates to both.

    Lennart
     
    Mark_01 likes this.
  27. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Floating Origin

    I finished the floating origin support for VS Pro tonight.
    Since there is multi terrain support and terrain may be loaded/unloaded runtime the floating origin will not follow the terrains. By default the position of the VegetationSystemPro component will be used as an anchor or you can assign any transform you want it to follow.



    We have a compute shader pass on all instanced indirect and a Job system culling/LOD selection pass for all instanced vegetation and can offset the instances when preparing the render info.
    The same goes for the job based vegetation and billboard cell culling.

    There is no extra calculation needed and close to 0 cost for moving the floating origin.

    Lennart
     
    Last edited: Jun 30, 2018
    Mark_01 and Lars-Steenhoff like this.
  28. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    This is a must. Eagerly awaiting the signup form.
     
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Distance Falloff rule

    With the prepass on both instanced and instanced indirect we can do a few more advanced rules.

    There is a new Distance Falloff rule that can reduce the instance density based on the camera view. This will work for grass, plants and objects both instance and instanced indirect.

    You se a minimum distance where density is 100% in this example 40% of the vegetation distance. After that the density is reduced linear towards the vegetation distance.



    Lennart
     
    Mark_01 and mons00n like this.
  30. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Post processing volumes

    On the Vegetation Studio Manager component there is now a tab with setting to help you set up post processing volumes. This needs the new Post Processing 2.0 from unity installed to be enabled.

    You can here add multiple profiles and assign each of them to a biome type. The manager will then create a custom mesh volume based on the Biome Mask area and assign and configure a post processing volume for each of the biome areas. This can then be used to blend between profiles as the player/camera moves around the map.

    You can here set the normal settings for priority, blend distance and weight that will be set on the post processing volume component when created.

    Lennart





     
    Alverik, tapawafo, mons00n and 5 others like this.
  31. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Terrain support

    There are 3 different terrain types supported by VS Pro. These all provide the area, height sample and normal needed for the vegetation spawning rules. They all use a common interface for communication with the VegetationSystem component.
    • UnityTerrains
    To add a normal Unity terrain to Vegetation Studio add the UnityTerrain component to the same GameObject as the terrain. Then drag and drop the terrain to the slot on the Terrain tab of the Vegetation System. There is also a button there that will auto configure all terrains in the scene.


    • MeshTerrains
    The MeshTerrain component allows you to add multiple meshes to a virtual terrain that Vegetation System can spawn vegetation on. You can use add mesh in the scene with a mesh renderer component.

    To get started create a MeshTerrainData scriptable object in the project folder and assign this to the component. This will store a BVH tree created from the added meshes and is used for sampling the terrain in the Job system.

    Then add the meshes you want and generate the tree.


    • RaycastTerrains
    The raycast terrain will allow you to define an area for a virtual terrain. It will use the new Raycast command jobs to sample and use any colliders on the selected layers as a terrain.


    To add one or more of these terrains to the VegetationSystem component drag and drop the gameobject with the Terrain component to the Terrains tab. By default setting the terrains area will be added to the total "world" area of the vegetation system.



    Lennart

     
  32. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Editor and run-time loading of terrains

    Run-time adding terrains to the Vegetation System is now working. I will try to explain the 2 modes you can use for terrains.

    1. Adding terrains in the editor.

    To add a terrain to the vegetation system component drag and drop a terrain with one of the terrain components decripbed in the last post to the terrain tab.

    By default vegetation studio is set up to automatic calulate its "world" based on the bounds of all added terrains. As you add a new terrain the internal cell structure is refreshed and the area is expanded to include that terrain also.
    This is the normal way for setting up a scene with one or multiple terrains. They will all work as a combined terrain with spawning, rules, billboards etc.



    2. Run-time loading terrains.
    But for some scenarios you want do load areas run-time using async scene loading or another approach to load and instantiate terrains.

    In order to do this you need to disable automatic calulation for the world area. In the image below I configured a 8k x 8k word for my scene.



    When starting the vegetation system it will initialize the internal structure for the world area.

    The UnityTerrain component now has a couple of new settings.



    • Add/remove at Enable/Disable. With this setting checked the Terrain will find the Vegetation System in the scene and add it self when the terrain is enabled. This could be when loaded or instantiated from a prefab. It will register itself with the vegetation system and update the internal cell bounds, clear cache and update the culling system for its area.
    • Apply floating origin at enabled. This setting is enabled by default. When using floating origin and a terrain is instantiated at the "offset" position it will compensate for this when setting up the terrain.

      If the terrain is instantiated at "original" position and then moved to fit the current floating origin offset you should disable this on the terrain.

      What setting you need depends on the way you manage your scene.
    You can add the UnityTerrain component before saving the scene/prefab or add this in code when loading the terrain.

    Lennart
     
    evilangel89 and tapawafo like this.
  33. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    So... if I understand correctly. I can dynamically generate/load terrain tiles on the fly at runtime - nice.
    BUT ... can I also define the biomes at runtime? Is this done with a splatmap/bitmask like MapMagic can generate - or is it done at runtime using polygon outlines, like in the editor example videos? Or can it be both?

    Or would the biomes be predefined in the editor, even though the actual terrain us generated/loaded at runtime?
     
  34. LennartJohansen

    LennartJohansen

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

    For now the biomes are polygon mask areas you can create from code or using the editor tools.

    I will look at adding this from a "bitmap" format also. It will need a multi channel bitmap with at least a top and bottom biome and a blend factor. Ideally also a pre computed distance to biome edge for some additional rules..
    But more on that later...

    You can have the biomes pre configures in the main scene and then load terrains run-time and/or the terrain scene you load could have additonal biome masks loaded with the terrain.

    Lennart
     
  35. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    So basically SDF textures for each biome channel. Thats how I define my biomes today - up to four SDF channels/biomes per terrain tile. Can this be a low res texture, or does it have to match terrain res?
     
  36. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    the resolution should not matter. But this is not something I have started to look at yet.

    The format would probably be a RGBA texture where

    R(byte) = bottom biome type index (from list below)
    B(byte) = top biome type
    G(byte) = blend between the 2 biomes
    A(byte) = distance to closest point with no top biome.

    Code (csharp):
    1.  
    2.  
    3.  [Serializable]
    4.     public enum BiomeType
    5.     {
    6.         Default = 0,
    7.         BorealForest = 1,
    8.         TemperateDeciduousForest = 2,
    9.         TropicalRainForest = 3,
    10.         TemperateRainForest = 4,
    11.         ScrubForest = 5,
    12.         DeadForest = 6,
    13.         FantasyForest = 7,
    14.         Grassland = 8,
    15.         Desert = 9,
    16.         Swamp = 10,
    17.         Tundra = 11,
    18.         Oasis = 12,
    19.         Underwater = 13,
    20.         FrozenForest = 14,
    21.         Volcano = 15,
    22.         Biome1 = 16,
    23.         Biome2 = 17,
    24.         Biome3 = 18,
    25.         Biome4 = 19,
    26.         Biome5 = 20,
    27.         Biome6 = 21,
    28.         Biome7 = 22,
    29.         Biome8 = 23
    30.     }
    31.  
    Lennart
     
  37. ChezDoodles

    ChezDoodles

    Joined:
    Sep 13, 2007
    Posts:
    107
    Awesome!
    Seems like all my bases are covered. Just one more thing. As you commented earlier, floats dont handle really huge worlds, so could the floating origin please be a double? For my own use I use a fixed point format for all positioning info to avoid problems at the outer areas, and generate/build terrain tiles in a local floating space. I guess you need a consistent offset for your noise offset and placement routines. As long as it is a double, everything should be fine
     
  38. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    The offset is a Vector3. This is used in both the compute shader pass and job system + billboard rendering and all the math on the GPU and in the Unity render loop is floats. I do not think storing the offset value in a double would change anything.

    Lennart
     
  39. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    95
    The new Book Of The Dead demo is pretty impressive. Have you any plans to implement HDRP in VSP?
     
    MaxWitsch likes this.
  40. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    When it is stable I will look at it. The last time I tested instanced indirect did not work yet and there still is no terrain shader. That is planned for 2018.3.

    When that is out and they get HDRP out of preview I will see what is needed to get it working.

    Lennart
     
  41. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Mesh terrain tests

    Hi. I have been working on the mesh terrain component and wanted to test it on a complex game scene.
    I downloaded the new 3D Game Kit from Unity to try a setup.

    I used Level 1 as a test.

    After downloading the project I added the ECS and Burst compiler packages and installed my latest version of VS Pro.
    Added Vegetation Studio to the scene and created a new MeshTerrain Component.



    I then selected the Terrain meshes and added them to the Mesh Terrain. I also wanted to add cliffs and rocks.
    As you can see from the image my multi select + drag/drop added all the LODs also. I had to manually remove LOD01 and 02. I will try to add some kind of filtering for this in the import code.

    Next I pressed generate to build the BVH tree needed to terrain sampling and added the terrain to the Vegetation System component.



    As you can see from the bounds above and the image below the world area is generated from the content of the mesh terrain.



    Here with the cell debug info set up. You can see a couple of islands at the edges not added. I found a few more meshes called distancedterrain after I took the screenshots. I should have added those as well.

    Next I created a biome/vegetation package and for this test added a single grass to the vegetation package.



    And we now have grass on the floating islands. All normal spawning rules except for terrain texture rules can be used on mesh terrain. I am finishing a MeshTerrainSource rule now. It will allow you to set an ID per mesh and use for spawning. If you look at the first image you can see that the bigger terrains have ID 2 and the rocks ID 1. This way you can have different spawn rules on different meshes.

    I did not spend any time setting up vegetation and rules but here we have the level with and without grass.





    Lennart
     
  42. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    More MeshTerrain.

    I added a debug mode for showing what meshes is added to the MeshTerrain. Can help you spot if you missed one.
    It will also show each MeshTerrainSourceID in a different color.





    Lennart
     
    Last edited: Jul 11, 2018
  43. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    And even more MeshTerrain.

    Multi level spawning is now working. You can enable this on the MeshTerrain component.



    The scene below has 15 mesh tiles that is all added to the same MeshTerrain component.



    And same scene with multi level spawning.



    The LOD filter when adding meshes is working and to optimize all triangles pointing down (underside of rocks etc) are skipped when building the BVH tree for lookup.

    Lennart
     
    evilangel89 and mons00n like this.
  44. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Vegetation Studio Pro Beta signup

    Hi. I got the beta signup form ready. You can find it here

    In order to sign up you need to create a user on the website.

    Beta is not ready yet, but soon. I need to get a demo scene set up and write a getting started guide.
    When it is ready I will start upgrading the users and giving people access.

    Lennart
     
  45. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Hi @LennartJohansen , it's great to see Vegetation Studio will be getting even more awesome.

    I am most curious about the biome system. What I was hoping to do at one point is create an internal system on top of Vegetation Studio that can generate biomes to a certain degree of accuracy. Something like Edge of Eternity's system: https://www.gamasutra.com/blogs/ZEL..._and_Rendering_in_Edge_Of_Eternity_Part_I.php

    However, it looks like Vegetation Studio Pro is aiming to accomplish something similar. Can you tell me more about your biome system and your plans for it?

    The workflow I'm eyeing is using Gaea / World Creator 2 to create the initial terrain and then import the height and splatmaps into Unity. Once the initial terrain is imported, I would set up:

    • Vegetation Studio Pro
    • SpeedTree packages
    • Enviro
    • Ultimate Water System, would likely go ahead and populate the rivers and bodies of water since they'd be carved out from the heightmap already.
    • Post Processing Stack 2
    • All the NatureManufacture packs as necessary for the biomes I want
    • Set up rules and populate vegetation using Vegetation Studio Pro
    The question then becomes how smart and procedural the biome system would be given a non-flat terrain, like if there are mountains, hills, and craters set up. I'm hoping to eventually have something that rivals what Edge of Eternity is doing.
     
  46. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    If you were part of the previous beta and are already signed up on the site do you want us to create a new sign up or will this just create a duplicate?
     
  47. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    You can use the old user, just fill out the form.

    Lennart
    Hi. I will do a post tomorrow, explaining a bit more how it works.

    Lennart
     
    Exeneva likes this.
  48. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. I will try to explain a bit more in detail how the biome system works.

    The biome system allows you to create multiple vegetationPackages/biomes and use this on the same terrain. It holds rules for vegetation spawning and also splatmap generation for the biome areas.

    To get started you set up one or more terrains with the total amount of terrain textures you will need for all biomes. In the examples below we have 16 textures set up.
    The vegetation package can store these texture references to make it easier to apply this later on fresh terrains.

    You start with setting one biome as default biome for the terrains. This will be used for any area not set to another biome.

    In the test scene here we added a big range of biomes to show some posibilities.



    Each biome is defined with a BiomeAreaMask. It is basically a polygon area. You can create this in code or using the Unity Editor.



    The Biome Area mask also holds blending rules between the biome and the biome below. You can set individual rules for vegetation and splatmap.



    You add the biomes/vegetation packages to the Biome tab of the Vegetation System compionent. Here you can also set a sort order to be used if biomes are stack on top of each other. Higer number is on top.



    Each biome holds its own VegetationItems with spawning rules. They have all the options you know from Vegetation Studio in addition to some biome spesific rules based on distance to biome edge. This can help you have smaller vegetation at the edge etc.



    Then we have splatmap rules. Of the 16 textures we added to the terrain each biome can select any subset of these to use for its splatmap.

    You enable the textures you want to use and configure splatmap rules based on steepness, height and noise rules.



    There is a preview mode that allows you to see the influcence of the texture you are configuring. It will show the textures as if it was the default biome and covers all of the terrain.



    A good way of configuring biomes is to add it as a single default biome on a terrain. Then set up your biome to work from sea level to mountain top. This way it will work good in any terrain configuration you use it with later.

    Lennart
     
    Last edited: Jul 15, 2018
    P_Jong, Mark_01, Exeneva and 2 others like this.
  49. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Texture mask system

    Hi. I am working on the user interface for the texture mask rules.
    Since a single vegetation system can handle multiple terrains, masks needs to have a world position/size.

    In cases where you have a splatmap or distribution mask per terrain you also want to simplify the rule setup for this.

    To make this easier we are adding TextureMaskGroups. You add a texture mask group to a VegetationPackage/Biome and can then add multiple texture masks to this. Each of these can then be positioned in the scene. There is a snap function to snap it to the terrain size or you can edit manually.



    There is also a preview in the sceneview when you have a texture selected. This shows the current world position of the mask.



    Lennart
     
    Mark_01 likes this.
  50. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Will you be including the test/example biomes with the final product?

    Being able to go ahead and sample a biome, like a desert, oasis, volcano, etc. and then replace vegetation assets or modify rules would greatly speed things up.

    I understand if NatureManufacture assets will also be needed for some biomes, but for those of us who do own a lot of asset packs, it would be nice to have example biomes that already use those packs or can be downloaded externally and imported.