Im overriding the function UHierarchicalInstancedStaticMeshComponent::CalcBounds . This function affects the frustum culling rendering. Original function:
`FBoxSphereBounds UHierarchicalInstancedStaticMeshComponent::CalcBounds(const FTransform& BoundTransform) const
{
ensure(BuiltInstanceBounds.IsValid || ClusterTreePtr->Num() == 0);
if (BuiltInstanceBounds.IsValid || UnbuiltInstanceBounds.IsValid)
{
FBoxSphereBounds Result = BuiltInstanceBounds + UnbuiltInstanceBounds;
return Result.TransformBy(BoundTransform);
}
else
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_UHierarchicalInstancedStaticMeshComponent_CalcBounds_SlowPath);
return Super::CalcBounds(BoundTransform);
}
}
` I need it to override so that it always renders no matter if its on camera or not. So i tried making a transform with 99999, tried also to create a FBoxSphereBounds with big radius, other tests with no success: My attempts:
`FBoxSphereBounds UHISM_NoFrustum::CalcBounds(const FTransform& BoundTransform) const {
FTransform NewTransform = FTransform(FRotator(0, 0, 0), FVector(BoundTransform.GetLocation()), FVector(9999999, 9999999, 9999999));
FBoxSphereBounds Result = BuiltInstanceBounds + UnbuiltInstanceBounds;
FBoxSphereBounds TestBounds = FBox(-FVector::OneVector * 10000.0f, FVector::OneVector * 10000.0f) + FBox(-FVector::OneVector * 10000.0f, FVector::OneVector * 10000.0f);
FBoxSphereBounds TestBounds2 = FBoxSphereBounds(FVector::ZeroVector, FVector::OneVector * 10000.0f, 10000.0f);
return Result.TransformBy(NewTransform);
};
` It keeps culling the Instances regardless of what i do. I need the render to assume the mesh is on screen always.
Any tips? Pls help.