MetaHuman face LODs have different joint subsets so RayTracingMinLOD doesn't work

We are running into an issue where we want to increase the RayTracingMinLOD of skeletal meshes in order to make ray tracing more performant. The issue is that metahuman face LODs use different subsets of joints for each LOD, so if the render mesh is at LOD 0 and we increase RayTracingMinLOD to LOD 3 for example, the joints in LOD 3 do not evaluate properly in the ray tracing scene because RigLogic is not evaluating them. The first image attached is the Ray Tracing Debug View Base Color with RayTracingMinLOD set to 0. The second image is with RayTracingMinLOD set to 3.

[Image Removed]

[Image Removed]

We fixed it by editing USkeletalMeshComponent::ComputeRequiredBones. Does this fix seem acceptable?

	FSkeletalMeshLODRenderData& LODData = SkelMeshRenderData->LODRenderData[LODIndex];
	OutRequiredBones = LODData.RequiredBones;

// DIVERGENCE | Require bones needed by RayTracingMinLOD
	const int32 RayTracingMinLOD = SkelMesh->GetRayTracingMinLOD();
	if (SkelMesh->GetSupportRayTracing() && RayTracingMinLOD > LODIndex && IsRayTracingEnabled()
		&& SkelMeshRenderData->LODRenderData.IsValidIndex(RayTracingMinLOD))
	{
		MergeInBoneIndexArrays(OutRequiredBones, SkelMeshRenderData->LODRenderData[RayTracingMinLOD].RequiredBones);
	}
// DIVERGENCE_END

	// Add virtual bones
	GetRequiredVirtualBones(SkelMesh, OutRequiredBones);



[Attachment Removed]

Steps to Reproduce

  1. Increase a MetaHuman face skeletal mesh RayTracingMinLOD to 3
  2. In a scene with LOD 0 being rendered, view the RayTracing Debug View > Base Color
  3. See the mesh vertices stretched to the actor origin
    [Attachment Removed]

Hi, it turns out that we’ve already fixed this issue for the 5.8 release. The problem is as you described in that the higher lod bone sets are not a subset of the lower lods. We already had code to deal with a similar issue in the skeletal mesh nanite codepath, but we weren’t dealing with it in the regular ray tracing codepath.

The fix was originally implemented at 51835229. UpdateBonesRemovedByLOD effectively does the work to reinstate the missing bones at their ref pose. The advantage of this vs the change you suggested is that you aren’t paying the cost of animating these bones through the anim bp, etc, which would be the case if they were added back into the required bones.

A backported version of the CL is available at 57700904 if you want to take a look. Or I’ve attached a patch file as an alternative.

[Attachment Removed]

Great, thanks for letting me know. I’ll close out this thread.

[Attachment Removed]

That works. Thank you!

[Attachment Removed]