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

`LOD: Code supposed to be unreachable`

Discussion in 'Scripting' started by sebas77, Feb 10, 2016.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    Hi,

    does anyone have some extra info on this one? Reproducible with Unity 5.3.2, not with 5.2.2. I could find one inconclusive thread only and I can't reply in there.
     
    Twelv445 likes this.
  2. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    31
    I am also getting this error and can confirm I am only getting it with 5.3.2.
    I am using LodGroup on Static Meshes as well as SkinnedMeshRenderer. Other than that I have no idea, but am trying to do some tests on why.
     
  3. Danteneo

    Danteneo

    Joined:
    Oct 11, 2014
    Posts:
    3
    I confirm the same problem.
     
  4. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    awesome level of detail on how the problem is achieve in this thread... o_O:p
    (1 out of 3 isn't too bad I guess :cool: )
     
  5. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    31
    That's the thing, there doesn't seem to be any way to tell exactly what causes the problem. The error itself offers no references to scripts or gameobjects like usual non-internal error messages so no luck there either. If its any comfort though, when I compile the game and observe the debug logs there (I use this totally awesome free asset I found a year ago on the store: https://www.assetstore.unity3d.com/en/#!/content/12047 ) - The error seems to only exist in the editor so I actually wouldn't worry too much about the error as it seems to have no effect on the final product. Although I'd still like to get to the bottom of it somehow :D
     
  6. JuliusJ

    JuliusJ

    QA Minion of the month Unity Technologies

    Joined:
    May 20, 2015
    Posts:
    35
    Could you report this bug? Currently I'm investigating this issue but haven't been able to determine when and why it happens. The more repro projects the greater chance to reproduce and fix it.
     
  7. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    31
    I shall give it a shot, the problem is the project I have the bug in is about 70GB big (long story) but I will try and reproduce it in a new project and send it
     
    JuliusJ likes this.
  8. jamesflowerdew

    jamesflowerdew

    Joined:
    Apr 29, 2009
    Posts:
    10
    I'm not sure but I think it might have something to do with
    public void OnWillRenderObject(){
    as the water in my scene (Unity water) is generating this error with reference to this function.
    I have LOD objects in my scene but water is not in LOD.
     
  9. JuliusJ

    JuliusJ

    QA Minion of the month Unity Technologies

    Joined:
    May 20, 2015
    Posts:
    35
    I've suspected that this has something to do with reflections. Could you create a bug report and attach your project? In description, please include "LOD: Code supposed to be unreachable" so that I could find your report easier. Thanks!
     
  10. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I have the same problem. Numerous "LOD: Code supposed to be unreachable" messages during execution, and sometimes even in a loop in the edtitor. The bug also affects foliage in the scene which loses LOD levels, causing billboards versions of trees to turn up at close range, at low resolution and without shadows, etc. There's no logic to which tree instances behave like this, though: two identical SpeedTrees right next to each other may behave differently.

    Here's a screen shot: the palms in the foreground are billboarded and lack shadows; the palms a few yards behind them are full resolution and have shadows. LOD warnings in the console underneath.
    Screen Shot 2016-03-21 at 11.34.22.png

    Almost everything in the scene is LODded: foliage, trees, rocks, etc. Unity 5.3.4f1.

    I've filed a bug report and given it the name "LOD: Code supposed to be unreachable". The case # is 781502.
     
    Last edited: Mar 21, 2016
  11. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    31
    I couldn't replicate it in a new project, but it has dissapeared in another project after upgrading the speedtree materials with the re-generate materials button (per tree used). Have you guys upgraded your speedtree materials?Just checking - it might just be luck and has nothing to do with it, but would like to know what happens on your side.
     
  12. JuliusJ

    JuliusJ

    QA Minion of the month Unity Technologies

    Joined:
    May 20, 2015
    Posts:
    35
  13. sglindme

    sglindme

    Joined:
    Jun 30, 2015
    Posts:
    18
  14. JuliusJ

    JuliusJ

    QA Minion of the month Unity Technologies

    Joined:
    May 20, 2015
    Posts:
    35
    This means that it is going to be fixed in the future 5.3 release. 5.3.6f1 should have this fix but it might also be available before that.
     
    karl_jones likes this.
  15. Twelv445

    Twelv445

    Joined:
    Feb 22, 2013
    Posts:
    31
    Thanks! Thats great news. Out of interest what caused the error?
     
  16. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,228
    The error is caused when the distance is exactly equal to the max distance of the LOD :eek:
     
  17. terravires

    terravires

    Joined:
    Mar 27, 2013
    Posts:
    103
    @karl.jones I'm getting this in 5.4.0b16, shouldn't this have been fixed in 5.4?
     
  18. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,228
    The fix is currently on the way, it's been stuck in a large batch that have been delayed quite a bit. Its on the final.push now.
     
  19. kulesz

    kulesz

    Joined:
    Jul 1, 2012
    Posts:
    138
    I there any ETA when it'll be live?
     
  20. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    This still hasn't been fixed as of 5.4.b20. It basically breaks LOD. After it occurs, some camera angles will show LOD0 and others LOD1, while being at the same distance.
     
  21. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,228
    It went into the backport queue this week, it got held up for a long time by other fixes it was batched with(lesson learned!).
    Should be in the next week or 2.
     
    sfjohansson likes this.
  22. blackeyesboy

    blackeyesboy

    Joined:
    Mar 23, 2016
    Posts:
    2
    I have the same issue,but it happened when I scale the tree (builded by unity tree creator)too small then it shows.
     
  23. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,228
    The fix is in next week's patch 5.3.5p5.