Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets Critias Vegetation System [Asset Store]

Discussion in 'Works In Progress - Archive' started by Assembler-Maze, Sep 14, 2017.

  1. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Use the post-proc stack. However I have no idea what might cause a frame drop since that stuff is based on the screen depth and should not add any extra complexity.
     
    600 likes this.
  2. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    For the garbage generated by 'ProcessSubCell' and 'Add' etc... you can now tweak the settings inside the editor for lower depth and a max grass distance of '25'. Check the docs of the 'Editor Settings' section that should bet your editor work better.

    The problem with the edit-time allocations is that I can't send a sub-list of a list or a sub-array of an array to the rendering pipeline, it must be capped at a max of 1024. Since that I am forced to copy the data around quite uselessly so that I'm sure that I don't send an array larger of 1024. If I had a 'DrawMeshInstanced' with a nice (Matrix4x4 positionsArray, int startIndex, int endIndex) it would have worked a lot better without the need to copy data.

    But even in the code I have the clause: "if (mtx.Count < 1000)" so that when for a cell the instance count is less than 1000 instances it is sent directly to rendering without the copying around. With the default cell size of 20x20m (400sq m) if you would have about 2-3 types of foliage per cell that would mean that at 1-2 instances per type per sq meter you'll have batches of a maximum size of 800 that would significantly improve both your runtime and edit-time FPS. A grass instance count larger than 1000 per batch should be more like the exception and not the rule.

    For the moment just tweak the 'Editor Settings' added in V1.2 and you should be fine even then.

    For the wind I'll try contact the Unity team to see if we can grab something more sure and steady than the current implementation. However since it depends on the Unity team I can't promise anything at the moment.
     
    No0B25 likes this.
  3. RoloJo

    RoloJo

    Joined:
    Feb 26, 2013
    Posts:
    28
    Just update to 1.2 and started playing, now it looks like this? Read through the setup again as well with no luck. Using the free speedtree assets.
    upload_2017-10-26_20-49-54.png
     
  4. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I am really unsure of what might cause the issue. Have you refreshed your types? Have your regenerated your billboards? Does it happen in a fresh project as-well? Have you regenerated you speedtree's materials inside the SP inspector? Are there any error logs?
     
  5. RoloJo

    RoloJo

    Joined:
    Feb 26, 2013
    Posts:
    28
    Got it fixed, not sure what the problem was. Started from scratch and it works :)
     
  6. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Is it possible to have another system like Landscape Builder place all of your speed trees and speed grass and let Critias system render that? Landscape builder can place all the meshes on your terrain without the need to use the unity terrain tools for placement so you get way better ways and options how you want things to be placed on the terrain.
     
  7. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Self-fixing problems are my favorite :)
     
    RoloJo likes this.
  8. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I've thought at that and tried a tight integration with GAIA, however after a brief talk the creator did not seem to be interested in that any more. It is because anyone who would like to do that would require on THEIR side to write a lot of code to spit the data into my system via my public API.

    If my tool would become the most used foliage tool on the market then yes, maybe someone would be interested. But at the moment it is not, so it is quite unlikely anyone would make the effort...
     
  9. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    Major issue: Has anyone managed to build with foliage on unity2017.2 ? While trying to build for windows, I'm getting the following error:

    Shader error in 'Critias/WindTree_Grass': Did not find shader kernel 'frag_surf' to compile (on d3d11)

    Compiling Fragment program with UNITY_SINGLE_PASS_STEREO
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME

    I've already tried removing and reinstalling - no luck.

    SOLUTION: I've created a dummy scene with a cube and a new material using WindTree_Grass shader and added the scene to build list. With this setup, I can build without that error.
     
    Last edited: Oct 29, 2017
  10. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    166
    I'm using Gaia as terrain editor and for trees placement; as those trees + grasses get's added to terrain, I can then pull those trees out in Critias.
     
  11. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    33
    Hello, i am very satisfied with this product but i do have 3 concerns right now.

    1. I was wondering if there was any way to use the speed tree prefabs instead of the actual spm file for "speed tree billboarding"? I am trying to remove certain components attached to the original speed tree model but i can only do that with a prefab which is only recognized as "other tree". Is there a work around or solution to this?

    2. I am getting a rendering problem on the trees that spawn close to the camera, the trees that render with the null shader appear to not render shadows or water. It seems that switching the render queue above 3000 fixes the problem but i am not sure if thats the solution.

    3. Is there a way to add manually placed trees not used with the unitys tree or detail placement?

    Thanks
     
  12. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hey,

    Sorry for the shader mishap, but the error appears some time when building the game. The solution is to right click on the shader and 'reimport' it. The error will disappear. I made many builds to test it out and it works just fine. No need for the dummy object. In the meantime I try to see what goes wrong in there, and I'm pretty sure it is more like a unity bug rather than my shader's bug, since if you reimport it the error goes away...
     
  13. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hey,

    1. Um, I didn't thought at that use case so at the moment it is not possible. In the future I plan to add a 'OTHER_TREE_BILLBOARD' that should auto-detect 'BillboardRenderers' on other objects not SpeedTree only
    2. Sorry, what are the trees not rendering? Those should be invisible, nobody should see them, they're used only to copy the wind from
    3. Yes, of course, either hand paint them or just manually add them to your scene and use the extractor to extract them. There are more details about that in the docs
     
  14. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    33
    1. Great! this would be really awesome.
    2. Here is a pic of the problem, i dont think i explained it too well. If i set the render queue on the trees materials attached to the camera above 3000 it seems to fix the problem.
    3. Ok the hand painting works pretty well and would love the option to have to trees/bushes normal to the terrain but i tried the extractor on a root parent object holding all speed tree prefabs and this is the errors i get (last pic)

    edit: I found something in the manual saying the foliage needs to be already added to the system but you can only add prefabs in which my case they are instances, is this the problem?
     

    Attached Files:

    Last edited: Oct 30, 2017
  15. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    1. Ok

    2. Thanks for the screenshot, I've noticed the problem, it is probably due to the fact that the shader renders depth when it shouldn't. Your fix of setting the queue is fine, I'll also include it in V1.2.1 that comes with fixes

    3. The error problem with the system is that the data was somehow corrupted. You should delete the foliage data and create it anew. If you do modifications on the types without removing them manually from the inspector they will not get removed. I plan to add an simple UI option called 'Cleanup Data' that should clean the foliage data in case that you did something that made stuff loose some reference somewhere without having to delete the whole foliage file.

    4. The problem with the foliage extracting is that from what I've saw in the screenshot they ARE NOT prefab instances. Prefab instances should be colored blue in the inspector and not gray. I don't know what's the catch there but if the prefab link is somehow broken extraction will not work
     
  16. mike_kennedy989

    mike_kennedy989

    Joined:
    Feb 5, 2014
    Posts:
    51
    Hio there,
    I just bought the plugin and the trees were extracted really nicely from two terrains that exist in a large project (it's a 18 hole golf course with a subdivision and amenity area, so fairly large site.

    The plugin extracted the trees and not the grass, still learning , not sure if that was supported or not.

    The main issue I am running into is the tearing and smearing is really bad...and if you turn the camera its worse in that the FPS drops like crazy and Unity will freeze up for a few sec to many secs. Using Unity terrain with trees looks better and is smoother with similar distance settings. But anyone who has worked with Unity terrain and Speed trees will know from a workflow standpoint it sucks and has bugs.

    I am running a GF 1080 8 Gig and thats what our client machines will be.

    The main issue seems to be temporal AA.

    We CTAA 2.5 and we also tried the Post Stack Temporal as well, both cause tearing with this plugin

    So far in some case this is faster, but it looks crap unfortunately, so many awesome features for working with Speed trees.....

    Any advice?
     
  17. halecc

    halecc

    Joined:
    Dec 17, 2016
    Posts:
    33
    Ok. Thanks for all the clarification!
     
  18. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    96
    Just out of curiosity, why do you only allow extraction of Prefab instances (colored blue), and not instantiated clones of the prefab (colored grey) ?
     
  19. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Because if it is gray colored item it means that there is no prefab link and I have no idea about what it might be linked to. I use the 'PrefabUtility.GetPrefabParent' API and for gray colored item that returns 'null'. I have absolutely no idea what prefab/foliage type that item might be linked to. It can be anything.
     
  20. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I've just tested now with the post proc stack and it works just fine for me. There is absolutely nothing that might slow your project down from the post-proc stack, it does not care how much geometry you have in your scene.

    For the 'looks crap' part it is entirely your problem, I know that the screenshots that I've provided are not fake and they look at a very decent level and work just fine with the full post-proc stack. Even the game I've developed looks well and it was developed using this system.

    However I can look over your project, you can pack a small one with just the problem trees and plugin, the unity version etc. Please under 50MB. If that still does not solve your problem or whatever I'd gladly offer your a refund.
     
  21. mike_kennedy989

    mike_kennedy989

    Joined:
    Feb 5, 2014
    Posts:
    51
    Not saying the crap is the plugins faults, was referring to the tearing and smearing that are a result of the Temporal AAA and the plugin

    It's Temporal AA causing the issues, CTAA or the one in the stack, turn it off (Either one) and the tearing and smearing goes away and things run nice and quick. I really want this to work, it's way faster to work with than Unity's terrain system and speed trees. way faster......

    I'll send a simple scene with the stack and plugins for you too look at.

    The email in the Unity store is the one to refer too? I put it up on my Google drive so that there aren't any limit issues for size.

    I loaded up the project (it's complex) and the camera had a bunch of plugins break, I'll grab the back up and recreate it. it's seems it's just the one issue, it's runs fast without artifacts and tearing and smearing if I turn off Temporal AA.





     
  22. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Sure, google drive will do, send me the link via private if you don't want the project public :). I've tested with the TAA (default post processing stack) and it works just fine for me, I can send you a video. And for the project, please keep it with the problem causing TAA + one or two tree types and keep it small so that I can look very quickly over it (<50-100MB).

    I really hope that I can give you some good advice.
     
  23. mike_kennedy989

    mike_kennedy989

    Joined:
    Feb 5, 2014
    Posts:
    51
    I am on hold on this for a bit, I will to a test with another project at home and send if I see the same issue, it's a huge project and it might just be too many trees.
    BTW, how do you extract the grass fro ma terrain?
     
  24. ChrisDorn

    ChrisDorn

    Joined:
    Feb 24, 2016
    Posts:
    5
    Hi there!
    Wrote that review today, and now I remember that I wanted to mention something. Could you please add an offset slider for the foliage's world y-axis for us? Only some of our trees will have visible roots. : )
     
  25. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Tree Creator Leaves error

    After extractor trees from terrain, All Leaves disappear.
     

    Attached Files:

  26. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Too much error when I change a tree from other_grass type to other_tree type
     

    Attached Files:

  27. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Ok, take your time with the project. For the grass extraction use version's 1.2 'Detail Extractor' (read the documentation on how to do that). If you have any problem feel free to contact me again here.
     
  28. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hello,

    Thanks for the review! There is an option for that (YOffset):
    upload_2017-11-2_8-3-30.png

    However it is not used when extracted so maybe I could add it to be per-type rather to be a global setting. Added it to the minor modifications list.
     
  29. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hello, I would require the tree in order to see what the problem might be. If it was detected as 'grass' then yes, it will cull all materials except the first. I've saw the second post so I guess that it might be a bug. However I'd require the tree to see what might cause it. Thanks!
     
  30. ChrisDorn

    ChrisDorn

    Joined:
    Feb 24, 2016
    Posts:
    5
    Yes, we are frequently updating trees from the terrain, because we still need to change parts of the world. An easier way to update extracted terrains would be appreciated.


    upload images

    Thanks again! :D
     
  31. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Added to the minor update list.

    And for the easier extraction... I've thought to allow to add a parent object that can hold a lot of terrain and add those terrain from one go, without having to go through each terrain, since it might be cumbersome... Just thinking dunno, also maybe have a 'history' where it allows you to re-extract the trees with the old setup.
     
    ChrisDorn and Grendelbiter like this.
  32. aquay

    aquay

    Joined:
    Feb 23, 2017
    Posts:
    5
    I don't know if this helps. To support many many terrains in my scene, I added a button to the extractor tool to automatically populate the "Objects to extract trees from:" list with ever terrain in the scene using FindObjectsOfType<Terrain>(); This saved me a lot of time after updating one or more terrains.
     
    Assembler-Maze and ChrisDorn like this.
  33. treshold

    treshold

    Joined:
    Nov 9, 2013
    Posts:
    225
    couple of moss patches :D
    Keep up the good work!
    Grab 20171102214312 w1920h909 x342y52z1428r160.jpg
     
    Assembler-Maze likes this.
  34. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Now thats some amazing looking moss : D
     
    treshold likes this.
  35. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    I'll add it to the next bugfixing version too as a minor improvement. And I've thought at a 'history' that would allow you to re-extract everything that you previously extracted with a single button click.
     
  36. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Nice moss! Don't forget to add it to the rocks too!
     
    treshold likes this.
  37. tysuu

    tysuu

    Joined:
    May 3, 2017
    Posts:
    4
    Do u try to test FPS on Mobile ? How many FPS can u reach on Medium setting ?
     
  38. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Did not touched mobile, I really do not recommend this on mobile. It will probably explode your telephone. I'd use some other specialized technique if I'd develop on mobile and be in need of foliage/trees.
     
  39. tysuu

    tysuu

    Joined:
    May 3, 2017
    Posts:
    4
    Would u mind to talk a little bit about some specialized technique on mobile developing ;)
     
  40. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Sure, no probs, however I'd require a little bit more info on the type of project you are developing for mobile. Is it something like an open-world? Or a MOBA? I can't give good advice if I can't know the game's genere/type etc..
     
  41. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    You can try the asset "Destroyed City Free " on as

    https://www.assetstore.unity3d.com/cn/#!/content/6459

    I try 20 type of treeCreator's tree,still no leaves.

    I follow guide to extract the trees .

    if Auto Extract Types is off,then nothing extracted.

    But Auto Extract Types is on,the All the TreeCreator Tree would lost their leaves,and mark as Other_Grass Type.
    Change the type to Other_Tree Type is useless and buggy.

    You can see the pictrue below.

    I truly need Help QAQ
    QQ截图20171104003457.png QQ截图20171104003440.png
     
  42. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    I figured out a cool fast way to get Critias to work with Landscape Builder and still have baked and realtime shadows on terrain. Im using 2017.2 for this.

    1. Use Landscape Builder to generate all the Speed trees you want and how you want them placed inside the terrain engine. Bake the lighting using Mixed Lighting and Shadow mask checked.
    2. Load up Critias and extract the trees from the terrain. Extracting the terrain trees will hide the current ones that are inside the terrain engine so it acts like the new generated Critias trees are the ones that created the baked shadows. Select each tree type and check Draw Tree shadows.
    3. Make sure your directional light is set to mixed mode with shadows.
    4. In your quality settings make sure your Shadowmask Mode is set to Distance Shadowmask then set your shadow distance to where and how far you want the baked to realtime shadow to show up. Typically a good number is anywhere from 50 to 150 depending on how much performance you have and want to save etc.
    5. Hit play and you got realtime shadows in your speed trees with baked shadows in the background so its a seamless transition looking good for your landscapes. Now let critias do its magic:)

    Once you run thru it a couple times you'll get the idea then just rinse and repeat for anything else you want or changes you want done etc.
     
    Last edited: Nov 3, 2017
  43. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    How nicely will this play with trees that get instantiated and scaled at runtime? What I really need is an api call to add a new tree or scale it (or just remove then add back would work). Or at a minimum just the system inherently supports it even if the api calls are not there, as I could add those myself.
     
  44. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Awesome! I will add that to the documentation to a 'Tips & Tricks' section with a special thanks for you!
     
  45. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    In the system there is an API that allows you to add/remove trees from the system at runtime. Check out the examples. I guess that in the future I can add a function to just 'update' instead of adding/removing the tree insance based on it's GUID. I use a GUID inside the engine to uniquely identify a tree instance.
     
  46. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Hello,

    You mean that you can't change the type from 'OTHER_GRASS' to 'OTHER_TREE' ? Does the output log say anything? I'll try out that scene and if it doesn't work it means that it is a bug, and a fix will come in V 1.2.1 (that already has a HUGE improvement list).

    What you can do right now is to manually crate the tree prefabs, and manually add them to the system and change their types to 'OTHER_TREE' manually, while the system has no data in it. After that extract the trees from the terrain.
     
  47. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Yes,I will try it,thanks for your help.
    Any bug fixed is helpfull fo me!
     
  48. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    I do what you say, drag prefab to system an change their type to 'OTHER_TREE' type
    Error appear every seconds.
    It say It has no lod group? look at the picture below.
    But TreeCreator lod is on when trees on terrain, works well.
    QQ截图20171104171828.png
    QQ截图20171104171900.png
     
  49. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Maybe It need to Generate the billboard lod of TreeCreator ?
     
  50. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    630
    Since it was not designed with single LOD trees I guess that it would be a bug. I'll look over it asap(first thing Monday), and a fix will come in V1.2.1. Until then try and regenerate the types using the 'regenerate' button.