How to approach a custom LOD distance calculation?

I’m working in VR and it’s extremely obvious whenever LODs change in response to camera movement. If assets are distributed evenly in a given map, there’s always some object sitting right on the border between LODs, and moving your head an inch forward and back will cause it to flicker. In experiences where the player stands still for any length of time, they’ll inevitably trigger this over and over until they can’t help but see it happening.

What I would like to do instead is modify how the LODGroup works so that its distance is relative to the transform of the playspace origin rather than the camera, or, alternately, to only update the distance when the player teleports or spawns rather than every frame.

So far my best attempt is to add a script alongside every single LOD Group which subtracts the distance from camera to target transform and applies it to the LODGroup.localReferencePoint. This happens every frame for every LODGroup, and it still results in flickering somehow, though in my testing it was at least locking the LOD level in general.

Looking for advice on how to approach either of these tasks:

  • How would I change the camera reference transform for LOD distance calculations?
  • How would I change the update frequency for LOD distance to update on custom events?

You could write your own LODGroup component based on the CullingGroup API, but it’s quite a bit of work. Also, you’d lose the blend effect (dithering) between LOD levels.

1 Like