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 AltTrees System [WIP] [AssetStore]

Discussion in 'Works In Progress - Archive' started by Diab1O, Sep 19, 2016.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks for feedback. Cool, hope you can find something, not usable in VR when the leafs rotate like that :D
    Which treesystem (or specific trees) would you say are best when it comes to low draw call but still realistic looking?
     
  2. MirageVRUnity

    MirageVRUnity

    Joined:
    May 10, 2016
    Posts:
    16
    Just get the speedtree modeller and remove the camera facing feature of the tree. It takes 5 minutes.
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    It helps a bit lowering the bildboard distance, but not much. Seems most is generated from the shadows sadly. Will be sweet to check out your lightmap solution. Probably a large vid.memory consumption storing all those shadows from hundreds of trees. Plus the wind will not reflect in the shadow :/

    I wonder if the new light modes in Unity 5.6 will help us reduce set pass calls from directional light.
     
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    hmm, okay, only billboards and no mixed mode shadows, still pretty high sert pass call count, should all the billboard only generate like 1 call?
     

    Attached Files:

  5. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    SpeedTree. But, you need itself create trees with a minimum amount of materials and polygons.
    Uncheck the "Auto Configuration" and set "Max LOD Patch" to 3. Or wait for the new version, which automatic configuration corrected.
     
  6. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    Is it already possible to migrate objects from the scene to altTrees system ?
    You said it it will possible by the end of Jan, but maybe I missed that feature.
     
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks, will have a look later tonight. About cameras, we will need it to work with several cameras at the same time. We have sniper scopes which uses a camera and a render texture

     
    alexanderameye likes this.
  8. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Noticed somethign else, billboards does not fade into real trees when I get closer, only the first trees that I spawn close to are actual trees.Rest are billboards and will never fade into real trees
     
  9. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    62
    Is there any plans on adding Terrain Composer 2 support any time soon?
     
  10. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Yes, I added it in the 0.9.7 update: link (video)
    Support for multiple cameras, I plan to add in the next update (0.9.8)
    Yes, I plan on it. I do not have dates at the moment.
     
  11. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Update 0.9.7.1 is available on altsystems-unity.net (in AssetStore update will come soon)!
    New price: $ 15

    You can download the latest version from here: http://altsystems-unity.net/AltTrees/LastVersion/

    Changes:

    - fixed Hue
    - added density of objects
    - now GPU instancing enabled separately for each tree/object (by default enabled for objects with < 500 triangles)
    - added option the active camera
    - optimizations...
    - bug fixes...
     
    Last edited: Feb 23, 2017
  12. MirageVRUnity

    MirageVRUnity

    Joined:
    May 10, 2016
    Posts:
    16
    Hi,

    Has GPU instancing been fixed yet for the trees in VR mode?
     
  13. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    Thank You. not sure if it's proper behavior but I got about 200 speed tree ferns in very small area.
    Before migration to alt trees I had like 3mln tris and 1758 batches, about 19ms on CPU (of course there are other objects in the scene.
    After migration to AltTrees System I have 5,2mln tris, 2896 batches and 20ms on CPU (without instancing enabled on object)
    and 6,6mln tris, 1779 batches and 20,5ms on CPU with instancing enabled.
    Maybe I'm doing something wrong, but I followed Your tutorial step by step.
    Let me know if You will have any clues what can I do or how I could test if it's normal behavior.
     
  14. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,

    now GPU instancing enabled separately for each tree/object (by default enabled for objects with < 500 triangles).

    GPU instancing works well for a large number of small objects. And it does not work well on a small number of large objects.
    You must configure the trees and objects specific to your scene (enable or disable the GPU instancing).
    See screenshots of my tests (I'm not mistook labels - everything is written correctly):

    24-02-2017 14-58-49.png 24-02-2017 14-59-26.png 24-02-2017 14-57-32.png 24-02-2017 14-58-12.png



    First, adjust the distance LODs for your trees.
    Secondly, I do not recommend GPU instancing for this scene (Look Up an explanation).
     
    LennartJohansen likes this.
  15. LennartJohansen

    LennartJohansen

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

    What is your problem with instancing on larger trees? I am doing this on a project and I get a good speed increase instancing the trees also.

    Lennart

     
  16. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I dont know. Maybe my video card is much weaker.
    Can you send me a screenshot of your scene?
    And what is your video card?
    Thank you.
     
  17. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    1070 on a laptop.

    I will send you a PM. I do not want to spam your thread with trees not using your system.
     
  18. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    Thank You for Your advice. I adjusted LOD settings and it helped a lot. I'm still experiencing some minor issue with rotating objects. When I rotate them, then they always are going back to their previous rotation value, not sure why.
     
  19. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I do not know about this problem. Can you describe in detail your actions? Or show the video.
     
  20. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    76
    If I'll brush some trees (in my case they are ferns) and I want to rotate them, they are coming back to the base rotation values, here is short video of that:

    Update: I can rotate only in Y axis, I know in some cases it is desirable, but if the object has wider root then sometimes it would be nice to rotate it to adjust it with the terrain slope.
     
    Last edited: Feb 24, 2017
  21. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Currently rotation around axes X and Z is not supported. You can rotate only around the Y axis. I plan to do it in future versions.
     
  22. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I picked this up (v9.6.1) a few days ago and am just getting the chance to test it on a build in the Unity-based virtual world of Space. Importing SpeedTrees from Unity Terrain was smooth and painless, though it looks like there were some issues with a really high poly count (350K) tree object. Everything else looks like it migrated flawlessly.

    Converting for wind did not work, though, it never started scanning, just added a 'terrain' and 'wind zone' object to the scene every time I clicked start, and the console showed the error on line 173 as another poster had encountered.

    Following the message thread through, I downloaded the latest version (v9.7.1) and installed, converting for wind appears to complete. However, when I go back to the trees where wind did not load and select the wind file that matches the SpeedTree file name, clicking the Load button does not do anything. I'm getting a directory not found error in the console. It's looking for params in:

    ProjectDirectory/AltSystems/AltTrees/SpeedTreeWindParameters/AltSystems/AltTrees/SpeedTreeWindParameters/TreeName.altWSTParams

    The files are definitely at that location, but that is not inside the Assets folder hierarchy. Is there a way to get this fixed?

    The full console error is below:
    ProjectDirectory/Assets/Plugins/
    DirectoryNotFoundException: Could not find a part of the path "/Project Directory/AltSystems/AltTrees/SpeedTreeWindParameters/AltSystems/AltTrees/SpeedTreeWindParameters/TreeName.altWSTParams".
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:292)
    System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
    (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    System.IO.File.Open (System.String path, FileMode mode) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:347)
    AltSystems.AltTrees.Editor.AltTree_Editor.OnInspectorGUI () (at Assets/Plugins/Editor/AltSystems/AltTrees/AltTree_Editor.cs:1082)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1227)
    UnityEditor.DockArea:OnGUI()​
     
  23. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,

    what your OS?

    Replace line 1063 in AltTree_Editor (Assets\Plugins\Editor\AltSystems\AltTrees\)
    Code (CSharp):
    1. string[] strs = filesTemp[i].Replace(".altWSTParams", "").Split('\\');
    to:
    Code (CSharp):
    1. string[] strs = filesTemp[i].Replace(".altWSTParams", "").Split(Path.DirectorySeparatorChar);
    and, replace line 107 in GenerateSpeedTreeWindParamsFile (Assets\Plugins\AltSystems\AltTrees\Scripts\)
    Code (CSharp):
    1. string[] strs = filesTemp[i].Replace(".spm", "").Split('\\');
    to
    Code (CSharp):
    1. string[] strs = filesTemp[i].Replace(".spm", "").Split(Path.DirectorySeparatorChar);
     
  24. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I'm using macOS. I'll make those changes and give it a try, thanks!
     
  25. IBaa

    IBaa

    Joined:
    Dec 3, 2013
    Posts:
    8
    If I've fix tree how can I replace new tree with current tree in scene? I don't want to place them again.
    How can I export alttree to terrain export button are not enable? It's seem document page are down.
     
  26. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    I'm using MapMagic to place trees on my terrain. Is there an easy way to make these trees managed by AltTrees while still keeping the settings and ability to modify the trees with MapMagics procedural approach. Thank you!
     
  27. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Currently this is not possible. I'll add it in future versions.
    To export, you must fill in these fields: http://joxi.ru/vn2Y0pvUvwVxm6

    Currently this is not possible. I plan to do the integration in the future.
     
  28. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    AltTrees 0.9.7.1 is available in AssetStrore.

    New price: $ 15
     
  29. BonsaTech

    BonsaTech

    Joined:
    Dec 22, 2015
    Posts:
    73
    When I try to enable the GPU instancing for my trees, I´m getting this message "The shader is not found! Path: Assets/Plugins/AltSystems/AltTrees/Shaders/SpeedTreeAltTreeInstanced.shader".

    How could I fix this?
     
  30. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Which Unity version you use? And which version AltTrees?
    You should use AltTrees 0.9.7.1 - 5.5.0f3
     
  31. BonsaTech

    BonsaTech

    Joined:
    Dec 22, 2015
    Posts:
    73
    Fixed, I was using the unitypackage from your website but an update popup appeared now and it fixed the issue. Cheers!
     
    Diab1O likes this.
  32. abatcat

    abatcat

    Joined:
    Feb 8, 2015
    Posts:
    70
    If I may ask a general question about making trees please :)
    When making your own trees in something other than Speedtree, what sorcery do people use to blend the uv seams between the trunk and the branches? Modeling the branches and the tree as a single object and then making a huge texture for the entire thing seems kinda wasteful.
     
  33. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Sorry, I do not prompt you. I am a programmer, I do not know anything about modeling.:)
     
  34. crudeMe

    crudeMe

    Joined:
    Jul 8, 2015
    Posts:
    92
    I've been struggling with trees for a good month already. And it seems you just got the solution to save me. Spasibo! Awesome package.

    How exactly should I use *Alt Antialiasing* script? I'm trying to smooth those distant trees with included script (either with or without default smaa) and I'm getting 2 fps. Is there any specific shader I need to put in? I'm just throwing FXAA2, which was lying around.
     
  35. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    "Alt Antialiasing" script is only for generating billboards.
    If you need to remove the noise of distant trees - try turning mipmaps in the settings generation billboards.
     
  36. MirageVRUnity

    MirageVRUnity

    Joined:
    May 10, 2016
    Posts:
    16
    For us, we are heavily cpu bound, would gpu instancing still not work well? Why is this?

     
  37. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    You set the settings "GPU instancing" for the trees?
    Share screenshots profiler please.
     
  38. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
  39. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    When will copying existing trees from scene be supported? I have a scene with very nicely placed SpeedTrees spawned from Gaia and I don't want to have to manually replace them with Alt Trees.
     
  40. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
  41. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    I don't know. I'll give that a try. I only saw a recent post where someone asked about it and the author said it wasn't supported.

    [EDIT]
    Yep, that's exactly what I needed. I wonder why the post I read said it wasn't supported. Anyway, thanks for the link. It is much appreciated.

    [EDIT 2]
    I guess I misread a post where someone wanted to replace an existing AltTree with a fixed one
     
    Last edited: Mar 8, 2017
    one_one likes this.
  42. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    I'm experimenting with the latest version and I'm still not getting the performance gains expected. First of all, it still takes forever after a scene starts playing for the trees to actually appear. Even though in the editor they are all there already. Second, I see about a 15-20 fps drop across the board for my scene with mobile quality SpeedTrees converted to AltTrees. As far as the look is concerned, at least they seem mostly correct now on the Wii U where before there were some strange issues. Note that I'm unable to use GPU instancing because I can't use 5.5 on Wii U yet and even if I could they probably won't have GPU instancing support for it anyway.

    [EDIT]
    I'm not even expecting massive improvements, but if I could get even a 5 fps increase then I would be happy. But losing 15-20 when trying to maintain 30 fps on the Wii U is a show stopper.
     
    Last edited: Mar 8, 2017
  43. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Have you made sure to disable debug logs? These are on by default (they shouldn't be, in my opinion) and slow down patch generation a lot.
     
  44. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,027
    Yes, I disabled that first thing.
     
  45. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Look "Tutorial 10. Import Objects from Scene" please.
    Can you send me a screenshots of the profiler? Before AltTrees, with AltTrees, and screenshot AltTrees Manager settings.
    In the latest version, the logs are not spammed.
     
  46. BonsaTech

    BonsaTech

    Joined:
    Dec 22, 2015
    Posts:
    73
    Does your system work correctly with lightprobes?
     
  47. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello! I did not test, but I think it works.
     
  48. Quen

    Quen

    Joined:
    Apr 6, 2010
    Posts:
    21
    Hello!
    I am using AltTrees in my VR project and was very happy with it while building the project. I use it with some SpeedTrees. Now I created a built (windows) and found a problem which I am not able to handle:
    My scene starts with a "normal" (not VR) camera to configure some settings on the monitor first. When you hit "start" in the menu, the main menu camera is being deactivated and the VR-camera is being activated. This works fine for me while I am within the editor. But when I build my project, the trees are only displayed with the first camera. After building the project, my scene has no more trees as soon as I switch to the second camera.

    Any idea what to do?
     
  49. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello! You need to set a custom camera. Look at Camera mode.
     
  50. crudeMe

    crudeMe

    Joined:
    Jul 8, 2015
    Posts:
    92
    Hey, some newbie question here: some trees just disappear, like they are occluding or something, right in front of a camera. And as camera move closer they *might* appear in their own order or may not. What should be tweakened to rule this out?