API for managing URP asset parameters, including hacking of parameters that are forbidden to change
API for managing URP asset parameters, including hacking of parameters that are forbidden to change.
Unity closed access to change important parameters such as shadows casting, shadow resolution, lighting modes, etc.
If you want to give the user the ability to customize the resolution of shadows, then the suggestion from unit sounds like this: "create multiple assets and rearrange them"
If you follow this way, you will have to create hundreds of pipeline assets to give users the ability to customize the graphics settings.
At the moment the Unity dev team does not disclose the reasons why they closed the ability to change many important parameters.
Create a wrapper to bypass the restrictions to modify private parameters.
URP | LINK |
---|---|
11.0.0 | :arrow_down: |
10.3.1, 10.3.2 | :arrow_down: |
The package is available on the openupm registry. It's recommended to install it via openupm-cli.
openupm add com.inc8877.graphicsconfigurator
Open Packages/manifest.json
with your favorite text editor. Add the following line to the dependencies block.
{
"dependencies": {
"com.inc8877.graphicsconfigurator": "https://github.com/inc8877/GraphicsConfigurator.git",
}
}
.dll
into the projectAdd .dll
to your project, you can find it in every release. You can find a suitable version here
First, plugin necessary libraries
using GraphicsConfigurator.API.URP;
using UnityEngine.Rendering.Universal;
using ShadowResolution = UnityEngine.Rendering.Universal.ShadowResolution;
To change the active URP Asset, you need to do the following:
// ...
// code somewhere
Configuring.CurrentURPA.OpaqueDownsampling(Downsampling._4xBox);
Configuring.CurrentURPA.AntiAliasing(MsaaQuality._4x);
Configuring.CurrentURPA.MainLightMode(LightRenderingMode.PerPixel);
Configuring.CurrentURPA.MainLightShadowsCasting(true);
Configuring.CurrentURPA.MainLightShadowResolution(ShadowResolution._1024);
// ...
If you want to work with a specific URP Asset, do it like this:
private URPAssetConfiguring URPA = new URPAssetConfiguring(target);
// ...
// code somewhere
URPA.MainLightShadowsCasting(true);
URPA.Cascade3Split(new Vector2(0.1f, 0.3f));
// ...
CPU | GPU | OS | Graphics API | Backend | .Net |
---|---|---|---|---|---|
SD 855 | Adreno 640 | Android 10.3.8 | Vulkan | IL2CPP | 4.x |
SD 845 | Adreno 630 | Android 10.3.7 | Vulkan | IL2CPP | 4.x |
i7 6700HQ | AMD Randeon Pro 450 | macOS 11.2.1 | Metal | IL2CPP | 4.x |