How can I optimize this mesh?

Hello,
I’m not an expert with Blender. I generated this mesh(see attachment) with a python script I wrote for Blender. I like how it looks, but I think everyone agrees that this mesh is a mess. I’m not sure what Blender tools to use to optimize this mesh. The main concern is that this mesh is not a continuous piece of geometry, but rather 5k separate quads. How do I make them into a continuous piece?

Attachments

mesh.zip (576 KB)

I downloaded it and it doesn’t look like a mess to me. They are 5k perfectly defined cubes, in a random disposition, they overlap with each other in certain points but that’s not an issue, you can select each cube individually. I see it’s called floor, it’s already unwrapped so you can texture it no problem. I don’t know, I think it depends of what do you want to use it for. You may not need to convert it into one mesh. I could work with this. This mesh is already grouped so it works like a solid piece.

I would stay away from Boolean tools it will create continuous piece, but a continuous piece of bad geometry, either joining or carving into another mesh. ALT+F won’t work either.

I’m sorry if I wasn’t of much help but I think your Mesh is nice, clean and that randomness it’s a great touch. I hope someone can enlighten us with a possible solution because everything I can think of is not worth the effort and the result is not better than what you’ve already have.

Here, I played around a bit with your floor hehe… good job! :smiley:


Perhaps I can elaborate on why I see this mesh being a mess. Maybe it’s not a mess in regards to using it in Blender, but GPUs don’t like rendering small separate objects. Each time there is a disconnected piece of geometry, the gpu needs to do a new draw call with overhead. It may not be evident of a problem in the isolated case here, but this model is intended to be used in Unity3d, and having a bunch of similar to this models drastically increases the amount of draw calls and impacts performance. This is mostly because the engine can’t figure out a way to draw this geometry in one go.

If I could somehow convert 5k separate objects into a continuous triangle strip, I would reduce the draw call overhead to a minimum and there would be no performance problem.

One way is to use the geometry to bake textures


Could modify the object and geometry such that the object has non-uniform scale, then use bevel modifier to slant the sides. Because the non-uniform scale, bevel pushes one side of the edges deeper.

Then could add a plane and bake normals, ambient occlusion in Cycles, and displacement in Blender render. Only baking a portion means smaller image size.


If it’s enough to fake the uneven surface, could just use the normal map to do it


But if it has to be real geometry to have a silhouette against the forms themselves (parallax), could use adaptive subdivision and displacement, which tesselates the geometry when rendering.

Ambient occlusion map could be used to enhance the illusion of crevices by removing material reflections, and/or use it to mix colors or textures.

Thank you for presenting several in-depth solutions. This gives me a fair amount of topics to explore, but since right now I’m not experienced enough with such advanced techniques, the first step I’ve done was the following - I selected the bottom vertices and used ‘remove doubles’ with a non-zero distance margin. This merged the bottoms of adjacent cubes together, and therefore helped in reducing the vertex count as well as making the geometry a continuous piece. Obviously your solution is more optimal from the technical perspective, but the remove doubles trick is so quick and easy that it will have to work for now until I learn your approach.