Search Unity

Assets AltTrees System [WIP] [AssetStore]

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

  1. clamchoda

    clamchoda

    Joined:
    Jan 21, 2017
    Posts:
    11
    I was having problem with dark mesh in 5.6.0f3. For anyone else having the same issue, you may have auto-generate disabled in your project for light mapping.

    So even if you are not light mapping, and even if you have 0 static objects in the scene, you still need to let it generate a 0kb "non-existing" lightmap. Sneaky new Unity features :p

     
    Diab1O likes this.
  2. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Who has problems with the hue after importing trees from the terrain - I can send shaders with a disabled hue. Or you can wait for the next update - it will be able to change the hue for all trees or turn it off.
     
  3. The_Uber_Rasta

    The_Uber_Rasta

    Joined:
    Feb 25, 2014
    Posts:
    8
    is there any chance of getting a plant touch bending effect with altTrees vegetation in future? That would be really awesome.
     
  4. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Yes, I plan to do it in the future.
     
    The_Uber_Rasta likes this.
  5. clamchoda

    clamchoda

    Joined:
    Jan 21, 2017
    Posts:
    11
    Hello does Alt trees support baked lights on billboards now? I can't seem to get them lit with light probes in 5.6. The mesh will take the light from the probe, but not the billboard
     
  6. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    No, at the moment it can not be done. In future versions I will try to fix this.
     
  7. clamchoda

    clamchoda

    Joined:
    Jan 21, 2017
    Posts:
    11
    Ok thanks for the reply. Is there any work around at the moment to get by in the meantime?

    Getting some great performance out of AltTrees, but having to use real time lighting is eating it up :/
     
  8. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    This is difficult and will take a lot of time. At the moment, there are more important things that I need to do.
    As soon as I get to this - I'll start to do it.
     
    clamchoda likes this.
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    What does Density Objects setting do? I tried using this in both editor mode and runtime and nothing happens differently even when the value is set to 0. I thought this would reduce the rendered density of trees, but it doesn't appear to affect anything.
     
  10. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    This option only affects Objects. Reduces the density of Objects.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    What do you mean by objects? I thought AltTrees only handled trees.
     
  12. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Objects - does not have far billboards. Objects are needed for small items - grass, stones, etc.
    See the "Is Object" checkbox
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I see. Thanks.

    Also, is there a way to cull far trees beyond a certain range instead of always having billboards at all distances?
     
  14. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    At the moment, you can not. But I plan to do this in future updates
     
    magique likes this.
  15. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    0.9.8.1 went live on the store. Looks like some great fixes/enhancements. I look forward to giving it a try.
     
    Diab1O and The_Uber_Rasta like this.
  16. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Update 0.9.8.1 is available on AssetStore!

    Changes:

    - extended the functionality of the "Patches" section
    - added "Shaders Configurator" in the menu "Window/AltSystems/AltTrees/Shaders Configurator"
    - processes of import and export of terrain are accelerated
    - improved crossfade billboards
    - fixed normals on the billboard
    - added the option of automatic tree conversion when importing from the terrain
    - fixed the bug of removing trees via Ctrl
    - "Ambient Intensity" parameter is corrected in the Billboard Generation Settings
    - in the API added function "getAllTrees"
    - the "Generate All Billboards on Start" option is removed
    - API function "editTree" replaced with "editTrees"
    - removed the change Hue when importing and exporting terrain.
    - fixed the bug of generating tree icons when using a large number of trees
    - accelerated the process of generating a billboard
    - optimized and accelerated the process of converting a tree
    - added options to the API "maxLODTreesAndObjects" and "useBillboardsWhenMaxLODTreesAndObjects" - You can turn off high polygonal LODs if the computer is weak.
    - added the option "Depending on Camera Speed"- the speed of checking the distance and the crossfade speed
    - added menu for converting several trees at once
    - fixed a bug with colliders when using "Density Objects"
    - "Stable Editor Mode" option added. Try to disable it if your editor lags
    - fixed tree conversion
    - fixed AO (and other image-effects) in forward mode
    - fixed shadows
    - optimizations...
    - bug fixes...

    I will update the documentation soon.

    If you find a bug, please write to me!
     
  17. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    There is a bug in the new version at the end of the checkTreeOrObject function in AltTreesPatch.cs. You are accessing the AssetDatabase, which is only available in editor mode so when you build for stand-alone it fails. I just added it into the #if UNITY_EDITOR code right above it and got working again, but you should fix for next version.
     
  18. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Thank you! I will now send a fix to AssetStore
     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Unfortunately, I'm also see some crazy popping and disappearing trees issue. After upgrading my project it doesn't work correctly. The biggest issue is that I see trees disappearing and reappearing as I approach them. And then occasional random popping between LODs. I'm not sure what could be wrong. The only thing I did other than run the Upgrade Trees function was to recompile the shaders with no Hue feature.
     
  20. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    There is such a problem. It is only in the Editor mode. I will fix this in the next updates.
    Is there no problem in the game mode?
     
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Yes, I see this in game mode and stand-alone build.
     
  22. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Version 0.9.8.1 still causes the Unity Editor application to crash on Mac. Downloading and installation of the asset works normally/as expected, but when Creating the AltTrees component from the Window menu, the application freezes for a moment and then crashes completely, just as 0.9.8 did. I tested in Unity 5.6.1p4 today, but have experienced this crash in all variations of Unity 5.6.x. When I get a chance, I'll try and set up a Unity 2017.1 test installation.
     
  23. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Can you make a video?
     
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'll do that as soon as possible, but can't right at the moment.
     
  25. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    This is interesting.... AltTrees 0.9.8.1 does appear to work on Unity 2017.1 b10. I can create the component and convert trees without any kind of crash. However the Generate Speedtree Wind parameters project does not work. I recall that there were some tricks needed to get that to work properly on Mac in the past, when I get some time between projects I'll try digging through the scrollback to find the code tweaks you'd given me.
     
  26. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Excellent! Probably in the Unity was a bug on Mac, and they fixed it
    In occasion of a wind - I corrected this bug. Perhaps there is another problem. Do you have any errors in the console? Can you describe what does not work?
     
  27. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    There aren't any console errors, but when I open the Generate Speedtree WindParams project and hit play, this is what I get...

    Screen Shot 2017-06-20 at 8.14.59 AM.png

    When inspecting that scene, I noticed that the GenerateSpeedTreeWindParams gameobject has a script component that looks like it wants you to specify a wind zone, and there is none in the scene. I added one to the scene, and then dragged it into the empty field, then ran it again, but still got the blanked out Play screen.
    Screen Shot 2017-06-20 at 8.18.43 AM.png
     
  28. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    Most likely a problem with standard fonts. Maybe this will be fixed in the release.
    This is an obsolete field. It is not necessary.
    I will send you a PM file, please check.
     
  29. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    That file seemed to fix it. Trees now work and have wind (in 2017.1b10), but I'm noticing that as I move around in the editor trees seem to sporadically disappear and reappear. It's not distance-based, since I sometimes find trees closest to the camera appearing or disappearing out of thin air. That, and after moving position then sitting for a moment, I've noticed large groups of trees appearing/disappearing. I had thought that at worst, the trees would go billboard and not completely disappear.
     
  30. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    This is exact same thing I reported earlier.
     
  31. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    This is a bug in the Editor. In the play mode, this should not be. I plan to fix this in the next versions
     
  32. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,204
    Will this speed up billboard grass rendering? I'd like to use dense fields of grass and Unity's system is quite slow.

    Thanks.
     
  33. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Sorry for late answer!
    I do not think that the grass will be faster than terrain grass. If you compare SpeedTree grass, then my system will be faster.
     
    Dwight_Everhart likes this.
  34. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    I have a problem when I load a scene with AltTree a second time. I mean the first time it works, the second time I load it, AltTree does not display any trees.

    This happens ONLY in a build. In editor everything is fine.

    To test the problem just add this to the Update() function in Alttree.cs

    Code (csharp):
    1.  
    2.                 if (Input.GetKeyDown("space")) {
    3.                   ReInit(true);
    4.                 }
    5.  
    If you press space in Editor, it will reinit Alttree correctly. But in a build, it will do nothing.
     
  35. jimburn

    jimburn

    Joined:
    Apr 1, 2017
    Posts:
    64
    Ok I think I have solved the problem I added this and it is working now. It may help someone else with the same problem.

    Code (csharp):
    1.  
    2.         void OnLevelWasLoaded(int level)
    3.         {
    4.             // in comment is the author's code for reference
    5.             //Log("OnLevelWasLoaded " + this.name);
    6.            // if (altTreesManager != null)
    7.            //     altTreesManager.destroy(true);
    8.            // isInitReady = false;
    9.            ReInit(true);
    10.         }
    11.  
     
  36. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello,
    Thanks, I'll look into this problem.
     
    jimburn likes this.
  37. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    This looks great @Diab1O -- are the wind features already in?

    Is it fair to say there are performance benefits to be had, even in scenes that don't have a lot of trees and vegetation, i.e. <= 1000 items?

    // WildStyle
     
  38. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Sorry for late answer!
    The wind is ready for SpeedTrees and TreeCreator trees.
    Performance depends on the scene, I can not say without seeing the scene.
    Performance will improve only for SpeedTrees and Meshes.
     
    WildStyle69 likes this.
  39. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Thanks for reply, sounds good.

    So today I purchased your asset and have been setting things up. I converted my existing terrain trees and have been testing my scene with terrain meshes and Alt Trees vs. standard Unity terrain and trees. At the moment am noticing less performance with Alt Trees, perhaps I'm doing something wrong?

    EDIT: so disabling Alt Trees and re-enabling the trees on the Unity terrain results in faster performance, in the editor. Unity 5.6.2p1 (64-bit).
     
    Last edited: Jul 1, 2017
  40. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Thank you for your purchase!
    Which trees do you use?
    TreeCreator is initially very fast. Performance will be better only with SpeedTree and Meshes.
     
    WildStyle69 likes this.
  41. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    I'm using only SpeedTree and there are not even many in the scene, like 200.
     
  42. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    OK - looks like I didn't have GPU instancing enabled for the Alt Trees. I'll do some more testing and let you know the outcome.
     
  43. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    The performance increase will be noticeable with a large number of billboards. Show me please profiler.
     
  44. Pecek

    Pecek

    Joined:
    May 27, 2013
    Posts:
    187
    200 shouldn't be a problem with the built in solution either, if it's slow it's not because of the inefficient billboarding.
     
    WildStyle69 likes this.
  45. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Not that it's slow currently... I'm just thinking forward as the game and levels will grow in size, so am trying to optimize things to get every last FPS possible for VR.
     
  46. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    Just wanted to show off a first test of my VR project with altTrees and @Baldinoboy 's Tropical Forest pack:


    The Terrain is 2kmx2km, streamed in 256x256 chunks. There are 177046 trees total, most of that ground cover plants. I hope I can get a little more fps by playing with terrain chunk size. Maybe if distant billboards would be culled that would bring the needed boost too.
     
  47. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Looks good!
    What are the values in the "Size Patch" and "Max LOD Patch" settings?
     
  48. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    It's auto-configured. The greyed out values are 1000 for Size Patch, 4 for Max LOD Patch. Distance Patch factor is the only value I can change that's on default 1.5
     
  49. judah4

    judah4

    Joined:
    Feb 6, 2011
    Posts:
    256
    Quick question, does this support systems like World Streamer? I load my terrain by async loading scenes so I want to make sure I can still place my trees on the terrain and they load up properly in the main scene.
     
  50. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    No, streaming is not available.