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
  2. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks for vids.

    Can't wait tot get my hands on it now. Answered all my usage questions with one little extra :)

    Is it possible to just have colliders on LOD0 tree's/objects without having them on LOD1/LOD2/Billboards etc?
     
    Last edited: Dec 2, 2016
  3. Amy_Lee87

    Amy_Lee87

    Joined:
    Sep 29, 2016
    Posts:
    8
    This is too good to be true.

    Can't wait!
     
    Diab1O likes this.
  4. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    You can not do colliders only on billboards.
     
  5. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Thanks. plenty of options to tweak that to suit my needs.
     
  6. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    do you think it will be possible to add exact same wind effect on speed tree as original in the future?
     
    Hikiko66 and jdraper3 like this.
  7. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello! I do not know. I will try.
     
  8. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    The tutorials are very clear. Thanks.
    Did they approved your asset? I checked the link from youtube videos and it's not active yet.

    Would it be possible to implement a mass spawning function?
    Something like Megasplat (check at 2:15) is doing or something like Speedtree.
    Thanks.
     
  9. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Is wind not supported?
     
  10. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Not yet.
    Currently I am not yet planned.It may be in the future.

    Wind will be in the next update.
     
  11. abatcat

    abatcat

    Joined:
    Feb 8, 2015
    Posts:
    70
    Will the wind work on any custom mesh or just the speedtree trees?
     
  12. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    At the beginning it will only work on SpeedTree and TreeCreator. Later, I will do wind for custom meshes
     
  13. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Can I use other assets/tools to paint the Alt-Trees on my mesh or terrain? Something like Easy Scatter? Or maybe something like GeNa.
     
  14. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    You can plant trees on Terrain with tools. Then convert Terrain Trees to the AltTrees.
    Later, I will discuss with the developers of popular tools, can be integrated AltTrees with their systems.
     
  15. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Maybe it's possible for you to implement a mass spawning/planting tool using projection maps on meshes. The workflow might be loading a mesh with a black&white texture and plant trees where the white is and avoid spawning on the black areas.
     
  16. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Maybe in the future. Not sure.
     
  17. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Is it possible to save as a prefab a converted Alt-tree asset from a Speedtree tree or a custom mesh? I'm asking because with GeNa you can paint with prefabs.
    Terrain Composer 2 integration would also be a nice thing to have.
     
  18. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    It's not going to work.
     
  19. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    That's unfortunate. I'm asking all these questions to find a way to plant/spawn the trees using some criteria and to speed up the process.
    A few more questions, if you don't mind:
    1. After I placed in my scene. let say 6 different Speedtree trees species in a total of 100.000 trees, would I be able to convert these 100.000 trees (and preserve the size and world position) to Alt-tree and benefit from all the features? I mention I have no scripting/coding skills at all.
    2. Same question as the first one, but for mesh trees or different custom meshes like, boulders, logs, mushrooms, etc.
    3. Watching your tutorial I enjoyed the color variation you can add to your tree/mesh using the color picker. Is it possible to save Alt-tree presets and create 5 presets adding different colors by using just one tree (mesh or Speedtree) and paint them the same time with one brush stroke? Or maybe there is some other method to accomplish that multiple color variation (yellow, orange, dark green, blueish trees).
    4. Is it possible to use images as stamp on your brush and be able this way to plant/spawn very precise trees formations/shapes? If not, would it be possible to implement this?
    Thanks!
     
  20. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Yes. I have shown this in the tutorial.
    Yes, if they are planted as Unity Terrain Trees.
    I plan to do it in future updates.
    OK. I will do it in future updates.
     
  21. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Did they bought your asset?
     
  22. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Asset still on approval. When approved - it will appear here: link
     
  23. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Thanks.
    I asked half joke, half seriously. :)
    Your asset looks very promising. Below you have some screenshots with your last 0.96
    made on my laptop with an AMD 5757M with onboard graphics. I pushed up everything all the way to the maximum and:
    - Fog and AzureSky off = 30 FPS
    - Fog on AzureSky off = 30 FPS
    - Fog and AzureSky on = 21 FPS
    demo Alt-trees-screen1.png Alt-trees-screen2.png Alt-trees-screen3.png
     
  24. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Ok, Thanks!
     
  25. Amy_Lee87

    Amy_Lee87

    Joined:
    Sep 29, 2016
    Posts:
    8
    Have you gotten the "okay" yet from Unity via email? I keep checking for your asset!
     
  26. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello!
    No, there was no answer so far.:( I hope that the answer will come in the next week.
    When I get the answer - I will write in the forum thread.
     
  27. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Hello!

    I received a reply from Unity. They said something to fix. I already corrected and sent them back. Now the answer comes faster..

    But, I have good news. I made the first update and already included it in the Asset.
    The update includes:
    - Wind (SpeedTree, TreeCreator)
    - Improvement of Billboards
    - Fixed bugs

    Soon I will add new videos.
     
    jdraper3, magique, Hikiko66 and 4 others like this.
  28. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
  29. Mark_T

    Mark_T

    Joined:
    Apr 25, 2011
    Posts:
    303
    Purchased!
    Congrats for the release!
    It was a long wait. :)
     
  30. Ronald_McScotland

    Ronald_McScotland

    Joined:
    Jul 30, 2014
    Posts:
    174
    Hi Diab1O, so I've bought the asset, but when I go to install it, it just comes up with a box that says "Check the new version..."
     
  31. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thanks!
    Hello! There are errors in the console?
    Try to restart the installer or restart the Unity.
     
  32. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I was in a hurry to implement update to the release version, and made a lot of bugs in the installer. If you experience difficulties in installing - write me, I'll help.:eek:

    Tutorial 9. Wind settings for SpeedTree:
     
    Hikiko66 likes this.
  33. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Purchased, early Christmas present to myself :)
     
  34. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thank you for your purchase! Merry Christmas!:)
     
  35. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Bought it, will try it out after Christmas.
     
    Diab1O likes this.
  36. Knightmore

    Knightmore

    Joined:
    May 11, 2012
    Posts:
    227
    I really need to find out how to set this up properly.
    After I used "Import Terrain Trees" my batches went up from 4000 to 9800 next to my wheat field.
     
  37. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Can you send me a screenshot of your scene? In a private message, or mail altsystemsunity@gmail.com
     
  38. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Attention!
    If you receive errors when you build the project:
    then, open the AltTrees.cs file (Assets\Plugins\AltSystems\AltTrees\Scripts\AltTrees.cs). Find the line number 1170.
    Replace this:
    Code (CSharp):
    1.             for (int i = 0; i < 9; i++)
    2.             {
    3.                 MeshRenderer mr = goTreeTemp[i].GetComponent<MeshRenderer>();
    4.                 Material[] matsTemp = new Material[mr.sharedMaterials.Length];
    5.  
    6.                 for (int j = 0; j < mr.sharedMaterials.Length; j++)
    7.                 {
    8.                     matsTemp[j] = new Material(mr.sharedMaterials[j]);
    9.                     matsTemp[j].shaderKeywords = mr.sharedMaterials[j].shaderKeywords;
    10.                     matsTemp[j].hideFlags = HideFlags.DontSave;
    11.                     if (mr.sharedMaterials[j].shader.name == "AltTrees/SpeedTree")
    12.                     {
    13.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/SpeedTreeNormalsAltTree.shader", typeof(Shader));
    14.                     }
    15.                     else if (mr.sharedMaterials[j].shader.name == "AltTrees/TreeCreatorLeaves")
    16.                     {
    17.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/TreeCreatorLeavesNormalsAltTree.shader", typeof(Shader));
    18.                     }
    19.                     else if (mr.sharedMaterials[j].shader.name == "AltTrees/TreeCreatorBark")
    20.                     {
    21.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/TreeCreatorBarkNormalsAltTree.shader", typeof(Shader));
    22.                     }
    23.                     else if (mr.sharedMaterials[j].shader.name == "AltTrees/Bark")
    24.                     {
    25.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/BarkNormalsAltTree.shader", typeof(Shader));
    26.                     }
    27.                     else if (mr.sharedMaterials[j].shader.name == "AltTrees/Leaves")
    28.                     {
    29.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/LeavesNormalsAltTree.shader", typeof(Shader));
    30.                     }
    31.                     else if (mr.sharedMaterials[j].shader.name == "AltTrees/Bark Bumped")
    32.                     {
    33.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/BarkBumpNormalsAltTree.shader", typeof(Shader));
    34.                     }
    35.                     else if (mr.sharedMaterials[j].shader.name == "AltTrees/Leaves Bumped")
    36.                     {
    37.                         matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/LeavesBumpNormalsAltTree.shader", typeof(Shader));
    38.                     }
    39.                  
    40.                     matsTemp[j].SetFloat("_BumpScale", normalsScale_Normals);
    41.                 }
    42.  
    43.                 mr.materials = matsTemp;
    44.             }
    on this:
    Code (CSharp):
    1.             #if UNITY_EDITOR
    2.                 for (int i = 0; i < 9; i++)
    3.                 {
    4.                     MeshRenderer mr = goTreeTemp[i].GetComponent<MeshRenderer>();
    5.                     Material[] matsTemp = new Material[mr.sharedMaterials.Length];
    6.  
    7.                     for (int j = 0; j < mr.sharedMaterials.Length; j++)
    8.                     {
    9.                         matsTemp[j] = new Material(mr.sharedMaterials[j]);
    10.                         matsTemp[j].shaderKeywords = mr.sharedMaterials[j].shaderKeywords;
    11.                         matsTemp[j].hideFlags = HideFlags.DontSave;
    12.                         if (mr.sharedMaterials[j].shader.name == "AltTrees/SpeedTree")
    13.                         {
    14.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/SpeedTreeNormalsAltTree.shader", typeof(Shader));
    15.                         }
    16.                         else if (mr.sharedMaterials[j].shader.name == "AltTrees/TreeCreatorLeaves")
    17.                         {
    18.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/TreeCreatorLeavesNormalsAltTree.shader", typeof(Shader));
    19.                         }
    20.                         else if (mr.sharedMaterials[j].shader.name == "AltTrees/TreeCreatorBark")
    21.                         {
    22.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/TreeCreatorBarkNormalsAltTree.shader", typeof(Shader));
    23.                         }
    24.                         else if (mr.sharedMaterials[j].shader.name == "AltTrees/Bark")
    25.                         {
    26.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/BarkNormalsAltTree.shader", typeof(Shader));
    27.                         }
    28.                         else if (mr.sharedMaterials[j].shader.name == "AltTrees/Leaves")
    29.                         {
    30.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/LeavesNormalsAltTree.shader", typeof(Shader));
    31.                         }
    32.                         else if (mr.sharedMaterials[j].shader.name == "AltTrees/Bark Bumped")
    33.                         {
    34.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/BarkBumpNormalsAltTree.shader", typeof(Shader));
    35.                         }
    36.                         else if (mr.sharedMaterials[j].shader.name == "AltTrees/Leaves Bumped")
    37.                         {
    38.                             matsTemp[j].shader = (Shader)AssetDatabase.LoadAssetAtPath("Assets/Plugins/Editor/AltSystems/AltTrees/EditorResources/LeavesBumpNormalsAltTree.shader", typeof(Shader));
    39.                         }
    40.                  
    41.                         matsTemp[j].SetFloat("_BumpScale", normalsScale_Normals);
    42.                     }
    43.  
    44.                     mr.materials = matsTemp;
    45.                 }
    46.             #endif
    Sorry for my error!
     
  39. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks for the fix. I am now able to build the demo for the Wii U and try it out. I'll report my results soon.

    In the meantime, I have a concern over how the system is working. When you first open a scene it's simply blank and it takes some time to populate it with the trees that were placed there. I don't think that's so much a problem, but then the same thing happens when you enter play mode. The scene starts in play mode completely empty and then populates with trees very slowly. If the scene already contained the trees then why do they need to be repopulated when I enter play mode?
     
  40. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Congrats on your release. I grabbed it earlier.

    I'm not sure what your roadmap is but can i ask that the wind implementation for meshes be high on the list.

    Cheers :)
     
  41. Ronald_McScotland

    Ronald_McScotland

    Joined:
    Jul 30, 2014
    Posts:
    174
    No errors. I've tried restarting the installer, Unity, and even the computer with no luck. Looking at the code it would appear that the boolean isCheckUpdates isn't getting set to true, but it should. I'm not sure what's going wrong to cause that problem though.
     
  42. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    How long does the loading, and how many trees on the scene?
    This feature of the system. Soon I will hasten this process.
     
  43. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thank you!
    After 1-1.5 months, not earlier, I think.
    I want to clarify about the wind for meshes. Wind for the meshes will be a very simple, because for them there is no necessary data. The quality will be like TreeCreator trees, I think.
    I will do everything possible to get a good result.
     
  44. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    I sent two variants a file for installing in a private message. Try it please.
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    just have given it a go, but unfortunately billboard normals are totally corrupted... (tested with tree creator trees).
    1. the generated billboard texture is – "broken"
    2. the billboard shader does not provide proper normals nor tangents
    fix 1.:
    • rotate the "camTempGO" by (y = 180 deg) so it looks along the negative x axis (not z).
    • move "camTempGO" (by z = -100)
    • replace your emission code in the TreeCreatorXYNormals shaders by:
      half3 wNormal = WorldNormalVector(IN, o.Normal);
      o.Emission = normalize( half3(-wNormal.x, wNormal.y, wNormal.z) ) * 0.5 + 0.5;
    edit: you will have to change the roation of the trees to match the calculation in the billboardshader...
    so the generated normal atlas looks like this:
    Bildschirmfoto 2016-12-26 um 10.13.28.png

    fix 2.:
    add:

    float3 billboardTangent = normalize(float3(-dir.z, 0, dir.x));
    v.tangent = float4(billboardTangent.xyz,-1);
    v.normal = float3(billboardTangent.z, 0, -billboardTangent.x);

    to the vertex shader.

    lars
     
    Last edited: Dec 26, 2016
  46. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thanks for the help! :)
     
  47. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Just purchaed the asset, and it seems to produce really good performance gains! It would however be really nice with some written documentation where the individual parameters are described. Keep up the good work!
     
  48. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Changes of trees on the network

    "Does it support tree destruction?"


    These would be great features, to allow the ability to harvest objects and have them synchronised over network ... ideally passing a value like a 1 byte tinyint to define condition etc - if not 0 (normal).


     
  49. Diab1O

    Diab1O

    Joined:
    Mar 31, 2013
    Posts:
    318
    Thank you. I will make the documentation later.

    Yes, I plan on it.
     
  50. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Cool thanks grabbed it .... its a great investment for a tenner !