Search Unity

What do you think about Speedtree system integrated with unity ?

Discussion in 'General Discussion' started by Developer007, Jul 8, 2014.

  1. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    Elbows... got any words of wisdom to share? I recently got several of the trees from sales and going to start to implement them into my scene. Are you using rtp also? And day/night systems? Tricks on getting the trees looking awesome?
    Thanks And looking forward to any info you share.
     
  2. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Ok I didn't see a post in the forum yet, so let me throw this out there: Try adjusting the curve of the level 2 LOD branch volume threshold (the blue curve, under frond size scalar) Set it to max and boom. You should see all the leaves connected. But you'll also see the triangle count double for the whole tree.

    If you look at the default model you'll notice that there are around 8k triangles, by changing the branch volume threshold it has nearly doubled.

    Creating these floating leaves is a way to fill out a tree making the tree overly expensive. many times in a game with good placement, you won't even notice the leaves. When randomizing, you can either switch to node edit and move these leaves around to hide or delete them or add that branch volume back in. Either way, randomizing basically puts all the math in a can shakes it up and spits it out. Sometime's it looks great but sometimes you'll need to do a few tweaks to get it looking right, moving a branch here or there, deleting a random one that sticks out too far or some other. Math has never seen a tree before, so it's not a good judge of esthetics.
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I wish I had great words of wisdom to share. But I was using them in one specific scene for a project and they just looked pretty great out of the box, in the context of that scene. It was a scene where the sky and lighting was provided using the excellent Time Of Day product from the asset store. I was using deferred rendering, and all of the available Time Of Day effects that are attached to the camera. When the scene was at night, I cranked up the moonlight intensity, and some of the trees were also lit by street lights that were a deliberately exaggerated orange colour.

    I was more than happy with it, but I'm not going to pretend that it felt like Speedtrees were working well in absolutely all lighting conditions or that the integration with Unity has reached its final destination. There are some issues and I don't have any proper fixes, just got to try to work round then until someone nails it. In the meantime I recommend playing with lighting and post-processing effects (e.g. SSAO seems to make quite an instantly noticeable difference to the leaves, but whether in a good or bad way is in some sense an art style decision).

    In terms of issues, I think they fall into at least three different categories which will influence the possibility of having them solved, and how quickly. Some are down to what the Speedtree modeller actually produces (e.g. PBR textures or lack thereof). Some may be down to speedtree-specific stuff in Unity (e.g. the shader) that could maybe be improved in some ways. And others may be down to specific parts of Unity that may have to wait for a larger Unity overhaul such as the terrain system revamp that sounds like its on the cards at some future point. One way to determine which category particular issues may fall under is to compare Speedtrees in Unity with UE4's implementation.
     
  4. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Sorry, Danny. My daughters had art lessons this afternoon so was busy with that and the oak pollen is horrid right now, so my allergies/asthma have been acting up. I forgot about the trees. :)

    The floating branches were quite obvious and were floating out beyond the main scope of the tree. :) They would not be easy to hide. I did attempt to delete them but I found so many in one tree that it became tedious. The thought I would have to do that with every tree was overwhelming.

    I will try what you suggested but I don't want super high poly trees. Seems to me if you have a randomize button and you tell us that if we use the modeler it is easy to make variations of that tree, the one we purchased from Speedtree, that they should work without floating branches. Below is a picture of one of the trees I randomized in the modeler.



    I will post on the forums. It would be nice to find a solution to this without having to double the polys. :)
     
  5. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I had this too, but it turns out the "ambient intensity" was 0 by default. Adjusting this higher made the shadows look correct.
     
  6. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Yes, I was able to make it work by adjusting the ambient. :) Thanks.
     
  7. TobiUll

    TobiUll

    Joined:
    Feb 22, 2015
    Posts:
    73


    I am still not sure about this image. Is this Unity?
     
  8. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    No, I'm fairly certain this was not done in unity. It was done several years ago by one of our artists who now works at Bungie.
     
    Stormbreaker likes this.
  9. TobiUll

    TobiUll

    Joined:
    Feb 22, 2015
    Posts:
    73
    Thank you. Do you think it will be possible to achieve the same in Unity 5?
    Do you think it is a question of shaders?
     
  10. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Unity 5 is very powerful and I think that we're just starting to see some of the amazing visuals it's capable of producing. Can you reproduce this exact scene? I don't know, possibly. I don't know Unity 5 well enough to say how exactly one would achieve this, I do know that this scene is using hero level assets that would be very expensive to run in a game. Only way to find out is to give it a shot, right?
     
  11. TobiUll

    TobiUll

    Joined:
    Feb 22, 2015
    Posts:
    73
    Yes, I will try it when the current problems with the grass have been resolved:



    Right now it is not really fun to try anything out with this. :)
    I hope Unity and / or SpeedTree will solve this issue soon.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Nope, it's a question of art direction. It isn't even that impressive by today's standards. What makes it look great is the eye and choices of the person who did it.
     
    Ony and Ryiah like this.
  13. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I am still having the floating leaves issues when using the generator and this still really bothers me. Speedtree releases one tree model per package per species per season. My forests look odd with only one tree in the forest. Even rotating does not cover the obvious fact that there is only one tree.

    The Generator and the Modeler was a huge reason why I purchased Speedtree. Last night I spent a lot of time deleting floating leaves or trying to move them so they were not noticeable. I am betting that the first criticism I will get from my players is the floating leaves. Might not be important in a dense forest, but in our game, we can't have dense forests due to the performance. We are not targeting the super duper gaming machines.

    I did find a couple of references to floating leaves on the Speedtree forums but no simple fix from what I can see. I could make my own trees with the modeler but have already purchased trees that I would like to use.
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Teila, I believe the issue you're seeing is actually LOD.

    The leaves shrink as you get further away to transition to the next LOD without a dissolve. Dissolve is used for the final lod to billboard and this is typically what everyone wants.

    Depending on your world scales and camera you might need to adjust the lods manually so this takes place further away.
     
  15. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I thought this at first also, Hippocoder. But as you can see from the picture I posted above, the floating leaves are showing on the very first LOD, the one players see when they are close to the trees. I don't care about the other ones, honestly.
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I've shown you a video in pm. It illustrates it is actually the lod, even if it's lod 1, it's still transitioning to lod 2 at all times, so it needs adjusting.
     
  17. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Ahh, responded to you before I saw this. So even standing right under the tree, LOD2 is showing? Not sure I understand that but I will take your word for it and make some changes.

    Thanks!
     
  18. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It happens for me too, I think @Dannyoakes might have more insights on this. But for our default 1 unit = 1 meter world size it seems reasonably acceptable. If the trees are scaled bigger it might be different.
     
  19. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    No, they are not scaled bigger. I have not changed them at all from the original size. Oddly, the LOD's seem confused. :) I am having a difficult time changing them. One of our Skype group members did adjust them so I will check with him.

    Thanks! At least I see a way to possibly fix the problem. I think Speedtree's default LOD's are off.
     
  20. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    So, yes, the LOD is the issue, but it's not the overall LOD of the tree. The issue is how the LOD curve is set for level 2 branches, and it is intentional.

    First, here is some documentation on adjusting the curves: http://docs.speedtree.com/doku.php?id=modelingwithcurves Look for the section on LOD Curves.

    Basically, you can adjust how each level of the tree reacts to the different LODs. If you wanted all the leaves to disappear by the time you get to LOD 2, you could do that. Right now on the default River Birch model the level 2 branches are set so that some of them appear to be invisible even at the main LOD. This is a decision made to make the tree look more full without increasing the cost. If you notice the blue curve on the branch volume threshold the left end is not maxed out. By pulling that right side up, you will see all the missing branches appear and the leaves will no longer be floating but connected.

    Here is more information about LODs in SpeedTree http://docs.speedtree.com/doku.php?id=lod&s[]=
     
  21. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    But Danny.....it is not the purchased tree that has the issue. It is the generated ones made from the tree.

    I don't mind branches disappearing if you don't notice them. But when they are floating away from the tree, obviously not connected at all, that is a problem. If players can see it and they comment on it, then it is an issue and not very useful for my game. I did post a picture with such floating branches which show that at LOD0, floating branches are visible.

    Now, it could be the default LOD setup in Unity. I find that the default is really messed up. I plan to reset them and see if that helps and I will report back, this time with another picture. :) I am guessing it is something in the Modeler though but will see what I can do.

    I will check out the curves you suggested, but your explanation above does not quite fit what I am seeing. Again, floating leaves within the huge bunch of leaves in the purchased River Birch is fine. It is the floating leaves outside the main tree on the new generated River Birch that bothers me. I want to know how to make sure that the leaves do not appear on LOD0. I am not so bothered by them at the other LOD levels. :)

    Thank you for helping me on this. I really want to use Speedtree because they are gorgeous and I love that I can modify them. But I do think that leaves floating around in space with not even the appearance of attachment to the tree really can't work. Our game does not have magic! :)
     
  22. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Exactly! See, when it was modeled, the LOD levels were set such that the floating leaves were nicely tucked away, but they were actually attached to a branch it was just essentially invisible. Then when you hit randomize, it took the branches that the floating leaves were attached to and gave them a random length value. Now instead of being nicely tucked away, the floating branches are sticking way out in the open. Does that make sense? At no point are the are the leaves floating on their own, it's just that the branch they are attached to has a low lod threshold and is thus invisible.

    I took the river birch and randomized it. Usually, what I do is hit randomize a few times until I get one that looks good.

    Floating:
    floating.PNG

    Attached:
    Attached.PNG
     
  23. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Danny, I hit randomize dozens of times and never found one that did not have obvious floating branches. :) You must have gotten lucky or did not look at all sides of the tree. If you wish, I can make a video of my generating tons of trees, turning them and finding very obvious floating leaves.

    I get the LOd thing but how do I make it look good in the game?

    I am not trying to be difficult...I just really really want this to work!
     
  24. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    No, you misunderstood, I hit randomize and it DID have floating branches, that's the first image. Then I adjusted the LOD curves and the branches popped into place. The hitting it multiple times was simply to find one that had a decent overall structure. So to make it look good in the game there is a number of ways you could go about tweaking this, it depends on your needs. SpeedTree is designed to give you complete control over the trees you are creating, but there is a learning curve involved. I recommend continuing to practice with SpeedTree and reading through the documentation.

    To see things more clearly, try hiding the leaves (choosing the leaf hierarchy and hitting 'h') to see more clearly what is happening with the LOD curves on level 1 and level 2 branches. That should give you a better idea of how you may need to tweak things to get the desired results.
     
    hippocoder likes this.
  25. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Oh, and btw, you added more leaves. A 15k tree generated from an 8k tree is not at all useful to me. :) Sorry.
     
  26. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Nope. The leaves stayed the same. What happened the increase came from adjusting the LOD curve and adding the branches back in, not any additional leaves. Which is why they the threshold was reduced to begin with, to economize the tree. You're going to have to adjust the parameters to find the right balance that works for your game.
     
    hippocoder and Teila like this.
  27. Deleted User

    Deleted User

    Guest

    In Unity and to an extent UE4, the tree's always come out oversaturated and too bright. Quickest thing to do is de-sat tone the textures in Photoshop, only took 2 minutes to do it. Also for tris size, I can usually get away with cutting an 8K tree to around 4K by playing around with settings / amounts of leafs etc. Even back in the days of TreeD it was helpful to have less leaves and fronds then oversize them to fill the gaps in terms of performance.

    For grass meshes with Speedtree I managed to get singles down to around 45 tris each.

    I would like to ask Danny though, are these PBR correct textures? I was wondering if it was worth running it through substance2Bitmap and correcting them.
     
    Dannyoakes likes this.
  28. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    ShadowK, thanks. That is an excellent idea. I was changing the albedo in Unity but Photoshop would be faster. :)

    Danny, I will try that. I am doing 100 different things today, but will report back, hopefully with good news. :) I am determined.
     
  29. TobiUll

    TobiUll

    Joined:
    Feb 22, 2015
    Posts:
    73
    Yes, and if SpeedTree reads this, please don't forget the grass shader problem.

    Currently the "Desktop Ground Cover Package" is useless.

    Current version is Unity 5.0.0f4 with SpeedTree "Desktop Ground Cover Package 1.1":



    ps: Halleluja for SpeedTree adding the Hero models to the Packages! That is really very good. Now if the shaders are working, I will be happy.
    Andalso, the wind has a problem. Previously, it worked when I set "Wind Quality" to anything else but "Palm" or "None", but now it does not work at all anymore, no matter which "Wind Quality" I select. The grass moves once, then stops.
     
    Last edited: Mar 18, 2015
    GoGoGadget likes this.
  30. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I wanted to post that I did not have a problem with floating leaves when making random oak trees from the Young Oak model. So this may not happen with all trees. I have found ways to deal with it, mainly deleting floating leaves. :)

    Now I am having another issue. I made some bushes and when putting them in my forest, the lower leaves turned red in game mode. I tried turning off receive shadows, thinking that might have an effect and it didn't help. Moving the bush out in the sun did help a bit. I had fewer red leaves but still had some. I also tried with the Azalea bush to make sure it wasn't something I was doing wrong and that one had the same affect.

    Can we not use bushes or undergrowth in forests where they receive shadows?
     
    TobiUll likes this.
  31. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    The red leaves, and sometimes blue, were the result of the image effect Bloom. I changed from linear to gamma and it works fine.
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    just realized that the tangents of imported speedtrees have the wrong handedness giving you "flipped" lighting... at least if you use "standard unity normal maps".
    quite annoying…

    SpeedTree_NormalBug.png
     
  33. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  34. MaikenRoskilde

    MaikenRoskilde

    Joined:
    Mar 28, 2015
    Posts:
    22
    SpeedTree really needs to deliver something VERY good to keep up with the assets of MK4 and Nobiax / Yughues.
    A SSS shader is a must. I think else I think SpeedTree will not have a chance on the asset store because it does not deliver anything that would not be available for a much cheaper price.
     
  35. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I really like Speedtrees and will be disappointed if the issues are not fixed, either by ST or by Unity, whoever needs to fix them. They look great in my game, handle wind better than any trees I have tried, and the performance has been better for me than Unity trees. I also own the modeler and have made some of my own plants.

    I am disappointed by the issues with the flipped normals and the fades between LOD's.
     
  36. MaikenRoskilde

    MaikenRoskilde

    Joined:
    Mar 28, 2015
    Posts:
    22
    I am wondering what the SpeedTree guys are currently doing. Questions on their forum are left untained for 3+ days.
    If they are really working on a SSS shader for Unity or on other Unity fixes, they should tell us.
    Thanks.
     
  37. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    It takes a brave man to venture into forums like these. Good on you @Dannyoakes.

    I'm a little unclear on the relationship between speedtree purchased trees and the modeler subscription, as well as the time involved in modeler. I imagine that I am not alone on this and I've dragged my feet on picking up the subscription.

    Trying to build a project as a single developer takes a lot of time. Investing time in an external application that you aren't sure on the potential results is just dangerous. The price is obviously right, and the lack of a contract is great.

    I love the trees that I'm using from the packs. But obviously, there needs to be more variation.

    Is this the process: asset store tree -> modeler -> random variation.
    Or do you start from scratch in the modeler?
    Or do you not need to buy the packs in order to modify stuff from the modeler?

    Obviously I'm a little confused. A quick workflow video just showing the process from store bought asset into modeler and back would be nice.

    More than anything else, my concern is turn around time in generating variations.
     
  38. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    You can put a tree in the modeler and make variations. Be careful though. You will have to clean up your final new tree since you will often get floating leaves around the crown of the tree, and even far out from the tree. I gave up trying to fix this, using the tools I was told to use so just go and delete every floating leaf. It works, is tedious but far easier than building my own trees. It allows me to have as many varieties of the Speedtree species as I need. I can also make changes to the tree, bending direction, amount of leaves, etc. It is very nice but not without it's issues, as just about everything having to do with game development. :) I find the modeler to be worth the prescription. I am still on the fence about the price of the trees. If the bugs were fixed so they worked seamlessly with Unity, the prices would be fair, imho.
     
  39. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Roughly how long does it take to make a few variations on a given tree, let's say like 4-5?

    The output quality needs to be good, but doesn't have to be perfect.

    What I would be looking for overall is maybe about 50 different total variations. So I am willing to sacrifice quality for speed/quantity within reason.
     
  40. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    The first time, it took me a lot longer. Making the variation itself is very fast. You just open the tree file and push randomize until you get what you want. If you want to make changes, there are some sliders you can change which takes a bit longer. The most tedious is deleting or moving all the floating bits of leaves, which can take quite some time, depending on the tree. You have to do this for all the LODs. I can't tell you exactly how long to delete the floating leaves....depends on how fast you are. :)

    Some trees are worse than others. The river birch had a lot of floating leaves...the Oak tree not so much. I always miss some thing so have to go back and fix them.

    Danny did suggest ways to make that not happen but while they helped a little, they didn't really get rid of the floating leaves.

    Still...worth the time. I also made my own berry bushes and that was fun. Took a lot of time since I was learning as I went along but I enjoyed it. :) They looked fine when done..not perfect, but acceptable for my needs. I play to make more plants in the future. That part is really fun!
     
  41. MaikenRoskilde

    MaikenRoskilde

    Joined:
    Mar 28, 2015
    Posts:
    22
    @Teila Are you not waiting for an SSS shader from SpeedTree as well as they did for UE?
     
  42. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    floating leaves requires a different lod curve, did you try that?
     
  43. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Hippo, we have had this conversation before. :) I did try that, but the floating leaves happened even if I got rid of the other LOD's. Deleting them individually was the only thing that worked.
     
  44. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    No, I am not waiting....but then we are no where near finishing anyway. :) So the trees are in. I did use a shader I found here on the forum and it worked better than the original shaders. When and if there are new ST shaders, I will replace the prefab shaders and use the new ones.

    I am too impatient to wait. :)
     
  45. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    So they do have wrong tangent. . . . no wonder. . . i thought my eyes deceiving me :/
     
  46. GregCroft

    GregCroft

    Joined:
    Mar 9, 2015
    Posts:
    7
    Thanks for the report. I reproduced it here. It does seem like the tangents are flipped on the 3d geometry. Billboards seem to be ok.

    To tide you over until we can get a code fix out, you can make the following shader change in SpeedTreeCommon.cginc of the built-in shaders. This will do the same thing that the importer change will eventually do.

    Code (CSharp):
    1.     OUT.Albedo = diffuseColor.rgb * IN.color.rgb;
    2.     OUT.Gloss = diffuseColor.a;
    3.     OUT.Specular = _Shininess;
    4.  
    5.     #ifdef EFFECT_BUMP
    6.         OUT.Normal = UnpackNormal(tex2D(_BumpMap, IN.mainTexUV));
    7.         OUT.Normal.y = -OUT.Normal.y; // add this line
    8.     #endif
    9. }
     
    John-G, Teila and frosted like this.
  47. MaikenRoskilde

    MaikenRoskilde

    Joined:
    Mar 28, 2015
    Posts:
    22
    I have done my duty and purchased 3 packages at all the full price.
    I will not purchase anything else until I see a real profit (namely, a good SSS shader).
    What I have purchased so far is not better than anything than the Manufactura K4 assets.
    Still I want to use SpeedTree.
     
  48. JamesL98

    JamesL98

    Joined:
    Oct 9, 2014
    Posts:
    50
    If i had lots of money i would spend it on speedtree
     
  49. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    If I had lots of money, and they fixed the bugs, and optimized it even further, I would spend it on speedtree
     
  50. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    For the record, I'm very pleased with the results from SpeedTree so far.