Bug #1246818: lodBias from QualitySettings.asset is still used, but inverted

TLDR: Per bug #1246818, lodBias values defined in QualitySettings.asset are still consumed by HDRP projects, but the reciprocal of the value appears to be used. This is bad for people upgrading to HDRP 7.2, since those people probably now have incompatible lodBias values in their QualitySettings.asset.

Edit: I also opened #1247000: HDRP LOD Bias Mode of “Override Quality Settings” actually multiplies by Quality LOD bias. It seems that even when you choose “Override Quality Settings”, for LOD Bias Mode, it still divides the value entered by whatever is set in lodBias in QualitySettings.asset.

I’m running into two serious problems with LOD in a project I’ve recently migrated from Unity 2019.1 to 2019.3. I’m also confused by some of the recent changes to LOD in HDRP.

The patch notes for HDRP 7.2 include the following: “Hide unused LOD settings in Quality Settings legacy window.”

However, under Rendering section of the HDRP Default Settings, I see the following:

5839762--619924--upload_2020-5-13_1-20-47.png

So, these default settings allow me to use the LOD Bias specified in the Quality settings, yet the LOD Bias was removed from Quality settings? I don’t understand that. The LOD Bias is still stored in my QualitySettings.asset file. If I edit it, I can see the lodBias values ranging from 0.3 for worst settings to 2 for Ultra. And if I switch between Quality settings, I can see the LOD Bias on the HDRP Default Settings change to match that value.

So, if the LOD Bias value from Quality is still being used by the system, why can we no longer edit it? Are we supposed to edit it somewhere else? For a brand new project, the LOD Bias still appears in QualitySettings.asset, but it’s just set to 1 for all quality levels.

So, what’s going on here, and how are we supposed to be editing LOD bias per-quality level in 7.2+?

It also seems that having “legacy” LOD values in the Quality settings of anything other that “1” really hoses LOD. An easy way to see this is to set up an object with LOD, then (with the project closed) edit the LOD value in the QualitySettings.asset to some value other than 1. Reopen the project, and you should find that the LOD mesh swap occurs at highly unexpected values that don’t see particularly related to the specific bias that I picked. For example, a bias of “2” feels more like how a bias of 0.2 should probably feel. I made a video of this. It shows LOD work normally when the Quality level’s lodBias is “1”. But when the lodBias is “2”, everything goes wonky with the LOD:

What I’ve noticed is that the lodBias value in the Quality settings appears to cause it to try to swap meshes at the given percentage times the lodBias, which seems to be the inverse of how lodBias is supposed to work. So, in my video I have the LOD steps set to LOD1 at 51%, LOD2 at 30%, and Culled at 10%. But with lodBias at “2”, I believe the result is that it’s doubling these values for the transitions. That is, it’s trying to go to LOD1 at 102%, LOD 2 at 60%, and culled at 20%.

So, it seems that the system still has some dependencies on the current Quality level’s lodBias. But other than manually editing the QualitySettings.asset file outside of Unity (while Unity is closed), there’s no way to change the lodBias for the various quality levels. I ended up reporting the issue with inverted use of LOD bias as bug #1246818.

Another problem: If I add a new Quality level to my project, it adds it with a lodBias of “2”, which means it adds it in a broken state, since any LOD bias other than “1” doesn’t work correctly in HDRP right now. Also, if I delete QualitySettings.asset, then open the project, Unity will recreate the default Quality settings, with 6 quality levels, with lodBiases ranging from 0.3 to 2. So, in other words, Unity is still trying to create non-1 lodBiases in the Quality settings.

Hi, I’m having the same problem. I’ve made a workaround that helped me for now. Just opened the QualitySettings.asset file and changed the LOD Bias there using a text editor.
Looks like its working fine for me.
At least I can mess with my LOD levels.

Yeah, I’ve done the same. Oddly, for my project that I migrated from HDRP 5 (which itself was migrated from the built-in renderer), even doing that wasn’t sufficient. There still seemed to be some odd behavior that was causing lodBias to behave incorrectly. The solution for me was two-step:

  • Manually edit QualitySettings.asset, changing all lodBias to “1”. This must be done while the project is closed, otherwise your changes will just be overwritten.
  • I also had to delete all of my HDRP Assets, and basically everything that gets placed into HDRP Default Resources. I’m not sure if what settings from older versions of HDRP were causing issues, but only after doing both of these things was lodBias behaving as expected.

Note two important caveats to this:

  • Manually setting lodBias to anything other than “1” in the QualitySettings.asset will definitely mess up LOD. It will behave as though you set the value to 1/N instead of N.
  • If I ever totally delete my QualitySettings.asset, and then open the project, Unity will recreate the QualitySettings.asset with bad lodBias values in it, ranging from 0.3 to 2. So if I ever delete QualitySettings.asset, it will require another manual edit of it to correct the lodBias values.

All in all, this weirdness can be worked around. It’s just ripe for confusion.

Drop this in assets\Editor\ and use it to set the hidden LOD setting. This change LOD bias to 1, you can modify it to your liking. Find the button under tools\LOD on the top menu
Well, that’s how I fixed my scene.

5955068–638228–LoDBias.cs (440 Bytes)