duplicating geom for fast voxel representation

I have a voxel engine that creates new geoms every frame with vertex.addData, normal.addData, color.addData. This is really slow. I get about 3s/frame just to generate the geometry in a 512**3 matrix.

My recent idea to speed things up was to pregenerate the 6 cube faces, their normals, and colors, and set them up as individual nodes. This would make 6 sides * 32 color palette = ~200 nodes. Then I would just instanceto the faces to a 3d grid of node paths.

This doesn’t work either though; going through a list of nodes and instancing faces to it 512**3 times takes way too long.

Is there a good way to pregenerate the faces and copy them at the geometry level? Maybe with a shader? But I think copying a 512**3 matrix to a graphics card every frame would be slow too. Would meshdrawer be better? I’m really grasping at straws. Everything seems slow.

This is kind of the problem with voxel engines–you have a vast amount of data to process, and you have to do it in real time. I don’t know if it’s possible to build a successful voxel renderer using Python code; the language really isn’t built for processing this much data directly. I suppose you might have luck with Cython or something similar, or maybe it’s time to consider writing your voxel renderer in C++.

Even still, you’re going to have to be very clever to manage this much data at real-time rates.