Minecraft-Style Culling

Hey everyone!

So I’ve been working on a minecraft-style adventure game made entirely of cubes. It creates the environment in runtime so the built-in baked occlusion culling doesn’t seem to be an option. I’ve been unable to render a single chunk without dropping below 20 FPS. I would like to know if there was an easy, free way to cull everything that the camera can’t see.

I’ve looked all over the forums but I haven’t found anything that actually works for free.

You should look up one of the countless tutorials on Minecraft-like voxel terrain. From your short descriptions it seems what you try to represent each cube by a gameobject. This will not work out at all. You have to create a single mesh for a whole chunk section. Minecraft is splitted into sections of 16x16x16 cubes. When meshing such a section you actually iterate through all voxels and determine which sides are actually visible. In MC each cube type has a boolean property if this cube type is actually solid or transparent. If the neighbor voxel is solid you don’t need to add this side of the cube to the mesh. So a chunk section that is completely “filled” and covered by the neighboring chunks or completely empty do not contain any mesh at all.

The actual generation of the voxel data and the meshing of each chunk is usually done in a background thread. Whenever you add or remove a block that chunk section need to be remeshed.

If you don’t want to create your own voxel terrain engine you can use any of the freely available. One of the first for Unity was the minepackage.