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

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hey,
    First, try to install your camera in the settings. Look at Camera mode.
    Second, check the wind on the tree. The tree can disappear if there is an incorrect wind setting on the tree. Try to turn off the wind on the tree. Set Wind Mode to None.
     
    crudeMe likes this.
  2. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I noticed a typo in .9.7.1 - on the AltTrees inspector Panel, Settings tab, the render type shows as BPR when it should be PBR.
     
  3. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Hello. It looks like a great asset. May I ask a question? I want to do 2 things, first I want to change a type of a tree to completely another tree, the reason I want to do this is to simulate seasons, I mean I want to replace a green tree with a orange tree if the in-game season is fall. Second, I want to change the leaf color of a tree according to the in-game season. Is it possible with your asset? I'd be glad if you answer, thanks.

    Oh and two more things. Is this asset ready for a production game? What features it still doesn't have but the Unity's system has? Thanks in advance.
     
  4. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Wow, thank you!:oops:

    Hello! I plan to do this in future versions.
    All functions of Unity trees have already been implemented. The only drawback is that at the moment there is no integration with popular assets for planting vegetation(TerrainComposer, Gaia, GeNa...). But, you can make a planting in these assets, and then move to AltTrees.
     
    imDanOush likes this.
  5. Quen

    Quen

    Joined:
    Apr 6, 2010
    Posts:
    21
    That worked for me. I was still using version 0.9.6.1, so I had to update your asset. I found two minor things:
    1. When I save the scene, close unity and open it again, the AltTrees script did not save my camera settings, it is back on automatic.
    2. When I look "against the sun", the leafs of my trees look really strange (white):
    white.JPG
    When I look at the same tree from the oposide direction, it looks normal:
    normal.JPG
    Looking against the sun was not a problem in 0.9.6.1, maybe you changed something in the shaders? I did not change anything in my project but updating AltTrees. Here is who it looked with 0.9.6.1:
    v0.9.6.1.JPG

    Oh and: I am using SpeedTrees.
    Thanks in advance :)
     
  6. BonsaTech

    BonsaTech

    Joined:
    Dec 22, 2015
    Posts:
    73
    I´ve been trying to use your plugin in my game, but I´m not able to adjust the tree´s color at far distances. These billboards are always black and I baked previously the light in my scene.

    Is it possible to fix this issue?

    Cheers
     

    Attached Files:

  7. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Sorry if it has been asked before, but how would you go on about with tree colliders on the server? I would like to have my tree colliders as actual colliders, accessible in the scene, and not attached to the alternate tree system.
     
  8. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    So will it conflict with InifiGRASS? Will it cause problem with it? According to your videos, this asset is really great.

    And I didn't get the answer of my previous question, so I ask you that in another form: Can I change a tree in runtime with another tree? How about changing shader parameters in runtime? Thanks in advance for answering.
     
  9. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Try set "Render Type" to "Legacy"
    Hi,
    Does this problem only appear with baked light? At the moment, AltTrees does not support the baked light.
    This is impossible. But, soon I will be able to add custom scripts to the tree colliders. It would be enough?
    I have not tried this asset. What is it? System of grass? I do not think that there will be a conflict with him.
    At the moment, it's impossible. But this is in my plans.
     
    imDanOush likes this.
  10. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
  11. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    Hello.

    This asset has potential!

    Having issue getting it to work.

    I have a speedtree I converted and it shows as placeable but when I go to place it I get this error:

    MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Camera.get_projectionMatrix () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineCameraBindings.gen.cs:295)
    AltSystems.AltTrees.AltTreesManager.DrawMeshes () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:302)
    AltSystems.AltTrees.AltTrees.Update () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTrees.cs:92)


    The main camera is in the scene for sure and I have dragged it to the AltTree setting but I still get this error.

    Running Unity 5.4.0f3
     
  12. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    I deleted the AltTree in Scene and created another and it worked
     
  13. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Alright, so I tried out the system and the usage is pretty nice. The only problem I have, is that it does not render billboards all the time. I made a 250m*250m test scene and billboards only get rendered when I zoom out quite far. Changing the lod level does not change. Basically, I see 3d mesh trees, then the trees disappear, and I see nothing rendered for a while and then the billboards pop up. So something is wrong. I have changed the cell size, which resulted in this not happening, but then billboards get rendered waaay to early... Do you have any idea what exactly? For the colliders, I have figured out a system to make it work on the server (I just make a copy of the colliders... :p) so no worries there, thank you for the quick response.
     
  14. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thank you, I will look for the problem.
    Do you use version 0.9.7.1? Can you show a screenshot of the settings?
     
  15. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi Diab, Im getting the error below in unity 5.6 beta. Is there a simple fix or any idea when you will make it work with 5.6?

    Thanks, Andy

    InvalidOperationException: Material needs to enable instancing for use with DrawMeshInstanced.
    UnityEngine.Graphics.DrawMeshInstancedImpl (UnityEngine.Mesh mesh, Int32 submeshIndex, UnityEngine.Material material, UnityEngine.Matrix4x4[] matrices, Int32 count, UnityEngine.MaterialPropertyBlock properties, ShadowCastingMode castShadows, Boolean receiveShadows, Int32 layer, UnityEngine.Camera camera) (at
     
  16. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi, I'll look into the problem and let you know.
     
  17. abatcat

    abatcat

    Joined:
    Feb 8, 2015
    Posts:
    70
  18. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    if I use Unity's Tree system (with speed tree) right now, would it be easy to upgrade it to AltTrees later? I don't want to re-add 20+ types of trees on 610 terrains.
     
  19. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I think that this is impossible.
    At the moment, you can do only 1 terrain for 1 time. In the next updates, I will add the ability to import from several terraines at once. Also at the moment there are problems with the colors of trees during import.
    I advise before importing trees make backup the project.
     
  20. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    So, Does it mean I can "transfer" the tree data and their position from Unity Terrain to this asset without problem once those updates have released? I mean, I haven't added a tree to a terrain yet, but I'm going to do so soon (adding dozens of trees to 651 terrains according to their real position from Google Map, I want my in-game city be as realistic as possible). However I'm not sure if I add all the trees then I should redo adding them once I get AltTrees (and I want to get the asset when it supports Tree and color changing).
     
    Last edited: Mar 21, 2017
  21. masa045

    masa045

    Joined:
    Nov 22, 2016
    Posts:
    35
    Hi Diab1O
    I'm consider buy altTrees system for now.:rolleyes:
    I' already to use unature and altTrees system not interfere to unature ?
    thanks.
     
  22. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Yes, it's true.
    Hey, I do not have a unature. I think that there will be no problems.
     
    masa045 and imDanOush like this.
  23. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Unature and Altrees work fine together (make sure you don't use trees in uNature).

    Any update on the 5.6 Fix Diab?

    I think they have changed the instance call slightly so should not be to much of a fix. No other issues are being reported.
     
    masa045 and John-G like this.
  24. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I have reimported o 5.6 and now this is the only error i am getting. I will try to fix and post any updates but if you find a solution please let me know.

    Thanks, Andy

    NullReferenceException: Object reference not set to an instance of an object
    AltSystems.AltTrees.AltTreesManager.DrawMeshes () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:302)
    AltSystems.AltTrees.AltTrees.Update () (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTrees.cs:92)
     
  25. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    In version 5.6 added a checkbox "Enable Instancing". Mark it on all materials that use instancing (group materials do not mark!).
    I do not know why it was added, because before it worked well without it. In future updates, I will check this checkbox automatically.
    Screenshot: http://joxi.ru/WL21Jg4HKNzGAX
     
    AndyNeoman likes this.
  26. masa045

    masa045

    Joined:
    Nov 22, 2016
    Posts:
    35
    Hi there
    thanks for quick response Diab1o and andyneoman
    I'm really appreciate :D
    I'll try this asset soon
     
  27. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    Hooray, the virtual world I'm working on has finally whitelisted alttrees so I can use it to build scenes for people to explore.

    I am noticing in version .9.7.1 (with Unity 5.5.2p2) that if I am painting/placing a tree and then use the viewport shortcuts (option + click & drag, ⌘+option drag, etc) to move the editor view, AltTrees treats it as if I am clicking and holding the mouse button in that spot on the ground, and places LOTs of trees. This is kind of a pain to have to undo, the only way I can change the view without painting trees is to select some other object in the hierarchy first, then change my view, and then go back to AltTree. Can this be fixed or changed so that using the viewport shortcuts prevents placement of trees?
     
    jangomoose likes this.
  28. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I am also discovering that at in the Alt Wind script, there are settings for Speed Wind, Gust Wind, and Height Factor that allow you to change the curve. However in 0.9.7.1 in Unity 5.5.2p2, changes are not saved. Wind also seems to stutter after several seconds, but this may be related to not being able to change the curve (the default is a ramp).
     
    Last edited: Mar 28, 2017
  29. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hey, I did not understand. Can you show the video, or describe in more detail?
    Ok, thanks, I will study the problem
     
  30. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    trilobyteme said:

    I am noticing in version .9.7.1 (with Unity 5.5.2p2) that if I am painting/placing a tree and then use the viewport shortcuts (option + click & drag, ⌘+option drag, etc) to move the editor view, AltTrees treats it as if I am clicking and holding the mouse button in that spot on the ground, and places LOTs of trees. This is kind of a pain to have to undo, the only way I can change the view without painting trees is to select some other object in the hierarchy first, then change my view, and then go back to AltTree. Can this be fixed or changed so that using the viewport shortcuts prevents placement of trees?


    Hey, I did not understand. Can you show the video, or describe in more detail?

    Just to concur with trilobytemeis when using the Alt Key and Left Mouse Button to rotate the scene view the Left Mouse Button to Place Trees remains active and thus places multiple trees as you rotate the view .I do the same and select another object when rotating the scene view but would be quicker not having to.
     
    Last edited: Mar 28, 2017
  31. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I understood. I will disable the planting of trees with the Alt key pressed. Are there any other keys that need to be disabled?
     
  32. kilju

    kilju

    Joined:
    Nov 4, 2013
    Posts:
    127
  33. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    No, AltTrees has its own shaders, and can not work with others (if they are not adapted for AltTrees)
     
  34. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi Diab, thanks for the fix 5.6 is fine once all materials (inc billboards) are enable for instancing.

    Do you have any updates on what's coming next and when for Alttrees. I love the system and it is a nice improvement over normal unity trees but I would like to see a bit more. Transition improvements and performance all around would be my two most important requests. I've got around 8000 trees in my scene from around ten prefabs and I would hope for a bit better FPS in the near future.

    Great work though and I look forwards to your updates. :)
     
  35. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    I am now finishing work on multithreading and object optimization. This will increase performance if your weak point is the CPU.
    I plan to add an API and release an update.
     
    Bartolomeus755 and AndyNeoman like this.
  36. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi Diab,

    The fix for 5.6 only partially works. Alttrees works fine in editor but when you build (windows) the game crashes. Not sure why but if I remove Alttrees game runs. Has anybody got Altrees working on 5.6?
     
  37. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Are there errors / warnings in the log?
     
    AndyNeoman likes this.
  38. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Hi!!
    I got many errors in unity5.6.0f3 !!
    AlttreeErrors.jpg
     
  39. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    In 5.6 you need to enable instancing on all materials used. Even if the shader has the 5.5 instancing code.
    Select the material and enable the instancing checkbox.
     
    zmaxz likes this.
  40. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    No errors in the console but there is a lot coded in the crash report.
     
  41. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi, Have you managed to build your project and not get crashes on 5.6? I have fixed the instancing errors and the game builds but crashes after a few seconds of gameplay.
     
  42. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    In version 5.6 added a checkbox "Enable Instancing". Mark it on all materials that use instancing (group materials do not mark!).
    In future updates, I will check this checkbox automatically.
    Screenshot: http://joxi.ru/WL21Jg4HKNzGAX
    I do not have crash after the build. I will try to repeat this failure.
     
  43. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    There's something wrong when using point lights with shadows: AltTrees are not lit. Spotlights are fine.
    v0.9.7.1 & U3D 5.5.2f1
     
  44. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Can you send me a screenshot of the problem?
     
  45. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
  46. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thank you, I see the problem. It is visible only in the deferred lighting. I will look for the cause.
     
    Soul-Challenger likes this.
  47. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hi,
    Open the file "Assets\Plugins\AltSystems\AltTrees\Shaders\SpeedTreeAltTree.shader" and in the lines 41, 148, 246 at the end add " addshadow".
    It should look something like this:
    Code (CSharp):
    1. #pragma surface surf StandardSpecular vertex:SpeedTreeVert nolightmap addshadow
     
  48. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    That fixed it. Thank you :)
     
  49. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I skimmed the forums and looked through the documentation but don't see any functions for adding/removing trees at runtime. We are looking to add a script to each tree for harvesting/planting them and could use a point in the right direction.
     
  50. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    62
    I'm constantly getting this errors in Play mode:

    Code (csharp):
    1.  
    2. Submesh index in intermediate renderer is out of bounds
    3. UnityEngine.Graphics:DrawMesh(Mesh, Matrix4x4, Material, Int32, Camera, Int32, MaterialPropertyBlock, Boolean)
    4. AltSystems.AltTrees.AltTreesManager:DrawMeshes() (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:552)
    5. AltSystems.AltTrees.AltTreesManager:LateUpdate() (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:279)
    6.  
    and

    Code (csharp):
    1.  
    2. Submesh index in intermediate renderer is out of bounds
    3. UnityEngine.Graphics:DrawMesh(Mesh, Matrix4x4, Material, Int32, Camera, Int32, MaterialPropertyBlock, Boolean)
    4. AltSystems.AltTrees.AltTreesManager:DrawMeshes() (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:544)
    5. AltSystems.AltTrees.AltTreesManager:LateUpdate() (at Assets/Plugins/AltSystems/AltTrees/Scripts/AltTreesManager.cs:279)
    6.  
    What I'm doing wrong?