Changing URP asset in game settings at runtime

I really like the flexibility of changing the graphics quality with different URP/LWRP assets.

I’m getting ready to make it possible to change the visual quality of the game (preferably with a scriptable object) from within the game, and I was wondering what the best way to do this with URP would be.

The primary settings I need to change are

  • Postprocessing HDR(on/off; currently only using bloom)
  • Shadows on/off,
  • Anti aliasing on/off

The goal is to ultimately have the graphics automatically configure for an oculus quest 1 versus an oculus quest 2.

As an aside, I’m also interested in altering the terrain quality, since it seems terrain has a huge impact on performance with the oculus 1 hardware.

Ah, the answer is located in the docs:

2 Likes

More succintly, I found I can simply do
QualitySettings.SetQualityLevel(qualityLevel)

I’m using scriptable objects to add another quality layer on top of that (ie: swapping out terrain textures for ones without normal maps for mobile and Oculus Quest 1 platforms).

2 Likes