For static raytracing geometry we were hitting an ensure on the number of referencing static skeletal mesh objects inside the function: FSketealMeshSceneProxy::GetStaticRayTracingGeometry().
The cause was the skeletal mesh assets had ray tracing disabled. Because of this, the concurrent render state does not create ray tracing geometries (as it’s guarded by that flag). However, later the FScene still tries to register primitives and requests the ray tracing geometry without verifying whether it was created.
Sharing here since I did not see the report somewhere else, we added the check like the static mesh version is doing to safeguard the function:
TArray<FRayTracingGeometry*> FSkeletalMeshSceneProxy::GetStaticRayTracingGeometries() const
{
+ if (IsRayTracingEnabled() && bRenderStatic && SkeletalMeshRenderData->bSupportRayTracing)
// if (IsRayTracingEnabled() && bRenderStatic)
{
TArray<FRayTracingGeometry*> RayTracingGeometries;
RayTracingGeometries.AddDefaulted(SkeletalMeshRenderData->LODRenderData.Num());
for (int32 LODIndex = 0; LODIndex < SkeletalMeshRenderData->LODRenderData.Num(); LODIndex++)
{
FSkeletalMeshLODRenderData& LODRenderData = SkeletalMeshRenderData->LODRenderData[LODIndex];
// Skip LODs that have their render data stripped
if (LODRenderData.GetNumVertices() > 0)
{
ensure(LODRenderData.NumReferencingStaticSkeletalMeshObjects > 0);
RayTracingGeometries[LODIndex] = &LODRenderData.StaticRayTracingGeometry;
}