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]