Detail object visibility system

Hi all,
I wrote a client side system for removing detail objects if they get too far from the camera.
Objects tagged with Detail_Small or Detail_Big get handled automatically.

It should be fairly lightweight and suitable for a reasonably large amount of detail objects.

It’s best for anchored objects or objects that otherwise don’t interact with the player in any way.

It should hopefully also play nice if you’re doing your own visibility culling by parenting areas to game.Lighting etc.

Source code is as is.

24 Likes

Filtering enabled does that (correct me if I’m wrong)

1 Like

I think you’re thinking of StreamingEnabled.

With that said, one issue with StreamingEnabled is that all models are streamed in and out. For programmers, that can be an issue. That’s why alternatives to StreamingEnabled (of which there are only a few?) can be fairly attractive to programmers and game designers, since you get more control of what, specifically, is being streamed out, even though it’s not default engine behavior.

To avoid a ton of raycasting, using distance checks is a performant compromise somewhat derived from the frustum culling technique (since most games aren’t exclusively first-person). I used a similar approach when I wrote CullingService - Custom Client Sided Culling/Streaming Module, although this takes a different approach (utilizes grids differently, use of CollectionService allows individual BaseParts to be tagged, etc.)

It’s cool to see more people working on things like this!

1 Like

Yah! This is really just meant as a quick drop-in for projects that are NOT using streaming enabled, but want to have small objects (like bottles in a bar, or small roadside rocks) go away when really far away.

My use case is I have a large (very large!) beach scene with about 400 little bushes, rocks, and other prop that can’t even be seen from 1000 studs away, so this cleans them up.

2 Likes

Question:

Using this, could it be expanded to include an LOD system? An example of this would load a billboard gui or 2d mesh for objects in the “Far” region and then would be unloaded and replaced with the actual mesh for objects once the camera is in range of the “Close” region.

I’d be interested in exploring this further because the game I am working on is a 16kx16k stud “open world” map with a dense forest with a ton of different prefabs.

Absolutely! You could organize it a few ways, too.
One thing this allows you to do is swap out an entire model with a primary part for a simpler model, so you could even gather multiple trees into the same super-lod.