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

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    That is a great news. Vegetation studio have so many new features that for me this its no longer Unity. We have used many addons but this one is game changing. i have one more question: do you plan to add transluscency and specular maps support to 2D grass and/or speedtrees?
     
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I have plans to do a bit more on the included grass shader, but first changes will probably be to extend the touch bend. bit.

    Did you try some of the other speedtree shaders out there? Alloy is free now and on GIT. I think they added a lot to the speedtree shaders. Have a look here. I do not think I will spend time extending the speedtree shaders except for some LODFade changes and instancing indirect support.

    Lennart
     
  3. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    I will have a look, basic speedtree shaders are awful. I have experimented with touch bending and for now it's a bit unnatural. Maybe some sliders to affect bending speed, amount etc would help. Also I thought that if you can bend grass(so it is rendered as separate grass blades) you can burn it too. It should't be too difficult if it's stored separately.
     
  4. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Here I got an awkward issue:
    My game has a day/night cycle system, and when the sun is setting or rising, distant tree shadows can be very large and covers a lot of area.
    then the distant trees can get unrendered if I turn my camera away.
    This caused this kind of performance:
    When I look to the sun in morning or evening, all my surroundings are covered by shadow, but if I look away, the trees that caused the shadows got culled and the terrain got bright as day all in a sudden.
    Any ideas how to avoid this issue?
     
  5. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Look at the render thread. There you can assign the sun light and set the range tree shadows will be tested.
    Send me a pm if you still get the problem.

    Lennart
     
  6. bok

    bok

    Joined:
    Feb 24, 2014
    Posts:
    44
    When I spawn a Prefab that has multiple children as a VS object, only one of those children in the prefab is displayed. Is there a way to display all of the prefab's children?
     
  7. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Vegetation Studio does not use the prefab direct. It reads the meshes and material from it and renders this using the instancing API. Meshes with submeshes and multiple materials is supported but not multiple child objects.

    Lennart
     
    bok likes this.
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Instanced GI

    Here is a video showing the Vegetation Studio implementation of the new instanced GI functionality added in Unity 2018.1.

    Lennart

     
  9. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Trying to figure out if there is a way to disable frustum culling for instanced direct rendering. Like for an orthographic minimap above the player.
     
  10. Maximilious

    Maximilious

    Joined:
    Nov 29, 2016
    Posts:
    28
    I have 2 questions if anyone can help me out.

    1) I notice there is a grass artifact which is transparent, and is only visible when light sources are hitting it, here are some examples of what i am talking about:

    gave my camera a light source with intensity of 10 to find these buggers


    set the light intensity to 0.1 and you can see see these things floating above the terrain almost fully transparent


    closer view of the bugged grass


    anyone have any ideas of what might be causing this, and how I can fix it? thank you

    2) I am trying to Add mining veins to the terrain, I have prefabs that come with particle effects like so:


    When they spawned, they lose all of their particle effects, like so:


    Is it possible to keep the particles for spawned prefab? if not do you guys know a way for me to go around this issue?

    Thank you very much in advance,

    Max
     
  11. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    There is strange thing happening to me. When I hover camera near grass in play mode, additional grass appear in empty spaces on terrain. I tried to change sliders of vegetation distance and density but it doesn't help. Any ideas? Would send gif, but it is too large.
     
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    There is a "Use GPU culling" setting on the render tab that will disable the per instance frustum culling on the GPU. But the cells are still culled by the frustum of the camera.

    If you want a second camera with a different viewpoint you can duplicate the Vegetation System Component. Assign the minimap camera to the new Vegetation System.

    Then on the render tab set both to "render direct to camera". This makes sure each camera only sees its own vegetation

    Lennart
     
    Mark_01 likes this.
  13. Ivy-SM

    Ivy-SM

    Joined:
    Apr 18, 2013
    Posts:
    31
    Hi,
    Is vegetation studio currently compatible with Voxeland? I've read in the description that it's for Unity terrains, but saw something about Voxeland in the latest change log.
     
  14. LennartJohansen

    LennartJohansen

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

    1. It looks like you have a projector in the scene that does this. Projectors render geometry again with an override shader and this does not work on instanced indirect rendering. Set the grass and plants on a separate layer and exclude this from any projector you have in the scene. Some sky systems has one.

    2. When adding vegetation to the prefab itself is not used for rendering. Scrips and effects will be ignored.
    Ther is another solution for what you want.

    Have a look at the Runtime prefab spawner. It allows you to prepare prefabs with effects and scripts that will be instantiated when close to the camera.

    More info here.

    Lennart
     
    Mark_01 and Maximilious like this.
  15. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    That is for future use, currently only Unity terrain is supported. Mesh terrain is under development.

    Lennart
     
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    It is hard to say what happens without a screenshot? Maybe you could send it on email?
    Send me a pm

    Lennart
     
  17. Maximilious

    Maximilious

    Joined:
    Nov 29, 2016
    Posts:
    28
    10/10 removing the grass/plant layers from the EnviroSky masks under lightning fixed the grass duplicates

    and the runtime spawner gave me the awesome particles I wanted for my objects



    Thank you very much for your help, this is easily the best asset I have purchased :) I can do anything I want to the terrain with this tool
     
    nirvanajie and Mark_01 like this.
  18. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    isn't Gpu culling for indirect only? In any case the second camera is showing only what is in the frustum of the first for instanced direct stuff.
     
  19. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. but the "cells" are still culled for the camera frustum, for all render modes. That is why you will need a 2nd vegetation system if you want 2 cameras with different viewpoint.

    Lennart
     
  20. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    It's working on build so I wont bother you. It appears that scene camera causes that.
     
  21. LennartJohansen

    LennartJohansen

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

    I just submitted a new version to asset store. It contains the new GI changes for 2018.1

    Lennart

    Improvements
    • Support for GI when rendering instanced in 2018.1
    • Added API to get instances of a vegetationItem to VegetationStudioManager.
    • Fixed thumbnail refresh slowdown issue in inspector
    Fixes
    • Fixed Gizmo error on VegetationMask in 2018.1
     
    ftejada and Baldinoboy like this.
  22. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Vegetation Studio Support

    Angry Mesh just updated the Rock Pack PBR asset to support Vegetation Studio
    The shaders now supports instanced indirect rendering.

    Lennart



     
    mattis89, ftejada, Mark_01 and 11 others like this.
  23. ANGRYMESH

    ANGRYMESH

    Joined:
    Sep 23, 2017
    Posts:
    14
    You did a great job with this package. It is very intuitive and useful. More than that, I am very happy that it works great with my rocks package: D
     
  24. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Two systems is going to be problematic with my setup. More so then just tweaking culling. It wasn't that difficult to modify the culling group callbacks. Still working out why vegetation that is billboard capable doesn't behave the same as vegetation that isn't, but I'm fine figuring that out that's why I buy assets with source.

    But I did run into what looks like a bug with rendering only to a select camera. If I manually select a camera and it's not the main camera, and then set VS to render to that camera only, it renders billboards to both cams. This is not an issue for me FYI I just ran into it while playing around with various settings with two cams.
     
  25. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will send you a pm.

    Lennart
     
  26. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Hi @LennartJohansen - have you run into "Unable to link compute shader" errors when building for OpenGL? In my current project, on a Win 10 dev machine set to OpenGL 4.5, ATVS runs beautifully in the editor but prevents the project from building. The error message is quite generic, but through a process of elimination, I have determined that removing all ATVS scripts / shaders from the project allow it to build successfully.

    This is present in Unity version 2017.3.1f1 and ATVS version 1.1.2.0. I have tried reimporting all project assets and rebuilding all compute shaders, but neither of these helped. If you haven't seen this before/don't have a quick fix, I'd be happy to put together a repro project tomorrow.

    Cheers mate!

    atvs_build_error.jpg
     
  27. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    How come the two examples show such a huge difference in rendered triangles count? The "OFF" example renders 10 million triangles and the "ON" example, according to the statistics window, 100 thousand only (100 times fewer triangles).
     
  28. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Instanced indirect triangles does not show up in the stats window. Unity does not know the amount since all the instances are stored in a GPU buffer and rendered direct from there. The triangle amount should be the same.
     
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.
    If you send me a pm with the link to the repo project and I will have a look.

    Lennart
     
  30. Cramonky

    Cramonky

    Joined:
    Apr 1, 2013
    Posts:
    186
    Hey @LennartJohansen,

    Sorry if this question has already been answered, but I was wondering if this package supports instantiating and deleting trees at runtime? My game has an in-game level editor where the player needs to be able to place trees (I have already read that this supports tree creator trees, which is fantastic since all of my tree assets are made with the tree creator).

    I am definitely very interested in this, and if runtime creation of trees is supported then you will almost certainly get a buy from me :)
     
  31. LennartJohansen

    LennartJohansen

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

    This works good.
    You can add and remove trees run-time. You assign all available tree types to the vegetation package and disable run-time spawning. Then assign a persistent storage package.

    When this is done you can use the API to add and remove trees as you want.

    You will have to serialize the changes and add trees again at scene load if you want the changes to be persistent between sessions. The persistent storage component can read and write to a stream, or you can handle this yourself.

    Lennart
     
  32. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    I am glad to announce the support for Vegetation Studio in TerraPainter. the net asset for GPU Procedural Splat Map Generation. You will be able to load your already existing Vegetation Studio Packages directly in TerraPainter keeping your setting but using all the power of GPU Generation

    upload_2018-3-18_14-54-14.png
     
  33. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Development update

    Instancing changes in Unity 2018.1 finally allows for a proper way of injecting the unity_LODFade variable for instanced and instanced indirect rendered objects. From next Vegetation Studio update Speedtree vertex LOD fade will work between LODs on unmodified shaders.

    When I finish GPU shadow culling I will add this for instanced indirect trees also.

    There is a setting on the Advanced tab that allows you to set the distance the fade will use.

    Lennart

     
  34. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Really exciting post! Fade support is even more on my wish list than GI. To see both coming is amazing!
     
    boysenberry and antoripa like this.
  35. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm trying to create a shadowmask for use with MicroSplat, but the process stalls out with this error:

    DirectoryNotFoundException: Could not find a part of the path -- and then lists the path to the location I selected to save the shadowmask in. But the path is valid (I selected in the popup window) so I don't understand how to fix this.

    thx
    Dave
     
  36. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Do you use windows or OSX?

    Lennart
     
  37. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
  38. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will have a look at it.

    Lennart
     
  39. Suavomirro

    Suavomirro

    Joined:
    Dec 3, 2012
    Posts:
    61
    Is there way to change size of perlin noise in position tab of vegetation spawning rules? 150 is still too dense for me in some cases.

    EDIT:dont want to spam post so I'm editing this one because it's not answered yet. I'm making Arizona wasteland like area and I have multiple cactuses which differ in small aspects from one another. Is it possible to not spawn each cactus type separately and store let say 5 different prefabs in one vegetation item?
     
    Last edited: Mar 20, 2018
  40. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Hi @LennartJohansen, just wanted to make sure the "Unable to link compute shader" repro project I sent you on Saturday via PM made it over the wire.
     
  41. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394

    Hi. You can change the max value in the VegetationSystemEditor.cs file. I can increase this for the next release.

    You will need to add them as separate VegetationItems. I am looking at a way to do this with a custom shader and a computebuffer for meshes, but is still an early prototype.

    Lennart
     
    Mark_01, boysenberry and Suavomirro like this.
  42. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I got it. I will try to recreate the compiler bug tonight.

    Lennart
     
    Aubrey-Falconer likes this.
  43. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I'm starting to set up VS for a multi-terrain scene using World Streamer. I've got a couple questions, and would also welcome any general tips or advice for making this work well.

    I believe I can do this by creating a Veg Package for each terrain tile (I have 64 of them per game map), but that seems a bit laborious, though I can probably automate it. But Lennart also gave me some instructions for using a single Vegetation Package for all terrain tiles (since they all use the same rules), and assigning it to each terrain tile as it's loaded by WS.

    However:

    1) I am mostly using rules for vegetation but need to create a couple MaskAreas for location-specific vegetation. I'm guessing that means I actually will need to create a Veg Package for each and every terrain tile, right? Or could I use Persistent Veg for those Mask Areas, and the main Veg Package for all other vegetation? IThat is, can a single terrain tile have to Veg Packages -- one runtime and the other persistant?)

    2) I want to use the grass color mask and shadowmask with MicroSplat. Will that also require having a separate Veg Package for each tile (or would I only need to assign each terrain to the Veg Manager to generate those mask textures, but then they're assigned to the terrain so VS isn't part of it anymore?)

    3) (EDIT): I understand that to have billboard trees on mesh terrain tiles (LOD tiles at a distance), I need to bake the billboards on each terrain tile. Does this also mean I have to have a unique Veg Package for each tile?

    So if I do need to have a different Veg Package for each terrain tile, in order to use MaskAreas and possibly those masks. If so: I want all the runtime rules to be the same for all of these packages. I'll certainly be tweaking and refining those rules, and ideally would be able to keep doing that even after setting up the MaskAreas for specific terrain tiles. But I'm guessing I'd have to lock down the runtime rules, then duplicate the Veg Package 64x and then add the MaskAreas to the couple terrains that need them...so then it would be tedious to revise the rules, since now I've got to keep 64 Veg Packages updated. Is there a way to have my cake and eat it too?

    thanks
    Dave
     
    Last edited: Mar 20, 2018
  44. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello!

    Im using a terrain shader, cts.. And I noticed that when I blend the textures we say grass and dirt, then the grass dosent spawn on the grass textures weres its blended with the dirt texture... seems VS spawn only on 100% strength textures when using the texture rules..?
     
  45. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    When you make a texture rule, you set what density of the texture it should be used for. This reads the splatmap and the value is tested.

    If the shader uses some other blend mode that does not use the splatmap data you might get different results. Then Vegetation Studio can not know what texture is used at the point.

    Lennart
     
  46. LennartJohansen

    LennartJohansen

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

    1. The mask areas are independent of Vegetation Packages. You add them to the location you want and any Vegetation System that tries to spawn there will try to use the mask. If you want local vegetation you set an ID for this and in the vegetation package you set the same ID on all the VegetationItems you want to spawn there. You can use this package on other terrains also. The Vegetation Items with the set ID will be ignored for all areas without a mask set to include.

    2. The color and shadowmask does not need any spesific setup from Vegetation Studio when created. You assign them to microsplat and it handles the job from there. You will need to create a mask for each of the terrains you want to use it on.

    3. You can still use the same vegetation package. The package is only a ruleset for how to spawn vegetation. It will be different on each terrain since it has different topology.

    For all your setup here you can use the same vegetation package.

    Lennart
     
  47. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    okay thanks! for me it works like I have to set the grass to go on dirt density really small number so the grass go on the edges...

    I had sqaures of grass over my whole map. :/ anyone else with the same issue using CTS?
     
  48. bok

    bok

    Joined:
    Feb 24, 2014
    Posts:
    44
    Hey Lennart,

    In the following example I don't have any environment objects in the scene except the Vegetation Studio Grass, but I get a lot of FPS drops. The camera is top down, so it shouldn't be too demanding performance because there is no distance grass nessecary. Maybe I'm missing something?

    https://drive.google.com/file/d/1cEY4xFZUSxWCMXU1PnhbwT88ew-XPof3/view

    The grass is set to instanced indirect, vegetation distance is set to 50 which is pretty low if assume correctly. The batches/drawcalls are low, but the FPS is still pretty poor and the game keeps stuttering. Any idea what I could do to improve performance and get rid of those FPS drops?
     
  49. LennartJohansen

    LennartJohansen

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

    Can you send me a pm with some more info about your setup. Computer, graphics card, terrain size, etc.
    Also you should profile in a build and not the editor. The spawning math is done on a c++ dll when in a standalone build and much faster.

    Lennart
     
  50. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Do you have aquas in the scene? I had this problem and needed to remove foliage form aquas reflection layers.
     
Thread Status:
Not open for further replies.