Expose more URP settings

I’m working on a game where it’s neccessary to read from and write to various fields that are stored in a UniversalRenderPipelineAsset where no public API has been exposed for so far.

What we need:
A setter for UniversalRenderPipeline.asset.supportsMainLightShadows because we have an option in the graphics settings menu.

Various SSAO settings that we need to modify at runtime during gameplay and graphics settings. This basically includes all fields found in ScreenSpaceAmbientOcclusion.m_Settings. Right now we read and write via reflection the following fields:

  • ScreenSpaceAmbientOcclusionSettings.DirectLightingStrength
  • ScreenSpaceAmbientOcclusionSettings.Radius
  • ScreenSpaceAmbientOcclusionSettings.DirectLightingStrength
  • ScreenSpaceAmbientOcclusionSettings.Intensity
  • ScreenSpaceAmbientOcclusionSettings.BlurQuality
  • ScreenSpaceAmbientOcclusionSettings.Samples
  • ScreenSpaceAmbientOcclusionSettings.Downsample
  • ScreenSpaceAmbientOcclusionSettings.Falloff

DecalRendererFeature.m_Settings.maxDrawDistance because we modify it in the graphics settings.

Is this something you plan to provide and if so, any rough ETA?

4 Likes

We actually have a fork of URP, and one of the few changes in that fork is to make a bunch of those SSAO settings public, so I second having those fields available at runtime. Modifying them works, so there’s no problem, really.

They need to at least just move some of the visual settings to volumes, as it may be desired to adjust them for cinematics or inside room vs outside. After all HDRP does it.

Yeah the intended way to deal with that is volumes, but there are cases where that’s a clunky workflow for various reasons, so getting to just write the values is a lot better.

Unity has this weird dichotomy of the whole DOTS thing which is, at least in theory, about how data is king and you should modify the data directly instead of building abstractions around them, while at the same time every single tool Unity ships tries as hard as possible to keep the end users from touching the data.