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

tree creator tutorial – PUBLISHED

Discussion in 'Community Learning & Teaching' started by larsbertram1, Sep 3, 2011.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    hi there,

    i have just started to publish my tree creator tutorial which explains some tricks and techniques i have used to model my trees.

    please check it out: http://www.unifycommunity.com/wiki/index.php?title=TreeCreator_Tutorial
    example files and more details will follow.

    any feedback is welcome.


    lars

    You now can download all example files directely from the asset store: http://u3d.as/content/forst/tree-creator-tutorial-assets/2hh

    In case you have any problems concerning your leave texture, please have a look here: http://forum.unity3d.com/threads/10...glitching-lines-in-leaves?p=689347#post689347


    Update [09-05-2011]: small bugfix + how to create high detailed geometry
    Update [09-06-2011]: optimizing trees


    Make sure you read this thread about optimizing the rendering of trees
    http://forum.unity3d.com/threads/138929-batching-trees-%96-and-speed-up-rendering
     
    Last edited: Jun 7, 2012
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Awesome stuff. Tutorials are so time consuming to create but they are always in high demand!
     
    TheSeawolf likes this.
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    thanks bigkahuna,
    i will try to work out things more clearly, add more tips and steps over the next days and bring up a demo project to the asset store.

    lars
     
  4. Tom163

    Tom163

    Joined:
    Nov 30, 2007
    Posts:
    1,290
    Thanks, lars. The Tree Creator is very powerful, but takes time to tame, and this is one big step forward to make it easier for the community.
     
  5. herpderpy

    herpderpy

    Joined:
    Mar 9, 2010
    Posts:
    477
    Nice lars,

    I've always found the Unity Tree Creator a little bit complicated, never seemed to get the results that I've wanted.

    I love what you guys do at unify!
     
  6. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    I know that this isnt really reply on tutorial but i would strongly suggest "newer" technic for modeling of plants, which is high poly modeling.
    Basically you start with high poly plant in Mudbox, Zbrush or Sculptris and then bake normals on altas. Then you paint over it for difuse texture and specular. The main thing that results are 10 times better than Unity tree creator, and at least 5 times more optimised if you keep things well. If you have dense vegetation in game overall visual results and performance results are vastly better.

    I will post tutorial for this technic as soon as possible .

    For reference see how Crysis 2 artist has done it:
    http://www.platinumgold.de/ scroll down a bit to plants
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @janpec,

    i am pretty sure that almost everybody would like to create trees with any kind of external editor like those you have mentioned.
    but unfortunately, it is not possible to use the advanced tree creator shaders on any imported geometry [at leat not if you would like to use bending and windzones].
    so you would have to use the old fashioned soft occlusion tree shaders which means:
    * no real time shadows on the bark nor leaves
    * no bump mapping or spec lighting on the bark
    * no bump mapping, no translucency and no spec lighting on the leaves

    i am not aware of anybody having ported the advanced shaders so they could be used on imported models.

    lars


    btw.: did you look at the tutorial? does not seem so…
     
    Last edited: Sep 3, 2011
  8. Neodrop

    Neodrop

    Joined:
    Oct 24, 2008
    Posts:
    1,359
    Awesome work. Thank you. I don't need it, but it is a very helpful good work for many peoples. Hats off.
     
  9. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    Awesome work!

    But it pisses me, that exactly this should be done by Unity Team when they first released tree creator. Not let people to spent more than 3/4 year to find out, how to use it. Whole Unity documentation quality is going from "terribly suck" to "non existent".

    They implement quite potent tool, but they tell nobody how to use it and what it can do. So majority of people just ignored it, until few people after cca 1/2 year found out, that this tool is actually quite good and it can deliver very good results, if you know HOW. But they had to spent many hours by trying and guessing how it works. Only because some stupid Unity manager decided, that writing few pages of documentation is expensive.
     
    Last edited: Sep 3, 2011
  10. mrbdrm

    mrbdrm

    Joined:
    Mar 22, 2009
    Posts:
    510
    they do not have to tell you how to use it , that's up to you .
    i learned how to make my tree with no help , it was very easy to understand .
     
  11. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    OMG. You are best customer ever! They S*** on your head and you love it....

    When i buy some tool, i want to have documentation, to exactly know, how to use it correctly. To not waste hundreds of hours by experimenting. And do you know why? Time is money. Every serious company understands that and provide good documention for their products. I cant imagine Autodesk to not providing any help for their 3dsmax and telling customers "find way how to use it, it is up to you" :)

    Only reason why this attitude works for Unity is that majority of users are cheapskates and kids, who dont want to buy anything and they dont value their time. And they dont understand, that they are customers, so they deserve support and documentation. I dont doubt, that AAA companies have excellent support and documentation from Unity team.
    Unity team changed a lot, whole effort is now going for supporting big companies and small customers like pro users are meant to buy and shut up.
     
    Last edited: Sep 4, 2011
  12. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Haha. Oh by the way that is 90% of Unity custumers, until they want to really use all features in engine and make something decent from a game, then they found out deep secrets.
     
  13. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    True.On the first sight everything is OK, but once you are doing serious game and go little bit deeper, then there is lots of surprises. You are going through features and it is same story all around: Not documented, bugged, not documented, sloooooow, bugged, not documented, idiotic architecture....
     
    Last edited: Sep 4, 2011
  14. ResidentPm

    ResidentPm

    Joined:
    Jul 19, 2010
    Posts:
    25
    Sorry, I do not understand how to activate the manual mode Texture atlas?
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @kristof: there is no manual mode whatever…
    just adding 1 bark material to the trunk and all branches and adding 4 different leaves groups as meshes all sharing the same texture would end up in a texture atlas shown in the tutorial: an atlas which is just divided into 2 halfs.
    you would have to manually uv-map the leave meshes in your 3d app. you can’t do this in unity.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    hi there,
    next to small bugfix i am just working with some hidden branches to add some ivy to the trunk…


    lars

    $ivytrunk.jpg
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    I have just added a section which explains how to get around the limitation of a very simple trunk geometry when working on rather thin trees whose trunk has a radius below 0.5.

    lars

    $highpolytrunk01.png

    1. standard trunk created by the tree creator even with max LOD settings
    2. high detailed trunk
    3. even higher detailed trunk

    all trunks have a radius of 0.25m.
     
    Last edited: Sep 5, 2011
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    almost done with the tutorial…
    any further questions? suggestions? whatever…

    lars
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    some performance tips added.

    lars
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    quick test on using the tree creator in order to create leave group textures, which gives you much more flexibility than doing them in photoshop:

    $branch.jpg

    lars
     
    Last edited: Sep 9, 2011
  21. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You guys are surprising. I just don't understand it. Nor do I agree with it. I see unity staff posting to help out here and there as time permits. They also seem very proud of the work they do. I feel that what I paid for, is great value for money. But then, I'm one of the few actually finishing games in it so I guess I can't really agree with these comments. I don't get confused in unity either. The ongoing efforts to improve the manual are welcome and I notice bits and pieces changing here and there.

    It is ok to criticise a company, but to outright accuse them of not caring and dark secrets is beyond immature.

    Has it occured to you that respect is a 2-way street? if you were supportive of them, and appreciated their efforts, that they might actually respond in kind? Buying a car from a dealer does not give you the right to throw S*** at him after. The car is still yours. And it still works. Just because it doesn't work precisely how you want it to, it doesn't make you right, or give you the right.

    Paying for a product does not give automatic entitlement to slander. It gives you a short lived window of opportunity to create a decent dialogue that both of you can benefit from.

    Yes that was a lecture, I'm telling you off.
     
    Last edited: Sep 9, 2011
  22. Demostenes

    Demostenes

    Joined:
    Sep 10, 2010
    Posts:
    1,106
    Simple games are no problem, problem is when you are pushing Unity to its limits (trying to achieve AAA visual quality etc...). We already discovered few critical bugs, which are seriously endangering our game. And Unity does not care, rest of world is doing casual stupidities, so memory leaks, performance bottlenecks (lags) etc does not bother them.

    And I dont mention, that deeper understanding of Unity is undocumented. All performance bottlenecks, architecture stupidities, order of calling of some functions etc... you have to discover it yourself by experimenting. And that mean waste of time = waste of money. We wasted 10x more money by this, than was price of Unity pro licence. Unity is not cheap.

    Nice example of this is author od this topic. How many hours cost him to learn how to use this editor properly? 100? 200? $25 is lowest what I can expect as hourly wage of such person. $5000 for unity tree editor. Cheap, isnt it? Editors like speed tree can be used after 1 hour of reading documentation. And it is not because they are more user friendly, but because everything is documented.
     
    Last edited: Sep 9, 2011
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    well, it seems that nobody is interested in how to model trees but all are looking for how to blame unity – which hasn’t been my goal at all…
    but i have to admit that i am not completely satisfied with unity’s information politics. not only as far as documentation of the tree creator is concerned – think also about the roadmap e.g.: they have refused to announce anything in the past and i am glad that they have changed their mind. but with the announcement for 3.4/ 3.5 some projects driven by the community have become more or less obsolete like terrain4mobile or pathfinding which i think must be very frustrating.
    dealing with none documented features or learning how to use things properly might also be frustrating. and of course i would like to read some words of an expert about draw calls vs. number of tris vs. fill rate.
    nevertheless – there seems to be some movement as unity has just publish two blog entries called "Art Assets – best practice guide" and "“Special Effects with Depth” talk at SIGGRAPH" – may be a good start.

    so let’s get back to topic,

    lars
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    hi there,

    i have just send a package containing all textures, meshes and models of the tutorial to the asset store.
    i hope it will be available soon.

    lars



    btw. i have just seen that there are some trees modeled exactly the way described in the tutorial in an early test scene of interstellar marines:
    http://www.interstellarmarines.com/a...the-week-0042/

    ;-)
     
    Last edited: Sep 10, 2011
  25. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    What did you just say? We havent been talking about care, for me personally when i want to develop something right care doesnt play any role.

    Read Demostenes reply, he has just sumed up everything that i could say.

    Now the real question is, why do you reply on this theme every-single-time the same way, with your only personal view of IOS development.
    I know that you like Unity, and that you are optimist and like to see world from bright side. I am optimist too, but when it comes to game development, i am rather very picky about tools that i use. I hope that Unity developers read this forums and pay you some gratitude for kind words that you are spreading.
    It is just that you dont give any optimal review on situation that actually is. We have been talking about advanced PC games and for everything that Demostenes stated it is TRUE. I have tested it by myself, i have even post results in other topic, where you actually replyed with first time some rational overview on Unity performance and shaders, but seems like that you have already forgotten that.

    This forums should be clearly devided into IOS and PC development on all topics and forum sections, becouse in situations like this there are too different opinions since IOS developers are clearly distributing informations without some serious background.
     
  26. BIG-BUG

    BIG-BUG

    Joined:
    Mar 29, 2009
    Posts:
    457
    Just wanted to intrude in the discussion to say: Great Work larsbertram, thank you!
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    thanks big bug!
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
  29. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    @Lars: I may definitely look into creating tree assets with the tree creator...something that i haven't touched. Alot of my trees and assets are done in vue, and I may end up redoing my trees. Kinda bummed out that I can't use normal mapping and detailed textures, but hey, I am reading through your tutorial. And if you need a proofreader, I would be more than happy to volunteer :)
     
  30. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Awesome, thanks!
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @Neptune_Imaging: sounds great!
    just fell free to correct any mistake in form and content you find! it is a community project.
    and feel free to ask any question. or correct me if i am wrong. it would be great to read about your experiences and efforts with the tree creator.

    @Rush-Rage-Games: same for you. i would just like to ask you to share your experiences with the tree creator or the tutorial.

    lars



    btw: some more pictures from the guys of interstellar marines and what they are doing with mesh based modeled trees. i hope you will enjoey them:



     
    Last edited: Sep 30, 2011
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Well, right now i am working on a palm tree and it looks pretty cool so far... still getting used to the tree creator
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @Neptune_Imaging:
    good luck for your your palm tree. and don’t hesitate to post any picture of your result here. may be even some tips or hints.

    or questions of course.

    i hope, finally there will be some discussion about the tree creator and how to use it properly.

    and as you have mentioned bump mapping on trees: do not forget to have a look at the advanced terrain shaders on the asset store… they will enable bump mapping at least on the bark of externally modeled trees.

    lars
     
    Last edited: Sep 15, 2011
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I am just glad I will be able to use normal mapping :). Also in the shader, i will be setting the CULL to OFF
     
    Last edited: Sep 15, 2011
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    just updated my reply: and as you have mentioned bump mapping on trees: do not forget to have a look at the advanced terrain shaders on the asset store… they will enable bump mapping at least on the bark of externally modeled trees.

    lars
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I have a question for you... how would I duplicate the trees if they are already a prefab...? I have a tree that i like and I want to duplicate and edit...

    EDIT: There is the tree, i spent so much time on :)
     

    Attached Files:

    Last edited: Sep 15, 2011
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @Neptune_Imaging:

    simply go to the project tab, choose the tree you want to duplicate and hit "command" + "d". that’s all.
    when you start to make any changes to the duplicated tree, unity automatically creates its texture folder. so do not forget to tweak the settings of the new textures (aniso level!), delete them after you have finished your work and assign the materials of the original tree (to save up texture memory).

    and as if looks as if you have some darkened edges aroud your leaves you might want to have a look into this thread: http://forum.unity3d.com/threads/10...glitching-lines-in-leaves#post_message_689347


    lars
     
    Last edited: Sep 15, 2011
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Oh ok, AWESOME!! This is way better than making the trees in Vue, since the tree shaders blend in a bit more naturally...
     
  39. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Hi!

    First, thanks for your tuto!

    I have one question : Why the imported object used for leaves must be double sided ? Unity don't use automatically optimized leaf shader on it ?
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @botumys:
    the old "soft occlusion leave shader" does not cull geometry that does not face the camera – the new "tree creator leaves shader" does!
    it has to do so because of the lighting function and the support of translucency: leaves look different view from front or backside.
    if you do not use double sided geometry the leaves will completely disappear when you look on them from the backside.

    i hope this short explanation has answered your question.


    lars.
     
  41. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Nice tree Neptune, just one critique maybe. The trunk on bottom part is very wierd shape , you might want to make it more "default" and straight. I know that palm tree like that might exist in nature, but in your game where trees will be duplicated a tons of trees with bended trunk like that would look wierd.
     
  42. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Yes, I understand now, thx!

    I just tested and I have another question, in your tutorial there is an image of the texture automatically generated by optimized bark/leaves shader. Bark takes 1/2 of the image and leaf other 1/2.
    If I use only 2 textures like in the example, unity creates a map with bark taking 1/3 and my leaf texture 1/6 of the total size. There is custom size to set in original textures before using them ?

    Another question, where I can found more information about Tree creator leaves shader?
    For base and normal map, it's ok. I understand Gloss and translucensy but (A) mean that we have to use Alpha component, this mean that we have an image with only an alpha channel for each ?
    Same for Shadow offset, but it's not clear for me (and again only alpha channel)
     
    Last edited: Sep 15, 2011
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @botumys:
    no, ajusting the original texture size does not effect the size of the texture in the baked atlas.
    it sounds strange that only using 2 textures devides your atlas 1/3 – 1/6. but that is definitely a question of setting up everything correctly:

    1.
    if the bark texture only takes 1/3 of the atlas the tree creator must expect a second bark texture. so first check if trunk and all branches share the same material (not the texture but exactly the same material)!

    see fig. #4

    2.
    if you have manually deleted control points at the end of any branch or work with "break change" and "break location" or define the "radius curve" in a way it never reaches the x-achsis then the tree creator will automatically reserve 1/3 of the texture atlas for the "break material" even if you have not assigned any. just make sure that "Branch Material" and "Break Material" on each brach point to exactly the same material (usually "Break Material" is empty).

    following step 1 and 2 should make the bark texture now cover 1/2 of the generated atlas.
    see fig. #1 or #3


    3.
    if the leave textures probably still covers only 1/6 check all leaves if they share the same material (not the texture but exactly the same material) like you did in step 1 for the branches.

    does this fix your problem?


    lars



    $textureatlas.png
     
    Last edited: Sep 15, 2011
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Thanks Janpec.

    I have been trying to play with the flare on the bottom, but I had to scale the tree down to .3, .3, .3... the default is the "master" copy and I could easily change the trunk on the fly... i've also played with the wind zone and I would suggest using that sparingly... the nodes on the leaves move way too much... trying to keep them attached is a bitch...
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @Neptune_Imaging:
    from the tutorial: --> Especially leaves tend to float around and loose the connection the the branches using the default values. So just lower them: "Main Wind", "Main Turbulence" and "Edge Turbulence".

    Lowering "Main Turbulence" of the leaves to e.g. "0.1" will help best. maybe you even have to lower "Main Turbulence" of the parent branches.


    lars
     
    Last edited: Sep 15, 2011
  46. botumys

    botumys

    Joined:
    Apr 16, 2009
    Posts:
    707
    Thx! Step 2 solved my problem, even with break material empty, unity allow space for non-existing map. Thx a lot!
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    @botumys:

    you are welcome. and please post some pics of your trees. would be nice to see them as i liked your fantasy project a lot.

    lars
     
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    That is exactly what I did :) and it looks awesome... and thanks to duplication, i have at least ten versions of my tree.
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    from ik animation (http://forum.unity3d.com/threads/10...r-leaves-and-causes-glitching-lines-in-leaves)
    instead of using .png gimp should also be able to handle targa or tiff – both formats which support an extra alpha channel.
    so just do your texture on a layer with transparent background as you have done so far. duplicate the layer. fill the duplicated layer with white but make sure that transparency will be saved so you just get white leaves and branches on a transparent background.
    add a new alpha channel (which initially should be black) and copy the white leaves and branches to it. now you have got your alphamask.
    delete the layer containing the white branches and leaves.
    go back to the color layer. duplicate it again. choose the lower one of the both layers and – now it gets a little bit experimental – blur it. add a third layer underneath and fill it with some green you grabbed form the leaves. flatten all three layers and save the file as targa or tiff.

    i do not get what you would like to know. sorry. are you asking about how to rotate things in gimp? i don’t know…

    lars
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks Lars I will try this.

    And no, I mean like rotating the texture itself. Most photo editing softwares only allow you to rotate the texture 90 or 180 degrees. Is there a way to specify the exact rotation you'd like. I mean with any software PS, GIMP, or any other photo editing software you know of.

    Thanks