OK, plus LODs, mipmaps and this will be fast enough I guess. The only thing is, how to check if certain block is visible or not? I guess making while loop for each of it, with CLIPPED flag, will be slow... What would be the best way, may be you have some ideas? Thank you BTW.
private void removeInvisible()
{
////here just make a temporary copy of the voxelarray for marking invisible voxels
int[][][] vtest = new int[voxH][voxX][voxY];
for (int z = 0; z < voxH; z++)
{
for (int x = 0; x < voxX; x++)
{
for (int y = 0; y < voxY; y++)
{
vtest[z][x][y] = voxels[z][x][y];
}
}
}
// mark voxels wich can not be seen
for (int z = 1; z < voxH - 1; z++)
{
for (int x = 1; x < voxX - 1; x++)
{
for (int y = 1; y < voxY - 1; y++)
{
vtest[z][x][y] = voxels[z][x][y];
if (vtest[z][x][y] > 0
&& (vtest[z][x + 1][y] > 0 && vtest[z][x - 1][y] > 0 && vtest[z][x][y + 1] > 0 && vtest[z][x][y - 1] > 0 && vtest[z + 1][x][y] > 0 && vtest[z - 1][x][y] > 0))
{
voxels[z][x][y] = 0; //this voxel is invisible, as all neighbors are solid
}
}
}
}
}
this just means: if the voxel is not 0 (air) and all voxels around it are not air, then the voxel can not be visible. (simply because there is not way to see it, as its sourrounded by solid blocks)
the rest is just for looping though the x,y,z array