How do i disable Frustum Culling for specific actors?

Not distance culling. Frustum culling (the camera one).
I tried looking everywhere. And also asked in unreal slackers.
The best suggestion i got was to do something with CalcBounds();
Like override it or something.

Also user NikPik666 suggested the following:

But that seems to be for all actors. He didnt answer since then and i have no way to contact him.

I asked ChatGpt, and it gave me a bunch of suggestions.
All of them didnt work.
It said mostly to override the function that returns the bounds so that the engine always thinks the actor is in the camera view.
Since im a beginner in C++ in unreal engine.
I dont know if some interpretation of this could take us anywhere?
ChatGpt suggestions that i couldn’t implement:


	// Override the GetLocalBounds function to always return a very large bounding box
	virtual FBox GetLocalBounds() const override
	{
		return FBox(-FVector::OneVector * 10000.0f, FVector::OneVector * 10000.0f);
	}

	// Override the GetComponentsBoundingBox function to always return a very large bounding box
	virtual FBox GetComponentsBoundingBox(bool bNonColliding = false) const override
	{
		return FBox(-FVector::OneVector * 10000.0f, FVector::OneVector * 10000.0f);
	}

	// Override the GetSimpleCollisionCylinder function to always return a very large bounding cylinder
	virtual FCollisionShape GetSimpleCollisionCylinder() const override
	{
		return FCollisionShape::MakeCapsule(10000.0f, 10000.0f);
	}

	virtual FBoxSphereBounds GetActorBounds() const override
	{
		return FBoxSphereBounds(FVector::ZeroVector, FVector::OneVector * 10000.0f, 10000.0f);
}

Bumpity Bump? BUMP :smiley:

Bump

I believe that bounds of an actor decide what gets culled and what doesn’t so wouldn’t setting bounding box for a component to really big one work?

I think the culling interface may be cleaner approach, but making it all custom just for this seems weird.

I believe this is possible only from C++. I would do something along the lines of setting the Bounds variable that every USceneComponent has to something that suits my needs and overload UpdateBounds method to do nothing.

Then all that’s left is to find the optimal size and no need to recreate the whole system of culling.

1 Like

I spent some time going through the code and unfortunately even if you’d make your own culling interface, it’s not enough. You’d need to change a bit more in the engine to treat actors you want differently.

Edit: So the outcome is that you can only cull more than needed by default using this approach, not less.

1 Like