Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. If you're a macOS 10.13 High Sierra user take be sure to read this before updating Unity.
    Dismiss Notice
  5. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  7. Unity 2017.3 beta is now available for download.
    Dismiss Notice

Assets AltTrees System [WIP] [AssetStore]

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

  1. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    509
    Yes I got the same problem, pity it can't be used by an external program like Easy Scatter.
     
  2. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    495
    If you have Terrain Composer 2 you can use that and then AltTrees imports nicely.

    I've got much better performance out AltTrees in the last few days. Still learning the system and really want to see the documentation of what each setting is and of course the next update.

    A solid beta start for this product I've got high hopes it will do want i need it too.

    Ive been executing unity with this addition and has helped speed the whole UI up. Might be worth a try.

    E:\Unity\Editor\Unity.exe -force-d3d11-no-singlethreaded
     
  3. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I've uploaded a video to YouTube - having played around with some settings I am getting much closer to the desired effect. LOD is now visibly working. It's also much, much harder to drive through a billboard tree.



    The main issue remaining is that there is still some "popping" visible in the video - sometimes the camera gets close to a large block of billboard trees which then all change at once. This corresponds to a spike in CPU usage, as high as 180ms on my PC. I left the debug drawcalls on so you can see where the blocks change.

    To give you a little context, my terrain is 8km x 8km, with approx 115k trees (all one prototype for now). It's taken a lot of trial and error to get to this stage, but these are the AltTrees settings I am using:

    alttrees.png

    "Distance Patch Factor" seems to be the most important - with the default value of 1.5 I was getting over 6000 draw calls and less than 20fps. Lower than 0.3 and I could get too close to a tree before it changed to a mesh tree.

    I know you are working hard fixing issues at the moment, and things seem to be getting better all the time - but I am really looking forward to some documentation :) And also tips on which settings to tweak for performance vs. quality.
     
    jonfinlay likes this.
  4. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hi, I will think about it.

    I sent you a file. Replace it in Assets\Plugins\Editor\AltSystems\AltTrees
    Try it please.
    If this does not work - try like AndyNeoman said.

    Thank you. Documentation will soon do. Difficult for me to, because I do not know much English.
     
  5. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Need to increase the "Distance Patch Factor".

    In the near future I will make support multi-threading - then billboards are faster to switch at high speeds.
    Now you can increase the "Check Trees Per Frame", but it creates a heavy load on the processor.
     
  6. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    509
    Hey thanks for the file, I'll try to test it out over the next few days.

    I did a test with the following scene, which I had created earlier. I imported AltTrees and then converted all the trees. However, when I ran the game in play mode the scene took about 10-15 minutes to initiate the trees, then Unity crashed while initiating the banana tree. What settings do you recommend for the scene in the video below? Note, this video was without Alt Trees, but the scene I used to test AltTrees in.



    On a second note, every tree I convert from Baldinoboy's Tropical Forest pack, and every plant from Yughes Bushes and Weeds pack pops up with a dialog saying that the normal maps must be fixed. Is this expected, or have I set it up incorrectly? I didn't see this message in your tutorial videos appear.

    By the way, I really like the automatic conversion and the step-through installation process. I think that's been really well done.
     
  7. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    509
    Good news, I just tested that new file on some low poly trees on my Android, and it works fine. In the video the billboards are set to 1024, and I was getting about FPS 25 on my Moto G3, but when I reduced to 512 I was getting FPS30. Here is the video.



    EDIT: Just tested it without Alt Trees and got better performance. So I don't think it is effective with low poly trees, but imagine there would be an improve with mid-poly trees such as Speedtree for mobile. I've got some mid-poly African trees I can test out with later.

    Update, just tried the new file on the scene above, abeit with far fewer trees but the lag still appears at runtime. Strange because in the editor the trees are populated almost immediately.
     
    Last edited: Jan 9, 2017
  8. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    How many trees on the scene?
    There are errors in the log?

    This Unity window. It comes, if your texture is not marked as a normal map. This is normal. Click on button fix.
    I'm working on optimization.
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    3,831
    better not, as they might use combined textures... at least baldinoboy does.
     
  10. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    509
    That's good to know, sure Yughes do as well, can't imagine he'd forget to mark them as normal map. In fact I can't imagine any tree from the store would not have normals marked as so.
     
  11. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I thought you might say that :) I'll leave it as is for now, and eagerly await the multi-threading!
     
  12. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    495
    Is there any suggestions for what to do with baldinboys trees if pressing fix is not advisable?

    Im also having issues with the random colour of the trees. I presumed unclicking random leaves/bark colour would turn it off but maybe they all need reimporting. What i would ideally like is slight ramdom colours (shades of green only) but without documentation it's tricky.

    If anyone has worked out settings for aspects of the pack I think here would be great place to list while diab gets around to documentation. In fact it might even help him as I understand english is not his primary language.

    I would appreciate any tips and tricks in any case. :).
     
  13. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,136
    Hey @AndyNeoman,

    Are the leaves not being shaded correctly? Are all the leaf/branch normalspec textures showing this error?
     
    AndyNeoman likes this.
  14. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    495

    Some bushes are black in parts of the leaves. Also i am getting too much colour variation on my trees. Lots of autumn reds/yellows but my game is set in tropics so needs to be only green shades.
     
  15. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,136
    That is strange. I do not know why AltTrees would cause that. Check the combined normals and make sure the import looks like this:

    [​IMG]

    Did a import test of TFP 1.01 into 5.5.0 and, besides some broken image effects, it looks fine. @Diab1O , does AltTrees change the shaders or normals of non-standard shaders? Not sure what else to do.
     
    AndyNeoman likes this.
  16. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    AltTrees uses custom shaders. If your trees using custom shaders, it will be necessary to make modifications to the shaders to work with AltTrees.

    After importing trees from Terrain, or planting a brush?
     
    Baldinoboy likes this.
  17. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,136
    Oh alright so Tropical Forest Pack is not compatible with AltTrees at the moment. Unfortunately I am not a programmer so can not say when and if it will be
     
  18. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    If you want, you can send me one tree with shaders, and I'll try to make support AltTrees.
     
    AndyNeoman and Baldinoboy like this.
  19. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,136
    Thanks! Sending a PM.
     
    AndyNeoman and Diab1O like this.
  20. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    495

    That's great news guys I am relying heavily on both your assets for the PC version of my game. I actually thought TFP used normal unity tree shaders. My mistake.

    The colour issues affects imports from terrain for sure, will try the painted trees later.
     
  21. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    59
    Hi

    I'm trying to use AltTrees on a rather big terrain generated by TerrainComposer2

    Currently it takes a lot of time (more than 40 minutes) to convert trees from Terrain to AltTrees which makes them unusable in production pipeline

    Am I doing something wrong?

    Maybe author will come up with solution for TerrainComposer2 which will allow to generate trees directly to AltTrees instead of generating them for Terrain and then converting to AltTrees

    Thanks!
     
    Last edited: Jan 19, 2017
  22. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hi!
    Currently TerrainComposer2 can not be combined with AltTrees, but in the future, I'm sure, this will be possible.
    Either the author TerrainComposer2 make AltTrees support, or I make wrapper for TerrainComposer2.
     
  23. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    59
    Thanks for quick reply

    May I contact you through email?
     
  24. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
  25. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    115
    Any plans to implement billboard shadows? This is something that SpeedTree has, and it makes a really big difference.
     
  26. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hello!
    Billboards have already cast shadows.
     
  27. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    115
    Hm, really? I've never have had billboard shadows since I started with AltTrees, so I didn't know it supported them. I have verified that they are in my shadow draw distance, but still get nothing.

    Here's a test screen to show the issue:

    alttree-shadows.jpg
     
  28. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    In AltTrees there are two types of billboards. First - Near single billboards. Second - far group billboards.
    The first type has a shadow. The second type - has no shadow.

    21-01-2017 16-53-45.png

    21-01-2017 16-57-14.png
     
  29. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    115
    I gotcha. Are there any plans to add an options for shadows to the Group Billboards? That is one big area, IMO, where all other tree systems including Unity trees fall short compared to SpeedTrees.
     
  30. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Ok, I'll do it
     
    jason-fisher and jdraper3 like this.
  31. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    131
    Hi!!
    When will the new update be out ?
     
  32. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hi!
    Before the end of January.
     
  33. Frednaar

    Frednaar

    Joined:
    Apr 18, 2010
    Posts:
    144
    Will you implement horizontal (ie top down) billboard before release ?
    a nice option would be also to create 3 axis billboards without rotation as LushLodtree does, should not take that much overhead as it is basically 3 quads but probably saves some calculations.

    result is very nice...check video here...
     
  34. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hello!
    Yes, I will do it. But not in this update.
     
    jason-fisher likes this.
  35. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    307
    Hello,

    I'm using the VR arc teleporter https://www.assetstore.unity3d.com/en/#!/content/61561 to get around my scene in VR but billboards dont respond when I teleport around my scene. With this plugin you use the VR controller to click to spots to move around. What does the ALtTree system look for in the player or the camera to be able to work with the system? Like is there a certain Tag or Layer the camera or player has to be set to.
     
  36. MikeyUchiha

    MikeyUchiha

    Joined:
    Jan 8, 2011
    Posts:
    107
    Hi, I ran into a bug. When importing the terrain everything works fine. There were 36 prototypes that I had to convert from the terrain. However, in AltTree I only was able to export 3 of the prototypes. Meaning, I lost all of the prototypes that I had added manually to the terrain. This is a huge problem as now I have to re-add over 30 trees back into Unity Terrain Trees because AltTree didn't keep them. Just because I only have 3 prototypes currently on the terrain doesn't mean that I don't want to keep all of the prototypes that I had added into the Unity Terrain Trees
     
  37. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hello!
    Soon I will send you a PM with a fix for the test.
    Hello!
    Sorry, I'll fix it.
     
  38. Mrkubaisi

    Mrkubaisi

    Joined:
    Apr 14, 2016
    Posts:
    14
    Hello
    i am testing this asset but what i want is to instantiate the trees before the scene show because the main camera is spawned in a middle of the terrain showing trees pops is anot a good things ,it takes me more than 20 seconds to see the first tree (iphone 5) , if this is not applicable , i might ask for a refund if that is applicable
     
  39. Pecek

    Pecek

    Joined:
    May 27, 2013
    Posts:
    74
    Just purchased this half an hour ago, really like the performance so far(finally I can populate the horizon with trees, I was looking for a solution like this for the past 2 years) but I'm a bit confused about something. Do I have to place the trees via the AltTrees script? To my understanding the "import trees from terrain" option will also convert the trees, instead of just reading the data(I already changed the trees to the converted ones so this is pretty much unnecessary - and I don't want to use the placing tool at all, I already have a nice way to generate the trees)

    Btw there is a typo on the interface, Debug Settings -> Draw debug putches

    Edit: as expected it was a user error, figured it out eventually. However I have another question, do I always have to place the trees on a terrain if I don't want to paint them manually via the AltTrees tool? I have a huge mountain mesh, I would like to populate it with GeNa, is there an easy way to convert those to AltTrees as well? Or will be in the future?
     
    Last edited: Jan 24, 2017
    Nateply likes this.
  40. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hello!
    The next update this process will be faster.

    Hello!
    Thank you!
    At the moment, it is possible through import. First place in the GeNa, and then import it into AltTrees.
     
    Last edited: Jan 24, 2017
  41. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    85
    If you have imported a tree incorrectly into AltTrees how do you delete it, have several I've imported incorrectly but can't work out how I get rid of them?
     
  42. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    85
    OK, think I worked it out, deleted them from the plugins directory under the database folder .... hope this is the right way to do it.
     
  43. MonkeyPuzzle

    MonkeyPuzzle

    Joined:
    Jan 17, 2016
    Posts:
    37
    Really impressive! I woudl love to see some different rendering styles. The colors are pretty bright for realism, and woudl love to see some more cartoony low poy stuff. But the sheer number of trees you are demonstrating is amazing.
     
  44. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hey, right!
    Thanks, I'll think about it!
     
  45. simonjewell

    simonjewell

    Joined:
    May 19, 2016
    Posts:
    24
    I feel your pain - my 200,000 trees took well over 2 hours to import from my terrain. So I had a look at the Import() method in AltTrees_Editor.cs, and there are a few optimizations to be made there. My last import took 17 minutes, so it was approx. 7-8 times faster. All I did was this:

    In the loop at or around line 1627 (starts with "for (int j = 0; j < treeCounts; j++)"), add these lines at the start of the loop:
    Code (csharp):
    1.  
    2.   var tree = terrainData.treeInstances[j];
    3.   var prototype = prototypesTemp[tree.prototypeIndex];
    4.  
    Then just replace all instances of "terrainData.treeInstances[j]" with "tree", and "prototypesTemp[tree.prototypeIndex]" with "prototype". I can't believe that all those array accesses made it so slow! Let me know how you get on.

    @Diab1O - Maybe you could sneak this optimization into the next release?
     
    John-G, Pecek and AndyNeoman like this.
  46. Pecek

    Pecek

    Joined:
    May 27, 2013
    Posts:
    74
    I think there is a bug in the wind converter as well, if there is an uncoverted tree it can't get past 99%(I let it work for over 30 minutes but it was still at 99%). If this is the case(I didn't investigated it any further but as soon as I hardcoded the names to the ones I actually converted it worked) I believe it would be best if the wind generator would only look for converted trees as there might be cases where we don't want to use AltTrees, and maybe a nice feature would be to be able to convert every tree(in the whole project) with a single button(or better yet list the trees and let us mark the trees we want to use - I realize that there are much bigger problems yet of course, I'm just trying to come up with workflow improvements as that part is at least as important as the functionality itself, hope you don't mind).

    Feels like this was my best investment since RTP as far as terrain stuff goes, in a few months it might be something absolutely epic. Btw do you have a public roadmap for AltTrees?
     
  47. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Excellent thank you! I'll look into it and included in the next update.
    Hello! I'll look for the error. The number of trees has no effect on time converting wind. 1 and 10 trees should be converted the same amount of time.
    Thank you, I will soon publish a roadmap.
     
  48. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
  49. adndima

    adndima

    Joined:
    Jun 11, 2015
    Posts:
    27
    This happens when I convert wind

    [​IMG]
     
  50. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    317
    Hello!
    I sent a PM with fixed file. Try it please.