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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Runtime LOD Group distance

Discussion in 'Scripting' started by ldb, Jan 15, 2015.

  1. ldb

    ldb

    Joined:
    Apr 30, 2013
    Posts:
    40
    I am working on a project that will run on desktop and Oculus Rift. I have a bunch of objects, with LOD Group components attached. These are set to cull at say 10%. On the regular desktop version this is acceptable and works pretty well. But on the Oculus version it is culling too early, or rather, the percentage at which it culls needs adjusting.

    I can't seem to find a way to change the percentage values of when each LOD level kicks in via script. The LODGroup component only shows the number of LOD levels, but doesn't seem to allow for accessing and adjusting them. So far the only way I can see to do it is to use the SetLODs method, which I would rather avoid as I have quite a lot of different LODs/LOD groups already set up in the editor, and using SetLODs would mean creating all the separate LODs again in code, which seems overkill when I just need to adjust a single value.
     
    abhijeet1001 likes this.
  2. ldb

    ldb

    Joined:
    Apr 30, 2013
    Posts:
    40
    bump...
     
  3. abhijeet1001

    abhijeet1001

    Joined:
    Jan 6, 2015
    Posts:
    65
    on sameboat :(
     
  4. MichaelSchenck

    MichaelSchenck

    Joined:
    Sep 23, 2011
    Posts:
    49
    This is a little late but maybe will help someone. Do this at runtime if using the Rift:

    QualitySettings.lodBias = QualitySettings.lodBias * 3.8f;

    This works about right for me for the DK2 after setting up the LODs the way I like them on screen in the editor. I have no idea how this should change for CV1. I have not been able to get any answers about what LOD means in terms of the rift screen (resolution/optics and so on). If anyone knows please share!
     
    Mr-Logan and kideternal like this.
  5. ChosenZeus

    ChosenZeus

    Joined:
    May 1, 2014
    Posts:
    18
    Well how is this for late? You saved me from a pit of despair your numbers are a little off for the oculus go, but this is sorely needed I imagine, for ANY rift.

    THANK YOU!!!!

    ps its also in settings under Quality