HD Render Pipeline: Change shadow distance at runtime

Hello,

I want to change the shadow draw distance via a C# script at runtime in a settings menu.
I use Unity 2019.1.2f1 and HD Render Pipeline. As far as I now, the shadow distance is not longer accessible with QualitySettings.ShadowDistance. There is an option called “Shadows” in volume settings. There’s the max distance and the cascade split. But I can’t find a property called “Shadows” or anything else.

As an example, I can change other volume properties like that:

sceneSettingsVolume = sceneSettings.GetComponent<Volume>()
sceneSettingsVolume.profile.Remove<MotionBlur>();
sceneSettingsVolume.profile.Add<MotionBlur>().intensity.value = 20;

Also, this seems rather odd to me. There’s a method to remove and add settings.
Why not just a method to change just one settings instead of rebuilding the complete property?
If I do not miss something (hence lack of proper documentation by Unity), the only way to change something is to complety remove a property and than add everything again.

But how to change Shadows?

Further I looked in the Volume Asset and found out that the Shadows property don’t even has a name like Ambient Occlusion or Motion Blur. For example:

m_Name: AmbientOcclusion

but for Shadows property it is just empty:

m_Name:

So does this means, I cannot change the shadow draw distance at runtime?

Also I’m wondering why it is 2019 and still Unity does not provide any documentation about HD Render Pipeline Api. I know it is still experimental but to provide some simple code snippets on your GitHub account isn’t that time consuming.

I wasted hours of game development just for one simple thing that was formerly accessible simply by QualitySettings. And now I have a menu option that doesn’t do anything.

I think that the right case to qoute a Unity staff member:

“You might be able to ship with HDRP and still run “smooth” on lower hardware by tweaking the HDRP settings (that’s what game settings are for, right ?).”

Really nobody? Even no developer from Unity?

https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/453d8b82d6cbca1d84e18fce74340eb21f838c49/com.unity.render-pipelines.high-definition/Runtime/Lighting/Shadow/HDShadowSettings.cs

1 Like