Rendering things that arn't seen

Hey guys. Im working on my first voxel engine as I love procedural content. I First started by making this world generator:

After making his I thought i wanted to make voxel engine like minecraft. Not becuase i want to make a clone of minecraft but becuase like i said im love procedural content and want to learn it as best i can. So i have created a voxel engine os far that when running a method it will update all the blocks and check if it is surrounded by blocks. If it is it will make the block invisible. For some reason it still lags like crap. I Have a pretty good computer and when playing minecraft i can run it maxed out with no lag but with my game that has less cubes it lags. Is there a way to render things that are not seen(occlusion culling) but in realtime as i can’t predict the level. Thanks

Have you profiled your game? If not, don’t assume that the problem will be fixed by occlusion culling. It’s entirely possible that the problem is somewhere else. If the problem is just that you are just rendering too many batches, you may find that the better solution is to break your world into chunks (maybe 32x32x32) and have a single mesh per chunk where you dynamically update the mesh when the player adds or removes blocks. This will dramatically cut down on the number of draw calls you have, require almost no CPU (which occlusion culling will require) and your GPU can almost certainly handle the verts, especially if you are already eliminating interior blocks.