Search Unity

[SALE] InfiniTREE - Procedural tree generation-growth, Multithreaded batching & Forest management

Discussion in 'Works In Progress - Archive' started by nasos_333, Dec 14, 2014.

  1. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362


    This is probably due to the sample dynamic tree behavior. In the dynamic area the tree opens up. The big number of draw calls is due to the tree beeing open and the shadows contribute a lot.

    To lower draw calls in this phase i have though of various techniques

    1. use a more complex end branch, than simpler one and more of them, so higher level growth creates less items. This will be helped a lot by the new spline.mesh growth systems, that will allow the creation of connected meshes. The unity Tree Creator or a 3D software can also be used.

    The goal of the dynamic tree is to allow branches move, but the little end branches dont have to or could be done by a shader like in Unity trees, since it is not always nessesary to have full control over tham.

    This is a very broad matter and is what next updates will try to handle the best way possible, in various ways.

    2. I have noticed shadows take a huge toll when the tree is decombined, so i will add a system to optionally disable shadows per level, so higher levels are automatically cutoff shadowing when the tree is moving/falling etc. This will save a huge ammount of those call, the difference is 160 to 34 !!!! draw calls (whole scene, the tree takes up only 5-6) when i disable shadows in the maple tree for example)

    EDIT:

    I made a sample to show the problem, the system does save huge when combined, even with shadows. Even then would be a good idea to LOD shadows and this is automatically done if the LOD item has no shadows.

    In the dynamic phase, that the shadows cant be loded overall since the viewer is close, it is an issue when the tree is dynamic, so it would be a good idea to eliminate the higher level shadows (from little end branches and all or partical leaves) while the tree is moving.

    A good practice would be to also eliminate shadows for many of the leaves, by adding a 2ond type without shadows. Similar could be done for the higher level branches.
     
    Last edited: Mar 3, 2015
    twobob likes this.
  2. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    That is great info thanks.

    Tiny point though, I was just trying to understand why sometimes it refuses to batch some trees. I will keep looking into it but I am fairly sure it related to "complexity".

    Trust your day goes well
     
  3. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Is it certain that are not checked as "dynamic" in the script ? Dynamic will open the tree when hero is close (and close it soon after hero is far enough)

    The system is indeed very complex to keep everything batched in dynamic mode and insertion, so if you do find a case where the batching breaks (the trees are opened and are not restored as a single batched item), please let me know with any info about when it happened and i will put it in front of the to do list.

    I have tested it a lot, but maybe there is some situation that has not been handled (like say run very fast from the dynamic region before the script has the chance to rebatch the trees or something)
     
  4. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I'll go check the exact circumstances. Thought it was just a plain old "do nothing" tree.

    If relevant I will:
    Note the exact settings. (with a picture too)
    Export the asset and send it to you. (I made it, it will be fine)

    Thanks mate
     
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Great, thanks. I will check the scene as soon as you send it and see if i can recreate the problem and solve it.
     
  6. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Can you explain how you multithreaded this system if you cant use unity's api in other threads?
     
  7. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    50$ an hour. plus expenses :p

    (or perhaps buy it and read the code?)
     
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    It was a per case handling, so i cant remember specifics.

    The code in the project is open though, so you can see exactly how it was done. The general approach is to put the non supported items outside the threads and synchronize the thread result, gather it properly and assign to the supported item outside the threads.

    It was the hardest thing i did in any of my assets for sure. I have multithreading in the particles too, but this system was more forgiving than the tree one and was much easier to do.
     
    twobob likes this.
  9. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Indeed, explaining something so complex would require a full lesson probably :)

    Looking at the final code is the best way to learn. Even i would not be able to remember how i solved it without the code :)

    Also this work came after multithreading the particles, so i already had experience and code to base it on from there (though it was exponentially harder than the particle case)
     
  10. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Is there any other asset that does multithreaded batching btw ? I may also sell a standalone version if there is none, since it makes a day and night difference for real time use.
     
  11. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    Thanks, that was what I thought. I have done it similiar way with processing cloud points.
     
  12. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    It can be tricky depending on what is needed, timing and mesh assignment are both rather hard, due to the fact that everything needs to be collected properly.
     
  13. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    UPDATE:

    The performance optimizations for the dynamic tree phase are now done and working like a charm. I get an exponentially lower ammount of draw calls by removing the smaller detail (above some defined growth level) from the shadowing.

    It is almost transparent and is another huge performance boost, along with the duplicate mesh fix that frees exponentailly more ram when instantiating.

    I have to test a bit more and will soon be available in the store and through dropbox for a quicker access.
     
    twobob likes this.
  14. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    superstar, I spent most of yesterday mangled on pain meds. Am actually a "bit capable" today if you need a tester .

    Thanks
     
    Last edited: Mar 6, 2015
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Great, i will try to pack the current version and provide it.

    I am 99% done, everything is in place now, so hopefully will be able to provide it today. Just need to do a few more tests to make 100% sure everything works ok.

    Thanks for the epic contribution to this, the system is now so much more optimized and feels so much better in dynamic mode !!! The shadows really made a huge difference.
     
  16. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I am proud to be involved, as always, with great addons like yours.
    Have had to take some more pain pills (bah) so don't expect crystal clarity since it's like walking through ice-cream on these bad-boys, but I will certainly do my best.

    Excited to see the new performance numbers! :) anti-bottle-necking ftw!
     
  17. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Indeed, removing shadows in dynamic felt like the first time i run the multithreaded batching and the tree inclusion was super smooth, instead of halting the game :).

    And almost like seeing the 2GB ram taken reduced by an order of magnitude by changing a single line of code.

    I will test a bit more so it can go easier on the testing on your side :)
     
  18. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    I just finished with Sky Master v1.5 submission and i am going full force on finilizing the InfiniTREE update and provide the first version for the testing.

    It took me a bit longer to finish with Sky Master due to the large documentation requirements of the new features and extensive testing / refinement, so i will try to provide the link for the finilized InifiniTREE update tomorrow.

    The submission to the store will be sometime early next week.
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    I have just finished adding the shadow handling in the chop dynamics as well and now is applied to both dynamic phase examples.

    v1.5 update summary:


    - Fixed displacement issue with leaves on parent branches

    - Fixed issue with leaf growth, now leaves grow to their proper size every time

    - Added option to lower growth change per level

    - Removed "alternate_leaves" and "branch_prefab_per_level" options, now these are enabled by default when the lists of leaves - branches have more than one member

    - Added "Leaf_dist_factor" option, to control distance between created leaves

    - Added a new chop feature and complete demo scene, with sound, particles, procedural animation etc

    - Added shadow removal above a chosen level controls, for the dynamic phase, so this can reduce draw calls when the local trees are not batched exponentially !!!

    - Fixed a memory leak that duplicated all created meshes, now RAM use is exponentially lower !!!!

    - Added the first version of grass shader and motion in WIP folder. This can be used for production also, but i want to work a lot more on the final look and shading, so i place it in the WIP for this release.

    - Added the complete new spline and mesh growth demo in the WIP folder. These are not meant for production yet, but are cool so I wanted to share the work done so far and get feedback.

    A remark on "instant grow leaves" option, this must be used only when the Grow tree option is off.
     
    Last edited: Mar 8, 2015
  20. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Some more additions

    - Added a "rotate towards normal" option to make the tree rotate towards the terrain normal when grown (or for real time rotation during gameplay along an arbitary vector). This option can also be enabled with each axe chop motion, so the tree can take angle gradually.

    - Added "leaf scale range" option, to vary the leaves scaling.

    - Automated the required tag creation.

    - Added a check against terrain for the mouse placement, now trees will conform to the ground if a click is made in a collider above ground. I will also provide an option to remove this check, if required to grow on various objects. This check will only work with Unity terrain.
     
    Last edited: Mar 8, 2015
  21. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362


    WIP of the tree chop demo and snow trees. This will be passed to Unity 5 for the final look after i have the gameplay side polished.
     
  22. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362




    First Unity 5 WIP demo pic. All trees can be chopped and grown at any point.There is some twaeking to do in order to get all shading looking great and play with filters etc.

    The pack will work in Unity 5 out of the box if v1.1 or v1.5 are downloaded and installed whole.

    Upgrading Unity 5 v1.1 is trickier, since it will create duplicate files and i am working on a way to eliminate that need.
     
  23. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    UPDATE:

    I have come across a problem with Unity 5.

    Seems i cannot produce the demo for InfiniTREE. It works fine in the editor, i can grow trees fine and chop them etc

    When I build for webplayer though, seems that prefabs are missing. I use multiple Resources folders, most of which are not in root assets folder.

    Any ideas on why this might happen are welcome. I may have to offer an option to directly assign assets in the next version, to cover for that issue.

    Here is a sample in Unity 4.3.4, that is working

    https://dl.dropboxusercontent.com/u/79230236/INFINIDY/TREE/INfiniDY Tree Demo CHOP.html

    And this is what i get in Unity 5, from the same project, the tree parts are loaded with Resources.Load function and a string reference.

    https://googledrive.com/host/0B-QCdE1dswQBYnJqRnFLY01INmM/TREE_CHOP_UNITY5.html

    A video from the new Unity 5 demo, run in editor in my laptop

     
    Last edited: Mar 16, 2015
  24. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    New demo for InfiniTREE

    InfiniTREE - Tree chopping Demo - Unity 5
    https://dl.dropboxusercontent.com/u/79230236/INFINIDY/TREE/TREE_CHOP_UNITY5.html


    I will post one with image effects implemented as well later, also this demo does not have the elimination LOD stage.

    The demo is included in the upcoming version 1.6, along with a huge number of optimizations and enchancements. Submission of the new version will come soon, the manual has been written and i am putting in the final details.
     
  25. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362


    InfiniTREE is half price !!!! for a limited time. ($40 instead of 80)

    Enjoy dynamic trees, forest management, fully controllable LOD and multithreaded batching.


    The upcoming version 1.6 will bring all new features and enchancements, plus a grass system and much more.
     
  26. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Version 1.6 has been submitted to the store and is pending review !!!

    This version brings major performance enchancements, usuability and tree shaping fixes and new tree chopping behavior and demo.

    Also i can upload and send the v1.6 right away on request, for everyone that wants the new updates right away.
     
    Last edited: Mar 27, 2015
  27. Zultron

    Zultron

    Joined:
    Dec 26, 2012
    Posts:
    59
    I stumbled on this asset by chance since I was looking for new solutions for new resource gathering game. And you just blew my mind....

    I do have request if you could possibly include in a future demo an option after you chop tree it grows out from same tree stump. I also noticed that in your demos you can grow tree over tree just curious if there is system that automaticly grows trees in zone and checks if those trees are not growing over each other or is this something that has to be custom coded.
     
  28. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    It is trivial to regrow the tree, the hard part is erasing the previous from the map, which is a bit trickier (but still just a few extra lines of code, since all modules can be easilly controlled). I will have that sample in the next version (tree dissapear after chop and possibility to regrow by instantiating the same script).

    There is currently no check for overlaps, but this is also trivial to impement with a higher level controller or a sphere cast or other method. This is very game specific, that is why i dont have a system in place, but i could definitly offer some sample implementations in the next version as well. I have a sample script that does not allow growing trees on top of other trees (by hitting their collider) and will root them to the ground.

    The system right now is a very strong base for multithreaded batching and automated grouping AI, plus LOD and L-tree growth, but its full potential will be realized when i finilize the mesh growth with splines, physics and user input of trees/branches. This is already working and i have inluded a sample inside the pack (WIP folder), but needs a lot of extra polish and integration with the batching to be perfected.

    After that the system will have some stunning possibilities besides the current forest growth, like growing trees dynamically towards targets (something i want to implement for my RPG as well) and shaping trees on the fly, in game. Essentially it can be something like the Speed Tree editor right inside Unity and usable in real time, with fully custom, controllable and multithreaded batching and customizable LOD.

    Also trees is just one sample of what is possible, essentially any rule based construction kit can be inplemented on the same base, like growing grass (i have a sample for this as well), or detailed houses that can be contructed on the fly, grouped and batched and then be dynamically destroyed and have automated batching and LOD versions. Occlusion is also something i could add later, the LOD does not have to be only distance based for example.
     
  29. SpectralEdge

    SpectralEdge

    Joined:
    Sep 17, 2012
    Posts:
    33
    Havent seen any updates on this since may, still going?
     
  30. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Hi,

    There are plans to add a lot more bonus things in the pack, so the question is when i will have the time to resume working on it.

    My time table for adding the bonus systems for InfiniTREE is after finishing Sky Master v3.0 (early October), i will start working on adding the new features and working in parallel with SkyMaster v3.1 to make sure everything is compatible and trees receive snow etc

    Features to be added in the next update:

    - Tree placement / painting editor like in InfiniGRASS (the grass system creation can also be considered work for IntiniTREE, as i will adapt the editor work for it and i now have a lot better shader experience as well)
    - Batching applied to the editor for massive tree numbers paintable before enterng play mode
    - New shaders for tree and wind
    - Mass tree placement based on splat texture weights (this will be done for InfiniGRASS as well, also i am considering support for other assets like GAIA).

    The goal is to make InfiniTREE 2 trees look next generation like the InfiniGRASS. Trees are much harder to do, so i cannot promise when this cool free bonus to the current pack will be finilized, but i will start working fully on it after SM3.0 is done and hopefully i will have the core done by mid November.

    Features planned for v2.x updates:

    - Spline based real time branch growth (a base is included in WIP, needs polishing and better texturing)
    - Physics based real time branch growth
    - Tree bark sculpting
     
    Last edited: Sep 20, 2015
  31. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Cartoony trees! (dammit :p)
    (less batches, optionally just store pre-made trees, other stuff I sent you before :p)
     
  32. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Adding all in the to do list :)

    I have some good ideas how to further reduce batches in dynamic mode, i will probably spawn some of the brances in a single mesh and keep only those that need to move separated, as option.

    This is rather tricky, as there is the question which brances should go in that mesh and how it should be created (for example will it be a replacement after brances have grown or only an editor feature etc) and whether its flexibility should be retained and restored on demand etc

    Cartooney trees should also be very nice to have, along with the planned uber realistic (at least that is the goal for v2.0 :) )
     
    twobob likes this.
  33. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Does rocks hands! nice one \\m//
     
    Last edited: Sep 20, 2015
  34. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Easy tree painting and adjustments with the new tree manager.

    UPDATE:

    InfiniTREE II is in development and is now extended with a cool new Tree Manager-Painter and much faster performance in editor. The next step is to create new shaders to give a next gen look to the trees.

    InfiniTREE II will be made for Unity 5, in order to provide the maximum visual splendor.
     
    twobob likes this.
  35. SpectralEdge

    SpectralEdge

    Joined:
    Sep 17, 2012
    Posts:
    33
    I am wondering how it does with a huge forest, say 1k trees or more visible at a time? Better than unity's built in terrain trees?
     
  36. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    That depends on whether the trees are LODed or fully visible and their detail. I will do some tests and post results soon.

    The scene size for such detail trees in vast numbers would be high (maybe in hundreds of MB) so these would need to be ungrown and grow inside the game for the game to have small size (ungrown trees take up zero space in HDD and scene files).

    Also it just occured to me that i could let trees grow back gradually on their LOD distance, than have them all grow back when entering play mode, as option. The choice will be between a slight overhead while moving around (less than the one when growing grass, since the addition will be instant than have a dynamic grow phase) to a larger scene start time.

    Also maybe i could remove trees that are not needed any longer or do other tricks to have endless forests, without RAM restrictions. These are all evaluated for the next update(s).
     
    Last edited: Sep 21, 2015
  37. SpectralEdge

    SpectralEdge

    Joined:
    Sep 17, 2012
    Posts:
    33
    Right now I am using terrain composer and RTP for generating the terrain and then using Sectr to stream them in and out as scenes, so each terrain would have the trees as contents of a scene.

    If I can drop trees from terrain then I can save the terrain as a mesh (only reason to have it as terrain is for the tree and grass billboard system) and reduce draw calls by a few more hundred. We have a system for lighting trees on fire, right now they just burn down, but being able to regrow them would be pretty snazzy. We need more realistic trees than what seem to be produced in your examples though. Is it possible for me to create more realistic ones?

    I am currently purchased your infiniGrass as well, but really would like an easier way to spread it over a large terrain, somewhat like terrain composer (either a height map, level, etc). - I haven't bought infiniTree because of the lack of ability for throwing a lot of them on the terrain all at once, I assume, is lacking in the tree system as well.
     
  38. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362



    I post some performance pics above, one with 600 and one with around 1000 trees. This is an extreme test, there is no LOD and assets are super high polygon comparing to Unity trees. The normal operation would have LOD which would reduce the 20-30 million tris dramatically (what i do with Mushrooms in InfiniGRASS, the tris go from 2-3 million to 200-400K in a distance for a group of patches for example) and a cut off distance etc

    The core of the InfiniTREE system is shader/asset quality agnostic, so if there are assets of very high quality, they can very easily be placed instead of what i provided (to the extend the detail will fill the available RAM).

    The plan for InfiniTREE 2 is to move the system to next gen in looks as well, using Unity 5 and new shaders and assets. This will be the major focus, plus extending the ease of use with the new Tree manager/Painter and the upgrated performance in Unity editor.

    This will take some time to finalize as trees are a hard subject to make amazing looking, so i cant give an estimation as to when it will be ready, but i am shooting for later this year.

    The spread en mass is currently WIP for InfiniGRASS v1.3 (and will apply to InfiniTREE 2 when it arrives as well). The issue was that the editor performance in v1.0 was slow and making the batching system for Unity Editor was a priority before i start on mass placement, so now that the editor speed is as good as the in game one, i can fully focus on a automatic spreading system and provide multiple options. I already do splat map based scaling, so i have the base and hopefully development of that feature will go fast.

    There is also a plan to support the new GAIA asset and later the Terrain Composer as well.

    The speed i can work on the pack updates directly depends on reviews on the store, so when possible a review can greatly help the pack grow and have extra features added much faster.

    Note that the system allows all grass/trees to be ungrown in editor and regrow when the game starts, so the scene file can take zero space as far as trees are concerned. I also plan to create a system to let them grow gradually, as they get in sight, than all at once on game start. This is also planned for v1.3, but since it is rather complex to do, it may come in v1.4.

    On tree growth, there is a lot more i am planning to do, like finalize the spline and physics based growth, for the ultimate natural tree growth. I already have the WIP of this system included in InfiniTREE pack, but needs more work on texturing and the branch seams to be perfect.

    Here is a small demo of the spline based growth WIP

    InfiniTREE - Procedural tree branch generation, using both splines and user input
    https://dl.dropboxusercontent.com/u/79230236/INFINIDY/TREE/INfiniDY Tree Demo GROW.html
     
    Last edited: Sep 21, 2015
  39. SpectralEdge

    SpectralEdge

    Joined:
    Sep 17, 2012
    Posts:
    33
    Alright, well I went ahead and bought all three, the trees, grass and environment (sky) systems. Downloading them tonight to test tomorrow. Hopefully that will help as much as a review, will post a review after I look at them.

    I do wish you had better step by step "from scratch" instructions on setting up a new scene. Yours are fun to play with but I am tying to quickly replace other assets with yours and decide what I need to code. Figuring out what you have in your package is hard as some of the features seem undocumented, and just droping some things in a scene doesnt work out as easily as i'd hoped.
     
  40. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Thanks for buying.

    I am constantly working on the usability, for example the grass system is a big step ahead of the tree one (and it will transfer to the trees as well) and the Sky master 3.0 will offer a global configurator that will take away all guessing and eliminate the need for looking at the Guide and Manual that come with the pack.

    Sky Master 3.0 is in full development and planned to release early October, so i would recommend using that version for production (though will be backwards compatible with 2.x), as it will much easier to setup and have all new systems like the Ocean/Watrer, snow etc integrated.

    I am also working on porting the editor from grass to trees, so this could come before the InfiniTREE v2.0, as a means to easilly place the trees.

    On tree creation, the procedure is to copy a ready tree and use its prefabs as base, there are 4 components, the growing script that holds reference to the asset prefabs and the bark, branch and leaf prefabs that are instantiated to grow the tree. These can be copied from a ready sample, inserted in the scene and replaced by any prefab using the sample orientation for example (and the grow script references must be updated with the copied prefabs)

    I also describe this procedure in the manual, for more details. Let me know for any further questions/details on the systems.
     
  41. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    @SpectralEdge

    I have also sent a PM with the dropbox link for v1.2 of InfiniGRASS, this version has a much increased speed in editor (preview is as fast as in game) and many new features.
     
  42. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Awesome. This really is one of my "I hope this is unbelivable one day" assets.
     
  43. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    After the experience with InfiniGRASS, i am sure i can make the trees look a lot better with better shading and assets. This will be my focus after Sky Master v3.0 is submitted in a few weeks.
     
    twobob likes this.
  44. ZenMicro

    ZenMicro

    Joined:
    Aug 9, 2015
    Posts:
    206
    Hi nasos_333,

    I am looking for a very particular thing and would like to know if you think this is that thing!?

    I am using Xfrog trees, which are very high detailed (187,000 tris on one tree) and as you can imaging without billboarding my world is too slow.

    Can this product do billboarding of these 'trees' which are neither SpeedTrees nor Unity trees, but custom meshes?

    Here is the thread i created to try get some feedback from the communtiy but so far got nothing.

    http://forum.unity3d.com/threads/xfrog-tree-conversion.361650/#post-2343926

    I'd appreciate you clearing this up for me as some other products (AFS - they told me it cannot be done as it's not a tree), I don't need tree growth or anything more really than the model up close and a billboard at a distance as well as some wind effect would be awesome.
     
    Last edited: Oct 26, 2015
  45. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Hi,

    The system allows to use any item for LOD, so it can probably use a custom shader and billboard (in shader implementation, i can say that all shaders would be compatible with the batching though), but it does not automatically create the billboards, as this rather hard in the general case.

    I think there are some assets that can do the billboards even in real time and i do plan to support something like that later, at least in the editor, but given the complexity i cannot promise something concrete yet.

    Note that i already have a fully working system that can grab a transparent texture from a scene render on specific item(s), so the plan is to apply this and allow the easier creation of LOD textures for the trees. So it is not something i will have to make from scratch and is feasible. This system is implemented in my Toon Effects Maker asset and its primary role there is to grab animations from any object (particles etc) to sprite sheets for 2D use, but can be used to grab the tree texture.

    In fact it could be used to grab a sprite sheet for the tree billboard with the wind animation, so you could potentially have an animated billboard tree with the right shader and handling (i have not tested it though with InfiniTREE or have such a shader). This would be a cool idea and i will make sure to persue it.

    Let me know for any further questions
     
  46. ZenMicro

    ZenMicro

    Joined:
    Aug 9, 2015
    Posts:
    206

    Hi nasos_333,

    Thanks for a quick reply, Yeah Advanced Foliage Shader from what i could see in his demo (the links seem to be broken at the moment) did really good real-time billboards of trees, however he simply states to my question "does not work with objects" but i wonder if the shader could be easily modified to attach to a custom tree object? But I have no experience with shaders actually.

    So does this system of yours work as Unity Trees or are they also a complete custom tree solution?

    The wind animation on a billboard would be amazing as well, but i would want the mesh when up close to be animated more importantly.

    That said - real-time directional billboarding is the number one need for me at this time.
     
  47. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    I am not sure, but i think Unity trees have an automated way to create their billboards and maybe if AFS uses this system it will be limited to Unity trees only and that is why meshes are not supported.

    The billboard issue is not trivial, so i cant promise a solution and i do not yet have a system in place for InfiniTREE, so i cant say for sure if it can be used with such.

    InfiniTREE works with Untiy trees to the extend parts for the tree growth (like branches) can be created in the Unity tree editor. I assume you could place a tree whole at the root and would instantiate it, but i cant gunarantee the wind shader will work.

    In general InfiniTREE needs a bark, a branch and a leaf items to be created and defined and then will grow a tree with these parts and batch it and use a leaf shader to animated the leaves in wind. Also it will replace the tree parts with LOD equivalent parts that have a LOD word in their material.

    So the system does not work as Unity trees, but can use Unity tree parts.

    In order to use billboards, there will be two requirements, one is to have a shader based billboard solution, so it may work with the batching (as the trees are batched and not individual entities) and a way to grab the texture that the billboard will use (much easier, i alrady have an infrastucture working for something like that as i described above)

    If i had a working shader, i could automate this process so billboards would be assigned to the trees automatically (in editor at first), but it will take some time until i start working on that since it is rather complex.

    I would recommend looking at an asset called TurboForest that has a good billboarding solution, i have not used it myself, but i read it is good for that kind of thing.
     
  48. ZenMicro

    ZenMicro

    Joined:
    Aug 9, 2015
    Posts:
    206
    I get the feeling my best bet might be to get AFS and read through the shader code etc and hopefully find way to make it work with my requirements, if it relies heavily on Unity Creator Trees maybe It can't be used at all, but I mean it does Billboards and very well so i wonder if it could be reworked to target the tree objects and then be able to work.. i mean a tree is a tree is a tree I'd like to think :p

    No doubt it is looking for 'trees' as Unity dictates is a tree.. but if (and i'm assuming here it could be modified to be placed on any object, then it may just work. @ $20 it's not so expensive to give it a look, I've posted with that Asset creator some questions but haven't got anything back yet. I hope he can give it a second thought and maybe there is a way - after all he would be best suited to tell me if it could be modified... unless he is not interested in helping. not sure.

    I understand it's not trivial for your app to be modified to do this.. but maybe his? anyway that's for him to say i guess. I do appreciate your consideration for my problem... If you're interested here is a sample tree;

    http://xfrog.com/category/samples.html be sure you select a 3D plant and not a 2D one if you're gong to look at them, and i think you get an entire species per download, so 9 trees from young sapling to old mature tree... much higher poly as expected as well)

    I think Xfrog will be releasing a tree pack for Unity.. but out of interest the normal CG high poly ones i have I think should be reasonably possible if good billboarding can be pulled of. just some one needs to make a custom asset/script to do it. After all they have thousands of trees available at around $1 each when purchased on sale... it might not be the right way or the normal way to go but if doing a PC game.. may still be OK.

    My new nVidia 790 card handles a bunch of these trees just fine if i am facing the edge of the world.. only if i turn around and there are hundred or so in the distance they are all being treated as up close i think (200,000 poly!).. Billboard is surely the answer.

    PS i had a look at TurboForest - not sure that is what i need.
     
  49. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,362
    Maybe indeed AFS can provide the solution with some extra work.

    Another thing i forgot to ask, is why not use very low res LOD models instead of billboards, do you think this might work ? This way you could also keep wind and have trees look nice and correctly lit etc

    That would be a case where InfiniTREE would excel at.
     
  50. ZenMicro

    ZenMicro

    Joined:
    Aug 9, 2015
    Posts:
    206
    My problem is the trees are what they are, all very high poly count and as i am not animator or modeler and I've tried to find people to do the work of decimation/re-topology to create a set of LODs ... no one is interested as it is a lot of work and $100 is minimum per tree i seems (that's a lot of money for me so won't be happening - I considered learning Blender myself and seeing if i could do it but it's just one of the areas i'd rather not have to spend too much time... it's a setback but i am sure Billboards will work well enough at least say until Xfrog end up releasing Unity ready trees which they have personally informed me they are working on... although I'm not sure if at first or ever they will bother with the trees i need as they are Unique to my location... not as popular as US or Europe for example.

    In short there is no way for me to get LODs made... at least not unless i pay a fortune per tree.. so it's all or nothing.. and i think they look great as is and would just like to billboard them at 10-20 meters (or whatever works best) and then there should only be ever 10 tree max i guess in full detail.

    Just out of interest you can see my post here about Custom Tree Importer... which i though just might be a solution;
    http://forum.unity3d.com/threads/released-custom-tree-importer.263224/page-3#post-2351885

    I was quickly told it can't work, that Asset is made by the same guy as the Advance Shader.. so anyway.. it's a road no one else is taking it seems.. high poly trees are just avoided.. SpeedTree they say lol (if you want to try make the tree again from scratch)!
     
    Last edited: Oct 26, 2015