Upon running around in my game world, in an area comprised of many Hierarchical Instanced Static Meshes, I keep getting the same crash. During the FHierarchicalStaticMeshSceneProxy::GetDynamicMeshElements() call,
// Instanced stereo needs to use the right plane from the right eye when constructing the frustum bounds to cull against.
// Otherwise we'll cull objects visible in the right eye, but not the left.
if (Views[0]->IsInstancedStereoPass() && ViewIndex == 0)
{
check(Views.Num() == 2);
const FMatrix LeftEyeLocalViewProjForCulling = GetLocalToWorld() * Views[0]->ViewMatrices.GetViewProjectionMatrix();
const FMatrix RightEyeLocalViewProjForCulling = GetLocalToWorld() * Views[1]->ViewMatrices.GetViewProjectionMatrix();
FConvexVolume LeftEyeBounds, RightEyeBounds;
GetViewFrustumBounds(LeftEyeBounds, LeftEyeLocalViewProjForCulling, false);
GetViewFrustumBounds(RightEyeBounds, RightEyeLocalViewProjForCulling, false);
InstanceParams.ViewFrustumLocal.Planes.Empty(5);
InstanceParams.ViewFrustumLocal.Planes.Add(LeftEyeBounds.Planes[0]);
InstanceParams.ViewFrustumLocal.Planes.Add(RightEyeBounds.Planes[1]);
InstanceParams.ViewFrustumLocal.Planes.Add(LeftEyeBounds.Planes[2]);
InstanceParams.ViewFrustumLocal.Planes.Add(LeftEyeBounds.Planes[3]);
InstanceParams.ViewFrustumLocal.Planes.Add(LeftEyeBounds.Planes[4]);
InstanceParams.ViewFrustumLocal.Init();
}
Specifically at this line
InstanceParams.ViewFrustumLocal.Planes.Add(LeftEyeBounds.Planes[0]);
I get the following assert Array index out of bounds: 0 from an array of size 0
Any idea what is going on?