Search Unity

Max Mesh Trees setting broken?

Discussion in 'Editor & General Support' started by Dan Deibler, Jan 23, 2014.

  1. Dan Deibler

    Dan Deibler

    Joined:
    Mar 13, 2013
    Posts:
    16
    We are using Unity 4.3.0f4 (Pro, if that matters; DX11 mode, if that matters).
    In trying to track down a major performance loss (from 60 fps to 20 fps) between 3.5 and 4.3, I noticed that the loss scaled with proximity to forested areas, which led me to discover that the Max Mesh Trees setting on the terrain no longer had any effect. To rule out a corruption of the terrain asset, I created a new scene with a new terrain, painted trees on it and confirmed that the Max Mesh Trees setting had no effect.

    This is a major game-breaker as the only other way I can see to limit mesh trees is to adjust the billboard distance, which would only work if the trees were uniformly distributed throughout the world. I've tried to find settings that work both while driving through wooded areas and while in areas a little distant from wooded areas, but the best I can manage is a somewhat improved performance loss in the woods at the cost of treelines turning into ugly billboard rows when viewed from any significant distance outside the forest.

    I don't find any other threads about this and would like to confirm that this is a bug in Unity 4.3 and the changelogs don't indicate this being fixed in 4.3.1, 4.3.2, or 4.3.3. Does anyone else observe this? If not, what version are you using, and are you in DX11 mode?
     
    Baldinoboy likes this.
  2. John-Silver-Long

    John-Silver-Long

    Joined:
    Feb 14, 2013
    Posts:
    11
    i also found out this bug 6 weeks ago orso i have send a bug report and hope it would being fixed next patch but could not find anyting about a fix on the latest release notes. :(

    i still hope they fix it soon since its causing crappy performance.
     
  3. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I think I might be hitting this same bug.
     
  4. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    I think so too.

    In Unity 3 and early 4 i have an open world terrain, many trees and grass, no problems running on IOS.

    I upgraded to 4.3 and now even 1 terrain tree slows down everything to be unplayable. With zero trees i can still have a large terrain and lots of grass and things are silky smooth. This leads me to believe that it isn't just the amount of mesh trees on the scene because the billboards appear to be working, but something that as soon as you place any terrain trees now something is added or broken that does not cull trees in memory like it did before.

    Even if i add 16 trees and change tree distance to be very close, so they only appear about 30m away and are hidden beyond that, the slowness is still there. So it's not like the number of trees matter, just if terrain trees are activated at all or not.

    I'm going to keep developing under the presumption that this will be fixed. Sometimes things break during upgrades and Unity is usually pretty good about fixing these things.

    I'm also going to try setting Max Mesh Trees from a script to see if that will make it kick in.
    http://docs.unity3d.com/Documentation/ScriptReference/Terrain-treeMaximumFullLODCount.html

    @Dan I don't know if I'm in DX11 mode but ill check. I don't think so because it's an IOS project.

    Ill send a bug report too.
     
    Last edited: Jan 27, 2014
  5. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    OK so i did some troubleshooting and it looks like it is a 4.3 issue

    Both of these are tested on iPhone

    Currently using Unity 4.3
    Opened and upgraded 4.15 version terrain project with terrain trees to 4.3 and frame rate is very choppy
    Removed all trees (left details) and frame rate is smooth

    Downloaded unity 4.15 and reinstalled it in a separate folder
    opened original 4.15 version project with terrain and trees
    Smooth even with many trees active

    So...

    For the moment I'm going to

    a) see if Unity 4.2 has the same bug
    b) export my 4.3 project essentials (terrain, trees) into packages and import them into my 4,15 project so i can continue working
    c) come back to Unity 4.3+ once the issue is fixed

    Update:
    i tried 4.3.3 and 4.2.2 (the last 4.2 version) and the theory plays out. 4.3.3 has choppy trees and 4.2.2 is smooth.
     
    Last edited: Jan 28, 2014
  6. alln2themusic

    alln2themusic

    Joined:
    Feb 3, 2011
    Posts:
    46
    Dear god could we please get a response from the developers that they're aware of this and it'll be fixed pronto? This types of game breaking bugs need to be high priority.

    It definitely seems like a hit or miss bug, so I'm using the Ultimate FPS extension and it definitely affects that FPS Controller alot more than the standard FPS Controller with Mouse Look. Sometimes the slow down occurs, sometimes it doesn't. I haven't figured out yet what causes it to kick in exactly, but when I do I'll definitley post it so the bug can be reproducable.
     
    Last edited: Jan 29, 2014
  7. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I posted about this in UltimateFPS and here; it's a related but different issue. The Unity CharacterController has some bug that causes terrible performance if you enable tree colliders and have a lot of colliders, even if you turn off collision with them in layers or place the controller far away from any trees. UFPS uses the CharacterController. so it inherits that bug from Unity. Unity appears to be abandoning the CharacterController, since its new beta Standard Assets use Rigidbody for both their first person and third person controllers. I don't think there's any chance to get Unity to make any fixes to CharacterController; it's been kinda buggy for a while now. I think they're more likely to remove it once the new Standard Assets get added.
     
  8. BlackMill-Games

    BlackMill-Games

    Joined:
    Apr 16, 2009
    Posts:
    2
    We experience extreme performance issues in Verdun after the 4.3 update. After thorough optimizations we discovered that overhead in the terrain tree culling is causing massive GPU spikes when rotating the camera (terrain culling recalculation).

    So not only is the max tree setting broken, the culling under the hood is broken as well. This requires ASAP hotfixing.
     
  9. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    This is painful. The terrain tree system is not usable right now in 4.3. Any updates on the bug reports?
     
  10. Dave-Hampson

    Dave-Hampson

    Unity Technologies

    Joined:
    Jan 2, 2014
    Posts:
    150
  11. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    Done. But it's not just that. Setting the billboard start from 50 to 1 doesn't improve performance to any noticeable degree in my test scene. With dense grass I'm on 80fps, when I add trees I drop below 30, and the tree distance is only 450. Something else is very broken.
    See previous posters comments


    Note:
    This is not related to the UFPS/tree colliders issue, as it performs the same with a different controller.
    The UFPS issue is fixed by attaching a rigidbody so that it does not become a moving static.
     
    Last edited: Feb 20, 2014
  12. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    Yes, this is a real issue for us too. We have several of our clients apps running successfully on 4.1x, but since upgrading to 4.3 it has rendered our apps unusable, so we have not been able to release updates for them. We are also on a pro version of Unity.
     
  13. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    I can only confirm this bug. It appeared after updating to the newest Unity version.

    It seems like it has nothing to do with max mesh trees. I can set this value to zero and also setting billboard start to 1 so there are practically no mesh trees around it it takes 12 ms to calculate (only one terrain).

    A screenshot of the profiler is attached. It seems like Culling -> Terrain.Trees.Render is causing the problem.

    $Terrain Trees Render.PNG

    Why is there no attachment?

    EDIT: Ok, I started a new thread because this basically has nothing to do with the topic mentioned here.
     
    Last edited: Mar 3, 2014
  14. Brenden-Frank

    Brenden-Frank

    Joined:
    Aug 5, 2012
    Posts:
    110
    Confirmed, the biggest problem for us is that our game is forced to use the latest version in order to release on consoles while supporting the latest Sony and Microsoft SDKs.
     
  15. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    I just tested my game in Unity 4.5 and this has been fixed. trees on terrain are no longer slowing my game to a crawl. Thats great because ive avoided upgrading to 4.3 and 4.4 because of this. If you upgrade your projects please be sure to back them up before you do in case you need to go back to an earlier version.

    EDIT: I spoke too soon

    It's fixed for iPhone 5S - but i just tried it on iPhone 5 and the 2 frames per second returns, even with a single tree. It's not the processing power of the phone because tons of trees work great on both phones in Unity 4.2

    I tried it with forcing Open GL ES 2.0 as well.

    For now I'll stick with 4.2 and hope this will be fixed in 4.6
     
    Last edited: May 27, 2014
  16. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    I honestly have a bad feeling about this... The bug has been posted several months ago and absolutely nothing has changed. They are talking about a release with the highest amount of bug fixed and didn't even care to fix a real problem like this.

    I'm really not happy with just hoping it will be fixed in a next release that problably won't be there in the next months.
     
  17. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    The funny thing is I'd think tons of people are using unity terrain and trees but i guess not. Yeah, my concern is that i wont have access to things like IOS8 deployment soon if i need to stick with 4.2

    Its interesting that it works on 5s and not the 5. Its like SOMETHING was fixed between them, but i cant imagine its just an issue of raw processing power of the 5s that is over coming the problem. Anyways ill go file a bug report. I love Unity A LOT and I hope to be able to upgrade soon

    EDIT: Filed a bug report:)

    http://fogbugz.unity3d.com/default.asp?611017_m8ban080lj776h0r

    My older bug report for the same issue is here:

    http://fogbugz.unity3d.com/default.asp?587905_i12j8cb5ee57ue2v
     
    Last edited: Jun 1, 2014
  18. NoCubes

    NoCubes

    Joined:
    Jun 7, 2014
    Posts:
    1
    Im getting the same issue, its unbelievable that unity terrain trees no longer work for iOS. i carnt believe more people are not having this issue. Just one tree brings unity to its knees. so far we have wasted at least a week of man power trying to fix this massive issue. its been broken for over a year now and still no fix in sight.

    If unity carnt fix it they should at least update there release notes waring people that unity no longer supports trees.



    Ive tried publishing from mac and pc but no luck.

    Andriod does not seem to have the same issue only iOS
     
    Last edited: Jun 7, 2014
  19. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    Unity 4.5.2 is out - I'll test to see if IOS terrain trees if fixed in this release (fingers crossed)
     
  20. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Hi protopop, what's the result?

    I did not find anything about it in the release notes so I guess it's not fixed.
     
  21. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    I didn't get a chance to test it yet - updating the project is a multi-hour wait;) - but I want to find time this week.

    Unity 4.5.0 with trees on IOS worked for me but only on iPhone 5S, and the performance was quite a bit slower than Unity 4.2 trees (and unplayable on iPhone 5 which was smooth as butter in 4.2) so although they fixed something, it seems to be relying more on pure device power (the 5S is a beast) to solve the issue in the 4.5.0 "fix" than actually fixing the tree culling regression. But i'm hopeful for 4.5.2 and will post results as soon as i have them.
     
  22. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Okay, then this seems to be generally a different issue than the one I posted elsewhere.

    The multi hour waiting is the reason I don't want to try it, hehe. Upgrading my project takes at least 3 hours.
     
    protopop likes this.
  23. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    Unfortunately in my test it doesn't look like it's fixed.

    The good news is (plug) i just released my latest game BrightRidge https://itunes.apple.com/us/app/id885657108?mt=8


    Open world wilderness, Lots of trees, made in Unity 4.2, runs on iPhone 5 and up (unity 4.2 doesn't have the IOS tree bug)

    But I just updated it and tried it in Unity 4.5.2 and it's unplayable (3fps or so) on iPhone 5 and runs with a reduced framerate on 5S

    There's definitely an IOS Trees regression from Unity 4.3 onwards.

    Im a little freaked out because i have effectively been unable to update my copy of Unity since version 4.2 and until this regression is fixed I can't update without junking my game, which i've spent 3 years making (not a desirable option).

    That might be ok for another point release or 2, but with iPhone 6, ios 8 coming I'm going to be stuck using outdated version.

    I don't know what to do. I thought IOS trees was a tent-pole feature but support for it seems to have dropped.
     
  24. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    Just a few more details - as with earlier tests it's definitely just a problem with the Terrain trees, not the grass engine. I tested my app in Unity 4.5.2 on iPhone 5:

    1. With dense trees and dense grass: Unplayable
    2. With 1 tree and dense grass: Unplayable
    3. with no trees and dense grass: Smooth

    So as long as there is a single terrain tree the problem shows up. it isn't necessarily dependent on the number of trees but just if the tree 'engine' is invoked at all because all it takes is 1 tree.

    It will help if anyone who has this problem files a bug report - there's one here http://fogbugz.unity3d.com/default.asp?611017_m8ban080lj776h0r but ive also seen a few unconnected ones that describe this problem spread around.

    I want to say I really, really love Unity, and not being able to upgrade for the last 6 months is really bumming me out. I have a lot invested in Unity and many, many Asset store items. I really hope we get some news about this issue or at least some official feedback (or a fix:)

    UPDATE: there's a popular bug filed here: http://issuetracker.unity3d.com/issues/terrain-tree-culling-performance-regression

    If the issue affects you please vote
     
    Last edited: Jul 19, 2014
  25. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
  26. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Just received an email that says they "optimised the tree culling system" and it will be available in the future release. I am pretty sure this solves your issue as well. :)
    Now it seems we just have to wait until 4.5.4
     
  27. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,560
    Thanks for the update! my game is doing well in the charts and just got a great touch arcade review. Im working on updates so im praying this fix will work so i can upgrade from 4.2. Ive been stuck using it almost a year:) Fingers crossed....
     
    Jaqal likes this.
  28. HunterAhlquist

    HunterAhlquist

    Joined:
    Oct 6, 2013
    Posts:
    132
    this is still broken in 2020, what the h*ck
     
  29. sirleto

    sirleto

    Joined:
    Sep 9, 2019
    Posts:
    146
    "Max Mesh Trees setting on the terrain no longer had any effect."

    still happens to my with unity 2021 LTS.

    as some of the setting do only apply to Unity Tree Creator (which it determines by the prefab used not having a LodGroup !?!?) and others to "SpeedTree" Trees (so any modelled mesh, which it determines by the prefab having a LodGroup), i tried both and do not see any effect.

    maybe there is another type of object or situation in which it has an effect?