I can seem to find a way to set the Contact Shadows setting through code on a specific light. HDAdditionalLightData doesn’t seem to have a method for it.
Hey, contact shadows settings are set via the volumes in HDRP. This means the contact shadows settings are applied to any light using such feature. In other words, you can’t have per light control.
Thanks,yeah I got it from the volume. That’s confusing as heck because you can control the resolution level of the Shadow Map on the light. GetComponent<HDAdditionalLightData>().SetShadowResolutionLevel
.
Here’s a bit of code for anyone else struggling with accessing the contact shadows via c#:
ContactShadows NewShadows;
VolumeProfile.profile.TryGet<ContactShadows>(out NewShadows);
NewShadows.quality.value = PlayerPrefs.GetInt("ContactShadowQualityPreference", 0);
1 Like