Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 5 - Tree Performance and some thoughts on speedtree.

Discussion in 'General Discussion' started by jc_lvngstn, Mar 9, 2015.

  1. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    First, is it just me or is adding and removing trees to the built in terrain system much improved in performance, possibly due to Physics changes? Just curious if anyone has noticed this. I may need to create a 4.x project, test it, and then compare it to the 5x version.

    Anyway, I think the new speedtree trees are very nice. I do have a couple of concerns though.
    • They can be draw call heavy for all the nice frills. The desktop broadleaf has 5 passes per tree, but this is for the tree and root blending with the trunk (which really looks nice), facing leaves, fronds, etc. The issue I have is, these are present on the lower detail models also. I think I could easily give up blending and some of the other passes for distant trees. I need to work more with the modeler to see if this can be done.
    • I wanted to bonk my head on my desk. Even with speedtree, you still...don't...have...capped...trunks. Arrrrgghhhhhhhhhhhhhh. So if you want chopped down trees...you have to find some work around. And since exporting the models straight from speedtree, to work with in blender is a no no...I guess I'll need to work up a script in unity (or something) to procedurally cut the tree, add the chop texture at the bottom. My frustration is...just like in Unity's trees, branches can be capped. How dang hard would it be to support capped trunks?!
    • The modeler is very nice, having many features and is fairly intuitive.
    As far as chopped down trees, I'm frustrated this same thing keeps getting left out. In the LOD0 for this tree, I can see that it's got 5 submeshes, the 4th of which is for the caps (it uses the Fronds_2 material). If nothing else, maybe scripting can add a cap to the bottom also, and dump out a chopped tree without the stump portion.
     
    Jaqal likes this.
  2. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Are you sure SpeedTree doesnt support chopped trunks? I am 99% sure that SpeedTree has function where you can cut tree trunk lenght which atuomatically creates cap and adds secondary texture. Was either ST or that other plant modeling software not sure.
     
  3. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Well, I'm not sure if this is exactly what you're asking for but if you select the spine of the tree in the modeler and increase the break chance it will create a stump with a cap automatically assuming you have the cap texture in place. Use the break spot to control where along the spine it breaks.

    Does that help?
     

    Attached Files:

  4. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Yes, you can create a cap on top of any spine. At issue is one at the bottom of the trunk. Basically, if you have a game where you chopped trees down, I haven't seen yet where you can put a cap at the bottom of the fallen tree trunk, and not see up into the fallen tree.
    I'm not talking about the stump. I mean the fallen tree.
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    Have you experimented with large numbers of trees? I had an experiment running a few beta versions back that filled the scene with thousands of SpeedTree trees (via the terrain engine) and was having some real performance issues when it came to SpeedTree distance billboards. As a comparison, the same scene and algorithm filled with normal unity trees was running at 60+ fps (when most trees were billboarded) and the same view and algorithm with SpeedTree billboarded trees cut that down to 25 fps :(

    I sooo want to use SpeedTree as they look and work so much better, but the billboard performance was disheartening. Just wondering if I am alone in this issue :D
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Having a spot of bother with enlighten and speed tree at the moment. According to UV Charts, the trunk has bad enlighten uvs. Any solution?
     
  7. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Right now, we don't really have a good solution for bottom caps, but we're going to look into adding something in. I'm sorry I don't have a better solution already built in but it's not something that we get a huge amount of requests for and so we've never built it into SpeedTree, but seeing the amount of games requiring tree chopping these days. We can add it to the list of new features we are working on but I don't have a time line for when it will be implemented.

    Well, as far as performance goes there is only so much we can do, a lot of that has to do with the ongoing integration of SpeedTree and Unity 5, which is only going to get better but is ultimately not entirely in our hands. In the meantime, can you provide some specs on how many trees, size of the map, etc?

    The good news: This is only the beginning. As we keep going things will keep improving and getting better as we keep going with he integration.
     
  8. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    This is an issue that again, I wish I had a better answer for....but it is being worked on and everyone is aware of it. Hopefully, we'll have this worked out soon.
     
  9. Deleted User

    Deleted User

    Guest

    One of the things I've had issues with is LOD's on grass meshes, Trees are fine for me in both performance and look. But the grass ones seem to have weird issues and can be a little heavy. For example rough grass goes black at a reasonable distance whereas (I think it's snake weed) goes bright white.

    It looks great close up, I messed around with the normal maps and it didn't really do much.
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    afaik unity's own grass seems to work fine in our tests, just not speedtree stuff. In fact i'm not sure either solution is particularly quick for grass.
     
  11. Deleted User

    Deleted User

    Guest

    If you use Unity's texture based billboard solution, yeah runs like a dream. It's just SpeedTree Grass meshes, speedtree do grass as well matey called speedweed ;)..

    Take that as you will.
     
  12. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Speedweed eh? i remember the glastonbury years fondly. Actually I don't remember much so it must have been good.
     
    Ryiah and Deleted User like this.
  13. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    Yep, this makes sense, its a matter of integration. It's being worked on :)
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Oh great news danny, thank you. Any ETA on grass being faster to render, and will it beat current unity grass rendering? Thanks for any response!
     
  15. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    Thanks for the responses, Danny! I'm there aren't a huge amount of requests for it...the number of games where you need to have a broken tree are probably small. But not having this feature means I have to find a scripting solution and copy and alter the mesh (possible, still making it) or not being able to use speedtree at all. That would be very unfortunate.

    Honestly, I expected speedtree to have lower performance due to the draw calls, but I could also give up some features and probably lower those. I haven't done a side by side comparison betwen 4x, 5x default and 5x speedtree trees.
     
  16. Dannyoakes

    Dannyoakes

    Joined:
    Feb 10, 2015
    Posts:
    118
    I don't, unfortunately. Wish I did, but I don't have any of the timelines for these updates. Hopefully updates will keep roling out (knock on wood). If I get a solid timeline I'll let you know.


    Yeah, honestly the amount of crafting and open world games has increased demands for certain features that before may have been considered unnecessary. Before the likes of Rust and The Forest, how many games had wood chopping as a gameplay feature? It won't be an immediate change one way or the other, but I've made a note to the guys that its been requested.
     
    hippocoder likes this.
  17. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I'm with jc_lvngstn on this one. My game has tree chopping too (for gathering resources and whatnot). Although it doesn't NEED to be that detailed in my particular case, it would be better if it was of course.

    Right now, I'm simply plopping down a stump at the location where the tree was "chopped down" at. But when I make the tree fall over, you can sometimes see up the trunk of the tree from the bottom (using SpeedTree trees of course).

    I still havn't figured out how to make a tree split at a certain location on the tree and match where it was chopped at perfectly with the bottom portion of the split. But that's my own problem, and for another day. Overall, having SpeedTree trees and plants in my game is better than not having them, for sure. I'm really liking them -- although I do hope they continue to try to work on performance as well. It's always hard to weigh eye candy vs. performance though.

    Thanks for the replies as well Danny.
     
    Dannyoakes likes this.
  18. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,077
    I'm considering dropping SpeedTree at the moment for my game.



    The trees look amazing and I'm impressed with how beautifully they transition between LOD and billboards. It's hard to even see the transitions unless I'm really looking for them. Just great and the trees SpeedTree puts out in their packages are really impressive looking. Easily more than I need. But like others have noted, the performance even when most of them are just billboards is just not anywhere in the same ballpark as the Unity trees. If I replace the trees in the scene in the video above with Unity trees I can get 300 or 400 fps and maybe only 150-200 with SpeedTree even though most of them are just billboards most of the time. So it seems like about half the frame rate or less when it's SpeedTree billboards. Maybe it's all the fancy dithering stuff slowing it down a lot, I don't know.

    One thing I've noticed with SpeedTree is that the billboards are not just simple quads, they seem to be several. Not sure how much that has to do with performance, but last time I checked, there were several times as many polys in a SpeedTree billboard scene as there in a Unity tree scene. Lots of extra geometry in there.

    Another thing I've noticed is that Unity is working pretty hard to batch all the SpeedTrees but not the Unity trees. I'll have something like 8000 "saved by batching" with SpeedTree and less than 100 with Unity trees in this same scene. Not sure, but I would suspect that's where most of the performance difference really is in my case.

    The performance would be just fine with SpeedTree in my case if I wasn't targeting this for the Oculus Rift. That 150-200 fps on a regular monitor drops to unacceptably low levels in the Rift a lot of the time. Sometimes it's ok, but it's really pushing the limit, and this is after I've spent quite a bit of time tuning the SpeedTree LODs and so forth to get everything running about as fast as I could.

    Right now I'm looking for Unity trees to populate my scene with. If I can make or find stuff that looks good enough there, I'll probably drop my SpeedTree subscription until billboard performance can be brought more in line with Unity trees. It'd be a shame because the SpeedTree stuff looks so much better, but with the Rift, performance is an issue for my scenes.
     
  19. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Since performance is main thing going here and those questions I want to ask doesn't deserve their own thread, I'd like to ask it here:

    1. How performance of trees made say in Blender compares to Speedtrees and Unity trees?
    2. Since obviously a tree made in 3D modeling software would be basically a 3D model, does Unity generate lod levels for models as well and how to enable it?
     
  20. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,077
    1. The only thing that comes to mind is that you're getting billboards with Speedtrees and Unity trees. I don't know for sure, but I can't imagine that Unity automatically generates extra models and does the billboards for Blender models.

    2. Again, I don't know for sure, but I'd be surprised if it generated LOD levels for you. Those are separate models.
     
  21. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    I'm really on the fence, but I am probably going to have to go back to custom trees.
    The modeler is awesome and makes great looking trees. But the trunks are open at the bottom which is a problem.
    I really like being able to mix billboard leaves with fixed ones. I like that the trees themselves can be tuned and still look good. However. It seems to me they don't look NEAR as good in unity as they do in other engines.

    Performance in general is an issue.
    I do not like how locked down the software and results are. I didn't realize you couldn't sell trees you create with the subscription. This seems a very restrictive rule. Nobody's fault really, but this is not something in place that empowers subscribers.

    But my need for a large number of trees in the scene is probably not that common.
     
  22. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,784
    You'd be surprised... :)
     
    Jaqal likes this.
  23. jc_lvngstn

    jc_lvngstn

    Joined:
    Jul 19, 2006
    Posts:
    1,508
    You're probably right :)
     
  24. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    838
    So glad I found this post, that way I did not waste money on Speed Tree... I will wait until they fix it, which sounds like it my not be for awhile.. I used SPeed tree many times before, but never with chopping trees which my game requires.