Control what to draw manually?

I’m coming from 2D frameworks such as LibGDX and MonoGame and I currently want to create a 3D world out of blocks in Unity. My camera will be orthographic at a fixed angle to create a isometric “feel” and thus I can easily calculate what’s inside the view and what not.

Let’s say I just want a top down tilemap. I would keep a 2D array with data representing the tiles and based on camera location, viewport size and tile size I know exactly what to draw using the 2D array. It would look something like this:

//Assuming camera.position gives the center of the camera:
int startX = (camera.position.x - viewport.width / 2) / Tile.Width;
int startY = (camera.position.y - viewport.height / 2) / Tile.Height;
int endX = (camera.position.x + viewport.width / 2) / Tile.Width;
int endY = (camera.position.y + viewport.height / 2) / Tile.Height;

//Now I simply iterate from start to end and draw the tiles:
for (int y = startY; y < endY; y++)
{
  for (int x = startX; x < endX; x++)
  {
    tileMap[x][y].draw();
  }
}

I actually want to do the same with meshes but I understand that instantiating and destroying meshes is expensive so this might not be a desirable solution. Yet I do know what to draw so there must be a option for me to disregard everything outside of the viewport and get manual control of what’s being drawn instead of letting the engine decide the culling.

My final project needs to have something like 128x128x128 “spaces” that hold meshes. I know these are a lot of blocks but only 10 height/z layers will be visible at maximum and manually culling everything outside view should leave me with just a couple hundred blocks at any one time.

You can use the low level graphics library Unity - Scripting API: GL
you want to start with something like

void OnPostRender () {
	//set a material pass with SetPass

	GL.PushMatrix();

	GL.Begin( GL.TRIANGLES );
	//use GL.TexCoord then GL.vertex to create triangles
	GL.End();

	GL.PopMatrix();
}