Hey! So here's what I'm doing: I'm dividing my game world terrain, custom-made in Blender, into a 20x20 grid of 250meter square game objects. And each cell is assigned a name like 11-15 or 1-18. As the player moves around, I have an fsm that gets the player's position, converts that into a cell name, then checks a list of hash tables (or array lists?) and simply enables or disables mesh renderers of the LOD0-3 meshes on the world cell game objects.
I currently have these game objects dropped into a hash table. (actually 20 "row" hash tables each with 20 column cell key entries.)
I COULD get the stored cell's game object, get its component, and disable its mesh renderer manually, but I was told that GetComponent was expensive, so running that 9 or 25 times (depending on number of LODS I create), every time the player walks 250 meters in a direction, seems expensive.
Otherwise, I COULD just enable and disable the world cell game objects entirely, but considering they often contain nav mesh data for far away characters, I feel I'd get the whole "nav mesh agents are no longer on a nav mesh" error.
Are you saying there's a better way to do this?
The whole point of using this simplified culling system, is that every frame the game doesn't need to scan 12000+ game objects (in my UN-decorated world map) to see if they need culling, but instead to do it based on a simple "where is the player" math operation. Potentially I could still use official occlusion culling inside that much smaller region, but the immediate area around the player will have far fewer objects to cull than, say, a random mailbox door 2 km away... plus another 400 static mail box game objects. I WISH the mega city "heirarchical culling" they used in that phone demo was a part of Unity, but I can't find it.
I learned the culling preparation was the big frame killer for me, by reading the profiler, and when I just disabled a bunch of the world, all of a sudden my frame rate was great again, so I came up with this idea to just have all far away map cells be simple 100 triangle, 1 material meshes, depending on LOD.
It's really weird because the scene I checked the profiler stuff in, was using unity terrain and lots of grass, and I was confused by how non-performant the default terrains with sparse grass billboards, ended up being.
I'm making an open world game that has 90+ frames for VR, so I'm trying to improve performance a lot.