Frustum Culling in ROBLOX - Help

Hey,

I am making a game, and I need to have a really big map. And i thought to increase the performance in the game I would somehow implement frustum culling.

Is there already an API or some way to implement it. Or is it currently impossible to do?

I am not talking about Streaming Enabled which unloads parts of the map at a certain distance, because that looks bad. I am talking about unloading parts of the map where the player cant see.

Thanks in advance, iiLevelMaker.

i’m not sure on the best way to unload and reload parts; i think reinstancing parts every time the player moves their camera would defeat the purpose because of how expensive it is. however, to check if a part is visible in the player’s camera, use

local camer = workspace.CurrentCamera
local _, isVisible = camera:WorldToScreenPoint(position)
1 Like

It does help,

But as you said, it lags if you got a big map and you need to replicate it from and to Replicated Storage for example.

Another issue is, it needs to be so fast that the user can’t notice it.

Replicating it from and to replicatedstorage or any other service could take a second, and at 60 fps 1080p it will take a lot of memory just doing that.

I know this is a old post but I’m attempting to do something similar to optimize the procedural generation of terrain. Right now it generates terrain in a circle around each player’s current position but I’m trying to optimize this so it only generates what’s actually visible in the player’s camera… or maybe a little bit outside their FOV and for a much greater distance.

I can already generate land masses in-game far larger than Roblox Studio can handle. From the center of one you can walk for an hour or more before to find the ocean. The problem is when you climb a high mountain and look around you can only see the places you’ve already walked through. Everywhere else is just empty nothingness. I’ve tried expanding the generation radius but it took way too long to generate. So my plan is to implement a crude form of view frustum and occlusion culling so it doesn’t waste cycles generating terrain no one is currently looking at. Then I can extend the generation distance and adjust the chunk size based on camera distance.

Were you ever able to figure out the loading/unloading issue you were working on?