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

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    I was just looking at that! I am using a Vegetation package from an asset, and the grass and smaller objects were set to instanced indirect. I changed them to Instanced and it works now.

    Thanks for the help! sorry, i'm new here :)
     
  2. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Sorry this was an issue with the latest compatibility fix. Will update the pack with the fixed shader that will enable Instanced Indirect.
     
    Last edited: Sep 16, 2018
    p87 likes this.
  3. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    I've got another question regarding Vegetation Studio... I am following the 'Component Overview' video, and i can't seem to get the Terrain heatmap to show up.

    below is a video of what I am doing- i'm clicking "show heatmap", and then clicking on the textures exactly like in the video... but i cant see the heatmap. It hides the vegetation system, but i'm not seeing the heatmap rendered on the terrain. Any idea why this might be? Thanks~

     
  4. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I notice with the line mask using Easy roads asset On a curve the line tool doesn't figure in curves. so there is uneven amount of grass when going around a curve.
    Maybe thats just easy roads not adding enough points to figure out the curve more correctly.

     
  5. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Trying to figure out how to have grass avoid being on a certain texture.
    I'm looking at the Terrain texture rules.

    Am I wanting to include terrain textures or exclude? These really need tool tips.
    I moved the min and max slider all over the place and doesn't effect it for that texture.

    Edit: never mind I figured it out. I realize i was only doing one type of grass. I didn't notice that one type of grass was being removed on that texture.
     
    Last edited: Sep 17, 2018
  6. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Is there a tutorial that shows how to fix this issue.
    I'm wanting the grass to thin out as it runs into rocky dirt.
    right now its a straight edges as shown in the picture

     
  7. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    i contacted you by mail about a scene with about the same amount of vegetation, and get 45 fps with 250m of vegetation with 60m i get around 100fps with a ati 390x but its very bad visually as i can see as grass is full covered in 60m and then nothing so its useless for a game. Actually i get better fps just with drawmesh than using indirect instancing. I see as AAA games have dense vegetation and run without problems.
     
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. The VegetatonMaskLine used line segments and probably needs a bit more points in turns.

    From the image it looks like the resolution on the splatmap is low, making the squares. Using include/exclude rules will look like this if the edge between the 2 texture types are painted hard. Painting a gradual change will help on this.

    If you only want gradual vegetation you could maybe make a grayscale texture mask and map this as a density mask.

    Lennart
     
  9. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. If you send me a test project with your setup I can have a look at it, see if there is any configuration to do. Maybe there is some setup that gives problems with instancing.

    Lennart
     
  10. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Could you find the heatmap shader in the project and see if it is compiled? I see you are on a mac. is there a difference if you change between OpenGL and Metal?

    Lennart
     
  11. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
  12. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
  13. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    I used 2018.2, i added 2 post effects to that project, but its not much fps difference, i set custom quality setting which is around the one set as high, high quality shadows with 120m, no antialiasing
     
  14. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648

    Ya the square is from the tiles of the mapping. Are you saying its possible to make the texture map tiles smaller?
     
  15. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    It depends on your terrain size. A terrain can have a splatmap/control texture with a resolution up to 2048x2048. You set this direct on the Unity terrain. Smaller terrains can have a higher resolution per meter. The 2048 is a limit of Unity terrains.

    Lennart
     
  16. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Ahh ok always wonder what that setting was about. ya my map size is 16k. so ya that makes sense lol.
    When you change detail resolution on the terrain component does that effect vegetation studio? or does vegetation studio have its own resolution setting somewhere. I can't seem to find one.
     
  17. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Vegetation Studio does not use any of the detail or tree settings on Unity terrains. There is no similar resolution setting for since it does rule based generation of instances and not a density map as Unity Terrain does.

    The closest you get is the sample distance of each vegetation item that is used as a basis for the potential spawn point sampling.

    Lennart
     
    Last edited: Sep 17, 2018
  18. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    how do i get rid of the patches of grass. I notice density just thickens the grass where the patches are at.
    I'm wanting a nice field of grass evenly across the ground

     
  19. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Turn off the perlin noise rule on the grass.

    Lennart
     
  20. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    i believe the shader is compiled, i am not getting any errors. I right clicked the shader and did a 'Reimport' to be sure.

    heatmap works when I enable Player -> Metal Editor Support. When my editor is in OpenGL 4.1 mode, heat map does not seem to work.
     
  21. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will look at the OpenGL mode. see what it happening.

    Lennart
     
    p87 likes this.
  22. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Has this been added in the meanwhile? We're not using Unity's terrain engine, but custom meshes. Would this work?
     
  23. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I made a protoype but was not happy with the speed of sampling the meshes.

    Mesh Terrain is working on the Vegetation Studio Pro beta. Sampling in jobs with the burst compiler is so much faster.
    The beta is available now and stable. Just missing a few features.

    I will get back to looking at the protoype in a while.

    Lennart
     
  24. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi @LennartJohansen, I'm just looking for an update on the tree's and instanced indirect?

    Any idea on a ETA?

    Also is multimesh working for instanced indirect on plants etc... (and two different shaders) I understood it was and it appears ok in my scene but I had heard it was not and wondered if it may cause problems in a build.

    Thanks Andy
     
  25. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    also will touchbend work also at the plants ? at the fern etc ? like for example gta has.
     
  26. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    What is the best way to go about setting up my Gaia terrain with Tropical, Desert, Plains, Snow areas within Vegetation Studio?
     
  27. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Not sure if I've imagined it and I cant find it in the search of the docs but can you set the trees to be billboard only? I have my trees spawning as objects to get instanced indirect but would still like the billboards for distance.
     
  28. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    I will try to get the instanced indirect trees ready this week.

    Lennart
     
    zmaxz and AndyNeoman like this.
  29. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    If you have the terrain textures ready with the different areas on the terrain you can use this with the spawn rules. When you add trees and plants you can set terrain texture include and exclude rules to decide where the vegetation should be. This in additoon to all the other steepness, height, noise and sample distance rules

    Lennart
     
  30. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    This depends on the shader for the plant. To work with the touch bend functionality it needs to be designed to support this. Vegetation Studio can not control the functionality of the shader when you use 3rd party shaders.

    Lennart
     
  31. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    CreateInverseMatrix failed to compile and some billboard shaders also not working:

    Shader error in 'AwesomeTechnologies/Billboards/SingleBillboard': Unexpected identifier "UNITY_INSTANCING_BUFFER_START". Expected one of: typedef const void inline uniform nointerpolation extern shared static volatile row_major column_major struct or a user-defined type at Assets/AwesomeTechnologies/VegetationStudio/BillboardSystem/Resources/Shaders/a_tree.cginc(62)

    Shader error in 'AwesomeTechnologies/Billboards/BakedGroupBillboards': Unexpected identifier "UNITY_INSTANCING_BUFFER_START". Expected one of: typedef const void inline uniform nointerpolation extern shared static volatile row_major column_major struct or a user-defined type at Assets/AwesomeTechnologies/VegetationStudio/BillboardSystem/Resources/Shaders/a_tree_baked.cginc(30)

    Shader error in 'AwesomeTechnologies/Billboards/GroupBillboards': Unexpected identifier "UNITY_INSTANCING_BUFFER_START". Expected one of: typedef const void inline uniform nointerpolation extern shared static volatile row_major column_major struct or a user-defined type at Assets/AwesomeTechnologies/VegetationStudio/BillboardSystem/Resources/Shaders/a_tree.cginc(62)

    not working on unity 5.6.6
    but all fine in 2018

    i though unity 5.6.4 is minimal version, isnt it?
     
  32. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. It looks like you imported the package made for 2017.3 +

    There is 2 versions on the asset store one for 5.6+ and one for 2017.3+ I think somehow you got the wrong package when importing, or you tried to downgrade a project? Unity should normally fix this for you but might be an issue if you downloaded it to your computer in 2017.3+

    Try clearing the unity cache folder for assets and download again. Or send me a private message and I can give you a direct link to the package.

    Lennart
     
  33. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    hi. thx for answer.
    strange that package in 2017 version. was new computer and our admins was instructed to install all soft (include plugins) back. bad thing is they dont know what version they had and that wierd =((
    good thing is that your advice by deleting library is worked to compile compute, and errors in shaders gone when i just commented "UNITY_INSTANCING_BUFFER" in cginc.
     
    LennartJohansen likes this.
  34. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    I have a question that is certainly already answered in the forum, but I do not locate it.

    I have several plants and several trees. I have put the rendering with inclusion and exclusion by textures. All perfect.

    How can I make one of those plants have a different density from the rest (more or less)?

    Thank you and sorry if it is already answered.

    Ah!!!... Very, very, very perfect asset. Congratulations!!!
     
  35. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. Just change the "sample distance" setting in that plant. Lowering this will give you a higher density.

    Lennart
     
    Barritico likes this.
  36. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Thanks.

    I suppose that the "base" distance for the calculations is the parameter "Vegetation - Vegetation Density - [Plant] density" and, based on it, the specific data of each plant is adjusted.

    It is right?

    Thank you.
     
  37. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    When you add a new plant, grass etc it will set an initial sample distance based on what category(grass, plant, tree, object, large object). This is just to get you started.

    There is also as you have found 5 global density settings. This can be used to adjust the global density of all plants. It could be used to adjust density based on the users graphics card. This way you can lower grass and plant density on a lowe end machine and increase it on ultra mode.

    I would keep this on 1 normally and set your sample distance on each item while setting up your scene.

    Lennart
     
    Barritico likes this.
  38. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    yes i mean if you add it then to plants fern etc or only to the grass ?
     
  39. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    You could use the Vegetation Studio grass shader on a plant but in order to get any wind the plant will have to have the bend info and phase that the shader uses painted in the vertex colors of the plant. This is a manual job to add if the plant already does not have similar data from the creator.

    Lennart
     
  40. LennartJohansen

    LennartJohansen

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

    Hi. There is a new beta of Vegetation Studio Pro out. Version 0.7.0.1
    The persistent storage is now finished and working with biomes and multiple terrains.

    This requires Unity 2018.2+ and some custom settings to get jobs/burst working.

    If any Vegetation Studio users want to get beta access you can still sign up here.

    Lennart
     
    recon0303 and Baldinoboy like this.
  41. Howzer

    Howzer

    Joined:
    Oct 17, 2012
    Posts:
    13
    Hi, are there any plans for vegetation studio to support HDRP in the future?
     
    OfficialHermie likes this.
  42. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    840
    I am getting a problem with lights while running VS. When I'm near a light source, I am getting branches in the air that move with me until I am out of the light radius. This is only happening when VS is active, if disabled then light asks normal.

    See picture below. I have disabled billboards and it has no affect.

    It does only do it when trees are turned on, if I disable all trees there is no issue. When any one tree is active it comes back.

    Any ideas? Grab 20180923182026 w1920h1080 x-162y0z-527r248.jpg
     
  43. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    840
    I found the problem, it was a grass that was set to 'instanced indirect'.

    I switched it to 'instanced' and the problem is gone. :)
     
    Last edited: Sep 24, 2018
  44. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Yes. I plan to have a look again soon. The last time I tested there was no instanced indirect support in the HD SRP.
    I did some basic testing with the HD.Lit shader for some grass and that works.

    I would need to make HD versions of the grass, billboard and heatmap shader. I think the way to go is to make custom nodes and use the new shader graph, but this is still at a pre prototype...

    Lennart
     
  45. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. I am guessing it is you that contacted me on skype chat also. I think it is related to reflection not working properly in your project. The mask types are loaded like this to support 3rd party mask types. Not sure what could break this in your project.

    Edit: It was a missing compiler define

    Lennart
     
    Last edited: Sep 26, 2018
  46. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    25
    We are having bit of an issue with touch react active checkbox changes not being carried over to our persistent vegetation storage. Is it any way possible to refresh such settings in the storage?
     
  47. MBaadsgaard

    MBaadsgaard

    Joined:
    Mar 19, 2013
    Posts:
    39
    We are drawing terrain using DrawMeshInstanced and heightmap textures sampled in a vertex shader.
    For collision we have Unity terrains, but only for areas of a few hundred meters.
    We will be streaming them in and out.
    The whole world will be 4-8km wide and long.

    Do you have any recommended approach to this? My first thought was to just let the collider-terrains have a Vegetation System each, but that won't do much for draw distance. Then I looked at the mesh terrains and was thinking if I could pipe in a full, high res mesh of the terrain to generate a MeshTerrainData asset, but that is... Heavy to author.

    I haven't tried any of the solutions yet, still reading up on how Vegetation Studio works, but just wanted to get your input on suggested approach.

    How about the height- and normal-map directly? could that somehow be fed in, to generate the MeshTerrainData or used directly?

    Cheers.
     
  48. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.
    Let me explain a bit.

    Vegetation Studio needs Unity terrains to sample heights and normal. It also needs it to generate the internal cell structure. As you said in your message adding vegetation systems to the close mesh terrains will work. But you do want longer tree range than this.

    The beta of Vegetation Studio Pro is out now. You can sign up on the website
    In Vegetation Studio Pro there is support for Unity terrain, mesh terrains and a Raycast terrain source that uses the new Raycast command jobs to sample a terrain.

    these 3 types are all implementing a common interface that VS Pro uses to sample terrains.
    Multiple terrains with a single vegetation system is also possible.

    Unity terrains is sampled by adding a UnityTerrain componen to the terrain GameObject. That will hold a copy of the heightmap from TerrainData in a NativeArray that is used by the sample jobs.
    My first thought is that you could make a custom version of this that does not need the terrain/terrain data and you provide the heightmap. The sampling code should be more or less the same.

    This way when you unload the unity terrain and add in your own it will get access to the heightmap and spawn vegetation. If the heightmaps close and at distance is the same you should get identical positioning for the trees.

    If the distance heightmap has a lower resolution I would bake all the trees to the persistent storage based on UnityTerrains. Then when you swap out for the lower res at a distance it will load the pre generated trees that has the same positions as when close.

    If you could join the Vegetation Studio discord server and message me there I can explain more. Easier with a text chat. Link in my signature.

    Lennart
     
  49. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi. The touch react settings should work from the persistent storage also. This happens late in the render loop and at that point the source of the instance should not matter.

    could you send me a private message and explain a bit more about your problem?

    Lennart
     
  50. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Next few days.

    Hi. I will be out of the office traveling until Friday. I will try to follow up on forums but response might be slow.

    Lennart
     
    dsilverthorn likes this.
Thread Status:
Not open for further replies.