Adaptive Probe Volumes throwing TargetParameterCountException when selected in the inspector

I’ve recently heard about the Unity 6 Update and wanted to see how much of a game changer adaptive probe volumes are for the lighting system. So I decided to set up a basic HDRP scene with APVs.

I followed the wiki on setting up Adaptive Probe Volumes in a HDRP Scene.
Use Adaptive Probe Volumes | High Definition RP | 17.0.3

Whenever I get to the part where I need to modify the APV in the inspector, I get a repeated error stating: TargetParameterCountException: Number of parameters specified does not match the expected number.

As a result the component is blank in the inspector, and the adaptive probe volume section is also blank in lighting settings.

I’ve also made sure to set the light to mixed and the HDRP Asset’s Light Probe System to Adaptive Probe Volumes.

Full error message:

TargetParameterCountException: Number of parameters specified does not match the expected number.
System.Reflection.RuntimeMethodInfo.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <eb0ef51e5908461ca908fdf6b2dbd966>:0)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eb0ef51e5908461ca908fdf6b2dbd966>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eb0ef51e5908461ca908fdf6b2dbd966>:0)
UnityEditor.Rendering.ProbeVolumeEditor.FrameSettingDisabledHelpBox () (at ./Library/PackageCache/com.unity.render-pipelines.core@7bffd5bb179a/Editor/Lighting/ProbeVolume/ProbeVolumeEditor.cs:126)
UnityEngine.Rendering.ProbeVolumeLightingTab.Initialize () (at ./Library/PackageCache/com.unity.render-pipelines.core@7bffd5bb179a/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs:190)
UnityEngine.Rendering.ProbeVolumeLightingTab.OnGUI () (at ./Library/PackageCache/com.unity.render-pipelines.core@7bffd5bb179a/Editor/Lighting/ProbeVolume/ProbeVolumeLightingTab.cs:220)
UnityEditor.LightingWindow.OnGUI () (at <383b67993756435b8920080a9ba43b70>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <383b67993756435b8920080a9ba43b70>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <383b67993756435b8920080a9ba43b70>:0)
UnityEditor.DockArea.OldOnGUI () (at <383b67993756435b8920080a9ba43b70>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <d6f576415dfd4add8f23aa1d383d68cc>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Any ideas on what’s causing this? I’ve already tried setting up a fresh HDRP Unity Project on a different computer and it has had the same issue. Both systems used Windows 11.

My editor version is: 6000.0.36f1, but I’ve also encountered this issue for the first time on 6000.0.35f1

1 Like

For anyone still getting this issue, just replace the code for the function FrameSettingDisabledHelpBox as follows:

        internal static void FrameSettingDisabledHelpBox()
        {
            var renderPipelineAssetType = GraphicsSettings.currentRenderPipelineAssetType;

            // HDRP only
            if (renderPipelineAssetType != null && renderPipelineAssetType.Name == "HDRenderPipelineAsset")
            {
                static int IndexOf(string[] names, string name) { for (int i = 0; i < names.Length; i++) { if (name == names[i]) return i; } return -1; }

                var k_FrameSettingsField = Type.GetType("UnityEngine.Rendering.HighDefinition.FrameSettingsField,Unity.RenderPipelines.HighDefinition.Runtime");
                var k_APVFrameSetting = k_FrameSettingsField.GetEnumValues().GetValue(IndexOf(k_FrameSettingsField.GetEnumNames(), "AdaptiveProbeVolume"));

                var k_EnsureFrameSetting = Type.GetType("UnityEditor.Rendering.HighDefinition.HDEditorUtils,Unity.RenderPipelines.HighDefinition.Editor")
                    .GetMethod("EnsureFrameSetting", BindingFlags.Static | BindingFlags.NonPublic);

                k_EnsureFrameSetting.Invoke(null, new object[] { k_APVFrameSetting});
            }
        }

Note that, if you use the HDRP from package and not imported into your project, this change will vanish next time you do a re-import all or nuke the library folder.

This is just a workaround and a temporary solution and it’s likely that next HDRP package update for the 6000 branch will address this.

7 Likes

It works , you are a life saver

OMG! It works! I had been trying to fix this for a whole day.

Thank-you for explaining this.

Have just started using Unity 6 and ran straight into this problem. Was going around in circles wondering what I was doing wrong. Not a good start. Key feature entirely inaccessible without editing core code.

Will wait for an official update release.

D.