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

Question Is it possible to manually initiate LOD updates?

Discussion in 'General Graphics' started by Ben_at_Work, Jun 5, 2023.

  1. Ben_at_Work

    Ben_at_Work

    Joined:
    Mar 16, 2022
    Posts:
    56
    I'm working with VR experiences in URP, and the flickering between LODs is much more apparent due to the 1:1 connection between your head movements and the camera. Since my particular use case is primarily standing still, it's more likely that users will spot the change than if they were in constant motion.

    So what I've been wanting to do is to exclusively update LODs when the user teleports or when we're loading them into levels so that we can still use the basic LOD system and keep the door open to limited exploration while reducing the footprint of LOD checks and avoiding the flickering near thresholds.

    I am open to other alternatives, but being able to choose when LOD updates occur is the current mechanism I'd like to mess with. The LODGroup script reference says that disabling it will turn all renderers on, so I can't turn it on and off in bursts. I could force the LODs, but that requires remaking the basic LOD algorithm which is more than I can chew off right now.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,823
  3. Ben_at_Work

    Ben_at_Work

    Joined:
    Mar 16, 2022
    Posts:
    56
    Thanks.

    Controlling the reference point does seem like the most painless way to solve the problem, though there's some potential performance to be gained by stopping the LOD update entirely. It provides the behavior at least even if the false reference is being continuously applied every frame. For teleport based movement I can leave the point in place at all times. For joystick movement, the delayed smooth follow would be preferred. Could be potential for a baked probe style approach at that point.

    Forcing the LOD could maybe get closer to the performance improvement since it effectively pauses some part of the system until you release it with a (-1). I could use a script paired with the LODGroup that gets the active LOD and reapplies it via ForceLOD in order to pause and unpause the calculations as needed. Looks like the GetLODs is just a list of all the individual group's options rather than the current one so I'd need to figure out a getter. I'm not sure how much of the LODGroup's update cost is actually saved, either.

    I'll test some options when it rises to the top of my priority list. It's been on my mind and wanted to get start collecting some insights so I can try it.