Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Trees...

Discussion in 'Editor & General Support' started by Thenewguy, Dec 21, 2017.

  1. Thenewguy

    Thenewguy

    Joined:
    Jan 16, 2013
    Posts:
    4
    Hello everyone.

    Years ago I came across Unity and had a hard time understanding some of the concepts since I was very new to any sort of CG stuff. I've returned with more knowledge on different topics about generating art for games and what exactly goes into a game asset or a model to make it look good. I've mainly been learning modeling through Maya and I recently stumbled upon a tutorial on Youtube for modeling a pine tree from scratch. I faithfully followed the tutorial and exported it to Unity. I was tampering with the wind settings but I'm still not too familiar with that. During my searches to find an answer, I found out that Unity now has a tree generator called Speed Tree. I saw the demo video for it (dated back in 2014) and saw how simple it was to make a tree.

    Seeing this paid application in action raised a question for me and that question is this-Does this Speed Tree software eliminate the need to model trees in, lets say, Maya? I noticed that when I modeled my pine tree and brought it into Unity and noticed the wind zones were not making my tree move and I was wondering why? Was it possible back then to model your very own custom tree from scratch, texture it and bring it into Unity and apply some sort of movement to it from a wind source? Is it only possible to add movement to a tree object that was created within Unity or Speed Tree?
     
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,244
    Depends on what kind of tree you want. I'm talking primarily about the visual style.

    Is your tree rigged?
    Did you make it a form of stiff ragdoll?
    Or did you write a script that allows for tree mesh deformation?
    ...
    Or did you just make a bare verts and tris model of a tree and expect everyting to work?;)
     
    theANMATOR2b likes this.
  3. Thenewguy

    Thenewguy

    Joined:
    Jan 16, 2013
    Posts:
    4
    I have no idea why I didn't think of that. It sure would be nice if it did what I expect w/o all the work, haha. I did some rigging for a character back in class over a year ago. Modeling it was a great learning experience. Didn't think of trees as needing that attention as well. Thanks. :D
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,456
    Speedtrees are meant to sway with the wind. Do you have a windzone in the scene?

    For this to work on custom geometry though, the tree needs to be properly set up to work with the shaders which is an entirely different kettle of aquatic creatures.
     
    theANMATOR2b likes this.
  5. Thenewguy

    Thenewguy

    Joined:
    Jan 16, 2013
    Posts:
    4
    I did include a Windzone within the scene and tweaked with the settings to get some kind of result. But as Mark pointed out, I did not have the model rigged. When I did export the model from Maya and dragged it into the scene within Unity, I noticed that the planes with the textured branches were oriented differently than I had placed within Maya. As if the image was rotated. I also noticed that the planes themselves, once inside Unity were still noticeable. Like a very faint hint of a boarder that represented the plane the image is mapped to. (Looked like a semi transparent plane). Once I started messing around with the shaders in Unity, I seem to have found a solution.

    It does kinda get annoying though trying to solve the problem, but that's learning. Once I found a shader what would corrected the orientation of the leaf/branch image, I then noticed the shadows were no longer being displayed for the leaf/branches, but then I found another shader that seemed to correct both annoyances.
     
  6. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,021
    Tree Creator trees AKA old school Unity Trees (different to speed trees) are setup for windzones as well.
    The wind effect weights are held in vertex colours. The different colours represent different weights and characteristics of the wind effects. The tree creator shaders, and other similar shaders would then process that data to produce that effect. The tree creator tool paints these vertex colours automatically when creating trees. There is a tool on the assetstore for importing custom trees and doing this automatically as well, but there are requirements you have to meet so that it can do that. I have never done any of this, and I know nothing about modelling, texturing, or shaders. Perhaps looking at the asset and its requirements will give you more clues as to what is going on.

    https://www.assetstore.unity3d.com/en/#!/content/21079
    https://www.google.co.uk/search?q=unity+custom+tree+wind&rlz=1C1KMZB_enGB576GB576

    I remember seeing a blog and a video tutorial on how to get basic wind movement (probably by using the old tree creator shaders and just vertex painting). But be careful, I doubt many people are still using those shaders anymore. I don't even know if they are still compatible and being updated. Most people have either moved over to speed tree, are buying other tree packs with custom shaders, or are buying custom shaders that upgrade their tree creator trees so that they don't have to use those old shaders. Last I checked (years ago) they had very bad billboards that basically made them unusable and I'm not sure that they were compatible with the unity 5 fog. It seemed like unity had just given up on them and were pushing speedtree, and relying on assetstore publishers to maintain tree creator trees.

    I suppose you could just check them out though, to see if they have improved.
    https://docs.unity3d.com/Manual/class-Tree.html
     
    Last edited: Dec 22, 2017
unityunity