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

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    @Olander would be good to see those shots with some HBAO or contact shadows(?)
     
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Unity did a presentation at Unite Amsterdam showing VR optimizations using Vegetation Studio. Here is the video.

     
  3. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    About the touch bend system: I just noticed on the documentation page that you can only update all colliders. Are static objects excluded from the collider updating?
     
  4. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Why TXAA instead of MSAA; something in the post stack perhaps?

    His comment about SPSR is spot-on. Somehow the reality of the performance advantage for SPSR got lost in translation.
     
  5. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will try to explain. The touch bend system uses a buffer in memory that is used by the grass shader. The buffer contains height and normal info from objects you would like to affect the grass/flowers (using the grass patch system and shader).

    There is a few ways to make a object affect this grass.

    1. If the object you want has colliders you can add a TouchBendCollider component to the gameobject and the colliders will render to the buffer.

    2. If no collider is present but you have a meshFilter with a mesh you can add a TouchBendMesh component. This basically does the same as the collider component but renders the mesh to the buffer. A complex mesh will use longer time to render. But the shaders is fast, this is still a light process.

    3. There is an included "TouchBend" material. This you can use for special cases. The car video with tire tracks uses this. It has a TrailRenderer on each wheel that is assigned this material. This renderer needs to be on the layer assigned on the TouchBendSystem Component. By default this is layer31 but you can change. This layer needs to be invisible for the main camera. Any mesh rendered with this material will be used with the buffer.

    4. There is also an option to render VegetationItem direct to this buffer. If you add rocks etc that you do not want grass to grow through. This is just a checkbox to enable. These will be rendered to the buffer using instancing.

    If you have a normal static gameobject in the scene it should work as normal since the mesh data and collider is there.
     
    ftejada and one_one like this.
  6. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Are you thinking in the unite demo. We used a TAA version that works with single pass VR rendering. Demo was using Deferred rendering. It looks great in VR. On screen you got some "movement blur on the edges but really hard to notice in VR.
     
  7. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    That sounds great, I'm just curious why you chose to used deferred instead of forward; was there a specific technical / artistic reason it was preferred, e.g. performance?
     
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    It worked better with single pass rendering for the water asset we used. Would also give the possibility to add much more dynamic lights than in Forward. Usually people choose Forward for the cheap 8 x MSAA but since we wanted to test with TemporalAA we could switch.
     
    buttmatrix likes this.
  9. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    That is next in the pipeline. To take this and put it into a real game scenario with Genesis Weather controlling the lighting and weather as well as my custom fully tuned Post FX stack with optional SSAO & HBAO <= Tick option to choose. I will also add CTS Terrain Shader to the mix (my personal choice).

    Those pics are coming soon.
     
    antoripa likes this.
  10. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    We're you using Unity's TAA that's included with the post processing stack?
     
  11. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    buttmatrix likes this.
  12. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Hey got a question that maybe someone can answer.

    Does this asset support multi tile terrain?
     
  13. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. That works good. You duplicate the GameObject with the VegetationSystem Component, one per Terrain and assign one terrain to each. They can all use the same VegetationPackage (ruleset) if you want.
     
    HeadClot88 likes this.
  14. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Alright good to know thanks :)
     
  15. LennartJohansen

    LennartJohansen

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

    I just got some feedback from one of the beta testers. He has Vegetation Studio running on mac using both OpenGL and Metal. On OpenGL it seems like you have to adjust the grass rendering to instanced. It is by default using Instanced Indirect, but on metal it works with indirect rendering also.


     
    DonLoquacious, antoripa, pcg and 2 others like this.
  16. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Today we added another masking component to Vegetation Studio

    The VegetationBeacon Component is designed to include/attract vegetation to areas. You can add it to any GameObject and save it with a prefab. You configure radius and a fallout curve. The curve controls the density from the center of the area and out to the edge. This can be used to add trees, plants or objects to an area. The included vegetation will still react to any configured rules, terrain textures, height, steepness, noise etc. And can also be culled by other VegetationMasks.

    For more info have a look here. https://www.awesometech.no/index.php/vegetation-beacon/







    These flowers are placed using the Vegetation Beacon, but it could be, rocks, trees, mushrooms for an area etc.
     
  17. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Brilliant new addition.
     
  18. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Yes indeed. You stated it perfectly.
     
  19. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    This is exactly what I was what I was inquiring about in my original post, very cool! So this could be used to create little groups of objects, e.g. tree with different flowers around it's base, etc.?
     
    LennartJohansen likes this.
  20. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. This will do that. You would add a VegetationBeacon. set the radius. Then you include one or more plants, flowers etc. for that area. These follow the rules you define when you add them to the VegetationSystem Component.

    all other masks you make for roads, houses etc. will affect this vegetation also.
     
  21. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    If there were a 'love' button, I would use it. That's an amazing feature, should be a huge time saver, especially since it's procedural.
     
  22. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    And you can use custom texture masks, noise for distribution on top of that. The mask can also be saved with prefabs and modify the vegetation when you drop them in the scene.
     
    antoripa, Seneral and BackwoodsGaming like this.
  23. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    This image mask is what I'll be using for integrating my TC2 Node Painter with VS, which will even allow you to paint the vegetation as usual, but in a semi-/mixed-procedural way:) It won't necessarily require TC2 then, of course:)
    Seneral
     
    antoripa likes this.
  24. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Seneral likes this.
  25. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. We actually have this "pigmentmap" system built in the shader. To make it a bit easier I have exposed this as 2 tint colors per grass item you add. I then use a noise map you can scale to make these tinted areas. The noise value decides the Lerp between the 2 tint colors.



    Last image is with a tint color set to one of the 2 grass types in the scene. This will give you natural areas with other pigmentation on the grass. You control the area size with the tint area scale.

    There is also options to add a bit of roughness with the random darkening and add root ambient occlusion with the root ambient setting.



     
    Olander and turboscalpeur like this.
  26. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    I think the concept of this pigment map is to tint the grass in the color of the underlying terrain to hide the seams and blend the grass with the terrain better.
    The paper also describes more advanced features like fading that color to the top of the grass, so it's only tinted at the grass base near the terrain. There are controls on how much the underlying color affects the grass per item, of course, etc.
    Really nice idea actually... will bring variation into the grass fields without much effort, and the grass seems to pop out less and feel more like a natural part of the terrain:)
    Seneral
     
    Last edited: Jul 14, 2017
    ftejada and buttmatrix like this.
  27. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    It is not hard to get the color from the color map. My grass shader actually supports this now but I use the colormap/noise with a grayscale and use that value for lerping the color tint colors.

    The job is to create this color map. It could maybe be processed from the terrain splatmap and the blended average color of the terrain textures used....
     
  28. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Ok folks. I have some fully tuned in Camera Unity Post FX plus SSAO/HBAO/uAO with before and after my personal Genesis texture treatments to the Unity Viking Village stuff Lennart has in the Beta Demo. I also replaced SpeedTrees with my Birch and Beech and placed in some of my own grass to show the difference in just moments. Genesis Weather is controlling the light, shadows, and weather....it is 10am and 30% humidity.

    Landscape shader is not in these pics...so only gets better. :)
    **I had to shrink the pics a pic to upload here.

    uAO (Unity AO in Post FX) before Genesis Treatments
    AVS Test v3.2 wPostFXAO.png
    uAO with Genesis Treatements
    AVS Test v3.2 Genesis wPostFXAO.png
     
    Last edited: Jul 15, 2017
  29. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    SSAO before Genesis Treatments
    AVS Test v3.2 wSSAO.png
    SSAO with Genesis Treatments
    AVS Test v3.2 Genesis wSSAO.png
     
  30. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    HBAO before Genesis Treatments
    AVS Test v3.2 wHBAO.png
    HBAO with Genesis Treaments
    AVS Test v3.2 Genesis wHBAO A.png
     
  31. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    Two shots here with a change of trees (Genesis Trees) with no LODing as well as plants and grass (Genesis). Added a few landscape stones quickly as well. I added a lot more trees here but the FPS still maintained 45+fps. This would usually bring even a very high end system to its knees....basically this is for promo-shots. It is in fact very playable....surprisingly. :):cool::D

    AVS Test v3.2 Genesis wHBAO B.png
    AVS Test v3.2 Genesis wHBAO C.png
     
    docsavage likes this.
  32. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    So next up after this is to continue this with adding CTS terrain shader to the mix. So far with this new Unity I think I am liking HBAO the best of the AO.....but....the Unity AO is very nice and is included with the Post FX. It is also very easy to configure.

    Lennart has done a fabulous job of getting the lighting and shadowing working very well in a difficult to do task. Incredible really. In all the pics above just look at how the light plays and how well the shaders still work with the added and finely tuned Camera Post FX. Very well done.

    Cheers
    O
     
  33. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    And the final update to the AVS Demo scene....the addition of the terrain shader. Bring optimization back into the mix of normal quantities of trees as well as bring back SpeedTrees as the trees as per the demo.

    First two pics are the performance and lighting tests. CTS did not drop FPS in the scene at all and AVS played very nicely with the terrain update. First pic is at 9am and 30% humidity, the second is at 5pm and still 30% humidity.
    AVS Test v3.2 Genesis wHBAO CTS E.png
    AVS Test v3.2 Genesis wHBAO CTS F.png
    And a couple nice shots.
    AVS Test v3.2 Genesis wHBAO CTS A.png
    AVS Test v3.2 Genesis wHBAO CTS B.png
     
  34. pixelsteam

    pixelsteam

    Joined:
    May 1, 2009
    Posts:
    924
    Fly from the North to the South @dronetopolis.com with the help of Vegetation Studio Beta and CTS.


     
  35. turboscalpeur

    turboscalpeur

    Joined:
    Nov 29, 2015
    Posts:
    302
    Testing and using the RUSTIC Grass Asset with the Vegetation Studio Beta;

    All the Grass used (12 Billboards) have been combined automatically in different kind of mixed Planes with LODs to create Prefabs from the Grass Patch Generator integrated directly in the VS Beta Asset;

    Spawned Rocks, SpeedTrees too within';

    Some Screens at the moment:














    Full List of the Assets used in that Scene here
     
  36. Olander

    Olander

    Joined:
    Sep 13, 2014
    Posts:
    405
    @turboscalpeur Love the stylized saturation look. Like a highly oxygenated planet.
     
    HXCMAN and turboscalpeur like this.
  37. turboscalpeur

    turboscalpeur

    Joined:
    Nov 29, 2015
    Posts:
    302
    Thanks ! Yess did it this time very warmly and more saturated, playing mostly there with the Post Processing Stack / Eye Adaptation & Color Grading without forgetting the rest !! That's a Mix :)
     
  38. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    So do you want my left or right arm for this? :p Joking. Looks awesome I can't wait to get it!
     
  39. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    Hey,
    Will this work with world streamer asset?
    In big terrains(multi tile) ,the floating point fix is a problem(shadows,lights flickering), and World Streamer solves this problem.

    Thanks
     
  40. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. We have not done any testing with world streamer asset yet, but in theory it should work good. I have talked with Bart (NatureManufacture) and we will do some testing.

    You can move the terrain using VegetationStudio, the floating origin part should work. What you would need is a small component that adds a VegetationStudio GameObject as a child of the terrain when the World Streamer scenes load. Just a few lines of code.

    Have a look here for a similar setup for Map Magic. It sets up vegetation for run-time created terrains.

    http://www.awesometech.no/index.php/set-up-with-map-magic-infinite-terrain/
     
  41. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    I'm sure it'll work with WorldStreamer. I mean, there may need to be a small integration added somewhere but that would be all. Just thinking off the top of my head, there could be an issue with certain objects being spawned in the wrong area when the floating point solution happens? Not sure.

    Cool to see Map Magic support. I may use that.

    Currently, I am using Gaia, Enviro - Dynamic Environment, and MegaSplat xD

    https://1drv.ms/f/s!Auv-CEi09y6InR5Uo6pn2jxuiLkl

    Can't wait to use Vegetation Studio to see how well it works with these :)
     
    LennartJohansen likes this.
  42. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Today we added a new feature. The texture mask system now has 2 custom masks to read data from Mega Splat.
    You can add them like any normal texture splat or density mask and use them with rules for the vegetation.



    The control mask reads the texture at any location and the density value.
    The params mask is for now reading the density of puddles with mega splat.



    you can then configure density, include or exclude rules.
    In this example I set a type of flowers to only spawn on the edge of puddles. where puddle density is between 0.1 and 0.23



    The effect is this distribution.

    The control map can be used to include or exclude vegetation on certain types of texture. In this next image I added grass to only be spawned on mega splat texture index 14 that is a grass type.



    Jason @jbooth added some events to the terrain painter. I will see if I can get the vegetion to refresh real-time as you pain in the terrain.
     
    ftejada, Nateply, neoshaman and 6 others like this.
  43. sarum

    sarum

    Joined:
    Mar 2, 2014
    Posts:
    212
  44. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    AVS seems to be doing a lot of what LAM promised to do (and more). Really awesome.
     
    Last edited: Jul 22, 2017
    LennartJohansen likes this.
  45. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I have notice in the last screenshot that the asset has the same problem than unity, there is no fade of the grass height when going to edge, is this possible? So they can go gradually smaller until a min size, the sudden wall of grass is not very realistic unless someone selectively mowed the grass in a noise pattern!
     
    ftejada and Seneral like this.
  46. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. If you look at the grass shader inspector here you will see 2 parameters. Cull start and Cull fade distance. During the cull fade distance the shader will scale the grass down to 0 giving the effect I think you are looking for. It would be easy to expose this setting in the UI for you to increase this.

     
    ftejada, one_one and buttmatrix like this.
  47. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    I was wondering if I should have used the word fade, I was wrong, I shouldn't have, lol, I mean transition from grass full to grass less ground. I mean like an height map of grass heights like this:

    It goes gradually to full length but goes shorter toward the edge of grass zone. It's not just big tuft then empty, which is more natural when it's not a specifically mowed place, I see that in every unity scene, it's not organic.

    Especially along path, when you have the traveled part, then you have a buffer of small grass with noisy transition and then taller grass progressively, there is also a difference in saturation and "roughness" of the texture (along (or not) the heights, where taller have saturation "peaks").

    Due to the art style it's hard to see (or find a good image), but here is another if you magnify the image you will see. That's the closest example I have, though there isn't the saturation or other phenomenon.


     
    Last edited: Jul 23, 2017
  48. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    ^This notion of grass gradually becoming smaller near edges of paths, or where the terrain abruptly changes from dirt to grass, is super critical.
     
    Seneral likes this.
  49. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    A falloff curve for scale associated with each mask zone would be be great.
     
    Seneral likes this.
  50. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    This edge scaling should be possible to do.

    The issue is to set up a rule-set that is easy to manage.
    you would normally get edges for 2 reasons.

    1. you use an include or exclude rule based on terrain textures. In this example I set up a rule to not spawn grass on any location on the terrain that has more than 25% of the path texture.



    2. Other normal edges could be from using noise to distribute. Here a perlin noise is active



    in both these cases we have some info to work with.

    1. We know when there is from 1-24% of the path texture. This value could be used to scale down the grass in that area.
    2. We know when the perlin sample is close to the cutoff value and could in theory do the same.

    I think it should be implemented as an "Automatic scale adjustment" that you can enable per Vegetation Item. It could be to complicated to try to expose settings for all these cases. Better to do some testing and make an internal rule that adjusts this a bit.

    What do you think?
     
    ftejada, Hikiko66 and one_one like this.
Thread Status:
Not open for further replies.