Where is distance culling checked in Unreal source code?

I have a portal connected to a faraway area where it would teleport the player. However, the foliage pops in since it’s being culled due to the distance then pops in once the player is there. I’m trying to mimic a player being in the faraway area before the player teleports there so there isn’t any pop in.

I’ve tried having a hidden local player in the area, but without split screen it doesn’t work. World partition streaming source only helps with the landscape, but not the foliage as far as I’ve seen. And cull distance volume doesn’t work for some reason with landscape grass.

So I wanted to try seeing how it’s being done in unreal and make an actor that would mimic the players properties or whatever is needed to not cull the foliage/landscape if its placed there. I’ve looked into the code, but I’m unsure of which file it’s in and the name of the function, etc. So if anyone knows where in source it’s being done that would be helpful!

It’s located in Gameviewportclient in the draw function.

And this is the solution I found if anyone had the same issue with culling due to long distance between areas and are fine with adding a little c++ I was able to get the landscape and foliage (i e. landscape grass type) to stop culling by making a custom local player class and override the CalcSceneViewInitOptions and just added this in the cpp file:

{

if(GetControllerId() > 0)

{

//Taken from gameviewportclient in the draw function 1566

IStreamingManager::Get().AddViewInformation(GetPlayerController(GetWorld())->GetFocalLocation(), 100, 100);

GetWorld()->ViewLocationsRenderedLastFrame.Add(GetPlayerController(GetWorld())->GetFocalLocation());

}

return Super::CalcSceneViewInitOptions(OutInitOptions, Viewport, ViewDrawer, StereoViewIndex);

}

I turned off split screen in project settings and spawned a new hidden player on the other side of the portal destination so it would be rendered as though the player was already there. A little hacky I guess but works decently for me. Local player class needs to be changed to the custom one in project settings as well.

I was fortunate enough to get some tips from this guy that developed the portals in psychonauts 2 in a reddit post, which somehow didn’t get much interactions which was surprising, but he was really helpful. In case anyone else wants to talk to reach out with any questions here’s his post: https://www.reddit.com/r/unrealengine/comments/vj3m27/creating_portals_in_unreal_for_psychonauts_2/