RequestShadowMapRendering() is internal

Quote from docs:

On Demand HDRP updates the shadow maps for the light every time you request them. To do this, call the RequestShadowMapRendering() method in the Light’s HDAdditionalLightData component.

But this method marked as internal that means it is not available from game code. So how to request shadow maps update in this case?

The marking of that function as internal was probably a mistake. Will make it public soon.

Thanks!

As of 7.1.2. is marked as Internal.

It will be available in 7.1.3

Until then it can be called by using reflection:

  • Just add the static class to the solution.
 public static class ShadowMapWorkaround
    {
        private static readonly MethodInfo MethodInfo = typeof(HDAdditionalLightData).GetMethod(
            "RequestShadowMapRendering",
            BindingFlags.Instance | BindingFlags.NonPublic);

        public static void RequestShadowMapRendering(this HDAdditionalLightData data)
        {
            MethodInfo.Invoke(data, null);
        }
    }
2 Likes