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

    LennartJohansen

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

    If you want to remove vegetation run-time you can create a vegetation mask that will filter this out. From before there is a VegetationMaskArea and a VegetationMaskLine Component.
    I am now adding the VegetationMaskCircle Component. Add one of these to any location. Set parameters for what you want to remove and it will handle the rest.

    Right now it removes vegetation per category. Grass, Plant, Tree, Object and Large Object but adding a system for adding spesific VegetationItems is not hard to do.

    Code (csharp):
    1.  
    2. GameObject vegetationItemMaskObject = new GameObject();
    3. vegetationItemMaskObject.transform.position = vegetationItemInstanceInfo.Position;
    4. VegetationMaskCircle vegetationMaskCircle = vegetationItemMaskObject.AddComponent<VegetationMaskCircle>();
    5. vegetationMaskCircle.Radius = 5f;
    6. vegetationMaskCircle.RemoveGrass = true;
    7. vegetationMaskCircle.RemovePlants = true;
    8. vegetationMaskCircle.UpdateVegetationMask();
    9.  
    This will register a mask in the vegetation system that removes grass and plants within a 5 meter radius of the GameObject it is added to.
    This is the easiest way to do it since the component handles everything for you. If you destroy the gameobject vegetation comes back. You can move it, change it etc.

    If you want to do handle a bit more yourself you can skip the component and add the internal mask yourself.

    Code (csharp):
    1.  
    2.  CircleMaskArea maskArea = new CircleMaskArea
    3.  {
    4.     Radius = 5f,
    5.     Position = YourPosition,
    6.     RemoveGrass = true,
    7.     RemovePlants = true
    8.  };
    9.  maskArea.Init();
    10.  VegetationStudioManager.AddVegetationMask(maskArea);    
    11.  
    This will register a mask directly with the mask system. You need to keep the reference and remove it when you need to.

    Code (csharp):
    1.  
    2. VegetationStudioManager.RemoveVegetationMask(maskArea);
    3.  
    Doing this is fast. The mask system will handle all refresh needed automatic when adding and removing.
    The internal CircleMaskArea class is working now. The component I will finish soon.

    I will explain a bit how the same effect could be done with the Persistent Storage API tomorrow.

    Lennart
     
  2. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Hello I have a few questions:
    1. When will be release? :) it is important for us because we really would to use this tool in our game but it is time based decision
    2. I saw there is paint tool there too, it is the most important part of placing grass. but is there option to change grass prefab for example we have 2 scenes I would to paint some grass on level then duplicate that level and in the second one I would to change normal grass to burned grass but in the same place, Is this possible? :)
    3. Will there be a compatibility with Gena or isnt that neccesesary with your system?
    4.We would to use some Hero level speed tree (15-20k per tree) on our firt person view game, How do you think with your system how many these type of trees we could render?
    5. How to test beta?
    6.How wind works with plants without speed tree I mean normal mesh grass?
    7.What about paint tool, because what could be strange but we have onyl 500mx500m terrain so painting tool is most neccesary tool for me becasue we are using only 8 terrain textures but have a lot of plants, and adding plants by texture is not enough for us, As I understand I could just paint on terrain like it was on unity terrain? THe best thing for us in your asset is optimization, that we need, and we probably use only piant tool so this is neccessary info for us. ;) Thanks
     
    Last edited: Oct 26, 2017
  3. LennartJohansen

    LennartJohansen

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

    1. I am trying to send this to asset store next week. Working on documentation and video tutorials now. Seems like Unity uses 3 weeks for approval now.

    2. Yes. this is not a problem. You can do this in code to switch the prefab/texture or just duplicate the VegetationPackage and switch between them. Some more advanced scripting is also possible using vegetation masks.

    3. You can spawn any object with GeNa to the scene/terrain as normal. If you add houses and larger objects you can pre configure them with vegetationMaskAreas that will auto adjust the vegetation. See the VegetationMaskArea doc on the website for more info. I am also talking with Adam about a deeper integration but we do not know how that will end out yet.

    4. It all depends on the computer/GPU and your density. Vegetation Studio replaces unity terrains internal culling and rendering using the new Instanced and Instanced Indirect API. This is faster as you have less state changes on the GPU but you still need to render all this. It is using the same meshes, materials etc.

    5. Send me a PM

    6. There is a built in grass system that allows you to build grass meshes and render this. This has wind and wind wave support, and also touch bend.

    you can use your own grass shader with this as long as it supports instancing. there is a _Wind vector injected to all materials rendered using a MaterialPropertyBlock but the shader needs to handle the vertex movement itself.

    I also have an include file and instructions for how to support instanced indirect for 3rd party vegetation shaders with Vegetation Studio.
     
    blitzvb likes this.
  4. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    Lennart, you can make a big stage with unlimited hills and other objects with a zone of visibility, with a dense cover of grass and a large (10 or more thousand) number of trees. and compare its performance with standard Unity tools, and with Vegetation Studio. Thank you.
     
  5. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. I will try to do a performance video, explain a bit and do some tests. But will not be this week. I am trying to have focus on finishing the documentation for the first release.

    Lennart
     
    Mark_01, mons00n and lawsochi like this.
  6. LennartJohansen

    LennartJohansen

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

    I have a question. I am looking for some nice screenshots made with Vegetation Studio. I want some to use with the Asset promotion to show sample work done with Vegetation Studio.

    Any of you beta testers have any I could use for that?

    Lennart
     
    blitzvb likes this.
  7. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    Hi. A few days ago was released SPEEDTREE CINEMA 8. Unfortunately, not yet available for Unity, but, I hope soon. So the question is - do you have any information, maybe a little insider ;-) And do you have the opportunity to prepare for a new release?
     
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Sorry, have no more info than you about that. When a new version shows up they still need to use the rendering system of unity with meshes and materials. I do not think it will be a problem to support it.
     
  9. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Random screens I've done while studying the vegetation studio
    Very dense foliage and still have some place for other geometry. around 70fps with vegetation studio, 0.3-1 fps without.
     

    Attached Files:

  10. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Really nice shots .. what assets have you used for foliage ?
     
  11. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    All foliage is speedtrees.
     
    antoripa likes this.
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Looking good :)
     
    MarkusGod likes this.
  13. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hey,

    1) I want to ask you, if that asset will work nicely with terrain composer 2 ? I already have a terrain/trees/splat textures and grass, but I would like to use your asset when it's out and maybe change some of the tree models or other vegetation. The reason I want to use it is because of the performance benefits. I would still like to keep my splat textures that were drawn by NodePainter, so they should not be affected by your asset. So is that even possible to use it when I already have a base island setup or I have to start from scratch with your asset?

    2) Where to find good vegetation models?
     
  14. LennartJohansen

    LennartJohansen

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

    1. Vegetation Studio works good with terrains created with TC2. If you do not want Vegetation Studio to do any changes to the splat textures make sure you create a Vegetation Package with "No textures".

    Trees can be imported from an existing terrain to a persistent storage and will work good.
    Direct grass import can not be done but there is a spawning rule that can use the detail mask in the terrain as a distribution density mask.

    You can then assign this mask rule to grass Vegetation Items and adjust the rotation, density, size range and other rules until you are happy. This final result you can bake to a persistent storage if you want or use as a run-time spawing rule.

    2. I have been using the grass texture packages from Turboscalpeur. they are really nice. For plants and trees assets like the Tropical Forest pack and Speedtree. But there is a lot of assets with nice vegetation and textures on asset store.

    Lennart
     
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Here's a video showing VS using the Tropical Forest Pack by @Baldinoboy. The scene also uses the following assets: Azure Sky Pro, CTS, PRISM, SE Screen Space Shadows, and HX Volumetric Lighting.

     
  16. gegebel

    gegebel

    Joined:
    Jan 29, 2014
    Posts:
    469
    it does look very good but it lacks some Post FX to feel like a forest.
    And no I couldn't do it much better, I just know something is missing :D
     
  17. gghitman69

    gghitman69

    Joined:
    Mar 4, 2016
    Posts:
    93
    Hello what is your graphics card model please
     
  18. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Viking Island need a panoramic path

     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I pretty much threw this together in about an hour so if there are ways to improve it I'm not surprised. Especially since I'm not an artist. It does have various post FX such as bloom, filmic tone mapping, color correction lut, sharpen, fog, etc.
     
  20. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    nVidia GeForce GTX 1070
     
  21. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    I wish Vegetation Studio and Landscape Auto Material has an integration, that would be an ultimate parametric world creation and rendering solution.
    Also, how should we add indirect instancing support to shaders? I managed to add standard instancing but not indirect.

    EDIT: grain on screens is image compression artefact.

    2.png 3.png 1.png
     
    MortenGulden and lawsochi like this.
  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Here is an updated video. I changed the LUT and added depth of field and color enhance. I hope it looks more like a forest.

     
    antoripa and AndyNeoman like this.
  23. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    looks good, but 1070 I'm worried :) this and the like are very rare, I think no more than 10% ... there is someone 1050, 2-core processor and not more than 4 gb of memory, here is a typical set of about 50% of the market , what can be expected with this configuration?
     
    MarkusGod likes this.
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    It all depends. There are so many ways to configure this scene with every asset I've used. I have no doubt that making different decisions could make this run just as well on 1050. Lower texture resolution, eliminate highest LOD for trees, remove a couple of post effects or lower the quality a little.
     
    manpower13 and lawsochi like this.
  25. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    sounds reassuring, thank you for sharing your experience. you can not test your scene on a weak computer? I think everyone would be useful.
     
  26. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I have a computer with just 640 GT card, but I think that's a little too far in the other direction, but I could try just for laughs. Although I'm sure I would need to drop some of the post FX to get a decent frame rate.

    [
     
    Last edited: Oct 29, 2017
    lawsochi likes this.
  27. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    640 Gt is approximately equal to Intel HD Graphics 530 integrated graphics Skylake (Core-i7 6700), it would be interesting :)
     
  28. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    OK, so I ran on my 640 GT with no changes whatsoever in 1152x864 fullscreen resolution (it doesn't have widescreen monitor). And I got from 18-20 fps. This actually surprises me because depth of field is usually a killer on that GPU. Some things to note:

    1. The scene isn't even fully optimized as I only used VS for the main trees and not the rocks or small plants.
    2. VS is undergoing an upgrade today that will make things even faster.
    3. Post FX are pretty heavy in this scene and performance could be improved by just removing depth of field alone.

    I'd say this test showed a lot. VS is indeed awesome.

    [EDIT]
    If you want, I can share the test scene privately somewhere and you can run on your own system. Note, I've been running in Good quality mode, which I honestly feel is good enough and going any higher doesn't really improve the look to be worth the drop in fps.
     
    antoripa and lawsochi like this.
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will make a document describing the process tomorrow. I have a include file you can use and then it is only 3 lines of code in the shader. 2 pragmas and including the fille.

    The include file has code that reads the buffers and sets up the rendering for Vegetation Studios implementation of Instanced Indirect.
     
    MarkusGod and AndyNeoman like this.
  30. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    You could probably use the terrain shader system from LAM with no problem, but the procedural generation and mesh combiner of LAM does not work well with an instanced based renderloop. There is no good way to feed those objects to VS and render it.

    Lennart
     
    antoripa and MarkusGod like this.
  31. lawsochi

    lawsochi

    Joined:
    Oct 24, 2016
    Posts:
    107
    this is really good news! Thank you. this gives hope that with such tools as VS we will really be able to realize our dreams in open worlds. it may be useful to include in the advertising VS scene on the integrated graphics of the latest generation, for marketing purposes ;-)
     
    Last edited: Oct 29, 2017
  32. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Thanks for clarifying! I thought that there is a way to get autotextures and pass them to VS include/exclude rules, but I realized that this is useless and easier way to set similar slope parameters in vs and lam... silly me, I need to dig in more.
    Sorry for interrupting you.
     
  33. osss

    osss

    Joined:
    Jan 20, 2014
    Posts:
    27
  34. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I have not seen many images with so well done Post Effect setup !
    Great work on the Color Grading ( i guess it is setup ).
    With so much vegetation and good post effects it is sweet to watch it !
    Awesome !
     
  35. MortenGulden

    MortenGulden

    Joined:
    Mar 15, 2015
    Posts:
    19
    Testing the precision painting tool on geometry today. Works great! :)
     
  36. Spou

    Spou

    Joined:
    Mar 26, 2015
    Posts:
    2
    Hello, Im having a small issue with tree distribution. My trees need to be tightly packed but I want them to not intersect as they're not regular tree models, the "leaves" are made of a solid material.

    I couldnt find a way to make VS detect the collision of the tree and prevent spawning another tree if it intersects with another. Is there a way to do this currently? I've tried playing with the checkbox for Collision Detection but I've haven't had any results.

    Since I have multiple different tree model I would need to be able to do this check on other vegetation items.

    Thanks!
     
  37. LennartJohansen

    LennartJohansen

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

    The collision detection setting on each of the trees should reduce collision. What is does is create a 50cm resolution grid internally in each cell while spawning. All trees will test the grid and require the center point + the grids around available before spawning a tree. Spawned trees will then register with the grid to avoid hitting other trees.

    This approach is fast but needs some improvements. It does not consider the size of the tree. Plan is to read this from the configured collider's and let the tree use check of the actual area in the test grid. It will also need to handle edge cases better.

    I will try to explain this a bit better later with a plan on how it will be improved.

    Lennart
     
  38. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Another update.

    We are getting closer. I just released a release candidate to the beta test group. We test a few days to see if any new issues show up with the latest release and then I send 1.0 to asset store :)

    Lennart
     
  39. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Hi~
    How to paint on mesh ?
    it seems only "Precision Painting" can do that, is it right ?
    VSpONM02.jpg VSpONM01.jpg
     
  40. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Precision panting can paint on any mesh and does not need colliders. It builds a octree of the scene meshes and handles raycasting manually.

    The normal painter can paint on terrain and meshes with colliders. There is a setting to enable collider painting.

    Enable paint on colliders here.



    Lennart
     
    Last edited: Oct 31, 2017
  41. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Anyone else getting a whole bunch of errors on the release candidate? I did what i usually do in deleting awesometech folder then importing new package.

    Assets/AwesomeTechnologies/VegetationStudio/VegetationSystem/VegetationSystem_FrustumCulling.cs(12,17): error CS0101: The namespace `AwesomeTechnologies' already contains a definition for `TextureMaskBand'
     
  42. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I did just deleted old package from the project assets and imported the RC1 - it was fine
     
    AndyNeoman likes this.
  43. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Then you probably did not delete all old files. The VegetationSystem_FrustumCulling.cs file was renamed to VegetationSystem_ComputeShader.cs

    Lennart
     
    AndyNeoman likes this.
  44. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I have deleted folder again, shut down unity reopended and reimported. Strange how it failed the first three times but it is correct now. Thanks.
     
  45. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,490
    Have you tried changing the time of day :) 1.JPG
     
    ftejada and Baldinoboy like this.
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    No, but I've since turned down the sun intensity for Azure sky. I wanted a daytime scene, but I might let it cycle day/night in the demo. Not sure yet.
     
  47. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    If you have a 3D object that needs an icon. Magic Icon Creator is very easy and makes great icons.

    https://www.assetstore.unity3d.com/en/#!/content/72218

    So if you need a tree icon and you have a tree, or need a plant icon to signify foliage and you have a plant. it's painless and quick.
     
  48. LennartJohansen

    LennartJohansen

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

    We found a few small issues and warnings on release candidate 1. These are all fixed now and RC2 is out tomorrow. I think this is the version that goes to asset store for review.

    Lennart
     
    Mark_01, malkere and mons00n like this.
  49. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I am considering setting up a discord support chat for Vegetation Studio when it releases. In addition to the forum. Chats are easier sometimes.

    What do you all think. Is it the right platform to use?

    Lennart
     
  50. MarkusGod

    MarkusGod

    Joined:
    Jan 10, 2017
    Posts:
    168
    Uhm, if you need only chat, there is a point to look at https://slack.com, it is a bit more support/busines oriented and does not require installing anything. And just as mention there are some similar abilities, in Twitch app (CurseApp), but discord seems to be the most popular and cheap solution.
     
Thread Status:
Not open for further replies.