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

Level on detail on based on Android devices

Discussion in 'Android' started by UVRadiation, Jul 18, 2011.

  1. UVRadiation

    UVRadiation

    Joined:
    Jul 21, 2008
    Posts:
    183
    Hi ppl,
    I am trying to determine what would be the best way to choose level of details on android devices,
    by choosing the LOD i can determine whether or not to use cpu intensive visual effects
    on iOS I am using the following code :

    Code (csharp):
    1.    
    2. #if UNITY_IPHONE
    3.     switch(iPhoneSettings.generation){
    4.         case iPhoneGeneration.iPodTouch1Gen :;
    5.         case iPhoneGeneration.iPhone: lod  = 0; break;
    6.         case iPhoneGeneration.iPhone3G: lod = 2; break;
    7.         case iPhoneGeneration.iPodTouch2Gen : lod = 3; break;
    8.         case iPhoneGeneration.iPhone3GS : ;
    9.         case iPhoneGeneration.iPodTouch3Gen :;
    10.         case iPhoneGeneration.iPad1Gen :;
    11.             lod = 5;
    12.             break;
    13.                default :
    14.                       lod = 5;
    15.     }
    16.     #endif
    17.     #if UNITY_ANDROID
    18.          // to be added
    19.     #endif
    20.  
    I thought about selecting by device resolution but f.e my NExus 1 is the same resolution as Samsung galaxy S but is much weaker.
    I'd love to hear your thoughts on that,
    Thanks!
     
    Last edited: Jul 18, 2011
  2. Harry1960

    Harry1960

    Joined:
    May 15, 2007
    Posts:
    136
    You can check the fps rate for about 5 seconds when you game starts and disable features if the current frame rate on falls below a certain value. This works fine for all builds (OS independent) if the user hardware is unknown.