Reputation: 21
I want to change the Render Scale value via code. I don't want to create multiple assets just to change that but if there isn't other way I would also appreciate help on that. There is almost no documentation about this, everything seems outdated.
Thank you.
Upvotes: 1
Views: 7252
Reputation: 159
You have to create a new instance of URP to edit its properties :
UniversalRenderPipelineAsset asset = new UniversalRenderPipelineAsset();
asset.renderScale = 0.1f;
GraphicsSettings.renderPipelineAsset = asset;
You can check the default contents of UniversalRenderPipelineAsset
by creating a new URP Pipeline Asset; then in the inspector, click the Gear icon on the top right corner and click "Edit Script". This will really help you.
As @derHugo said, you can directly edit its properties using var
.
var urpAsset = (UniversalRenderPipelineAsset)GraphicsSettings.renderPipelineAsset;
urpAsset.renderScale = 0.1f;
Upvotes: 1