I've created a model in MagicaVoxel (A) and I want to use it in Godot. I imported the model into Blender, but then realized that it's using a very high polygon count for such a simple model. I found that using MagicaVoxel's OBJ export yields interesting results in that voxels of the same colour share polygons (B), but when many different coloured voxels are next to each other, it still creates a high polygon count.
Ideally, I'd like to have a model that is the lowest polygon count possible (C) with an accurate texture map to mimic the voxel colours. Is there an existing tool to achieve this? I really like how MagicaVoxel works and I'm not interested in using Blender to model or manually texture the mesh, but maybe there's a plugin for Blender? I'm open to suggestions.
As a side note, it's possible that I could just use the OBJ file as is, but I wonder about performance. Mesh B has 216 polygons, while mesh C uses 140. This is just one asset in a medieval adventure game and I'd like to have a very cluttered world. ;-)
Edit For clarification: MagicaVoxel exports an OBJ file with accurate texture mapping, but isolates different colours of voxels to their own polygons, creating more polygons than are required. Mesh B is the result (I imagine this removes the need for any anisotropic filtering). Mesh C was also exported from MagicaVoxel, but with the colour information removed. Thus, without the desired material information. I just wanted to avoid any confusion with what MagicaVoxel can do on it's own. Maybe there's a solution within MagicaVoxel that I'm not aware of?
Update: I believe Blender can do what I need, but it's going to require a lot more research to get it right. I was able to get a texture map to bake by diffusing colour with some success (some faces got the wrong colour, see the yellow near the bottom of the blade), but I couldn't quite figure out how to do it with vertex colour emissions to see if the result would be better. Then (as you can see in the sword handle) I need to setup up a pixel perfect UV and texture map, prior to baking. I'm kind of leaning away from doing it manually in Blender, to be honest. I may have to do this for a thousand or more models, and every time a model is edited.
I'm going to let this question sit for now in the hope that there's an easier solution. Maybe a script exists to do this? Maybe I should learn how to write my own? In the meantime, I can still proceed with the higher polygon counts in the OBJ exports from MagicaVoxel. The neat thing about the native MagicaVoxel OBJ exports is that the texture map is a simple 1px tall by 256px wide palette PNG file (every colour is a single square pixel) that all meshes can share. Everything can use the same texture file. Maybe that offsets the higher polygon count performance hit? Anyway, I'm taking a break from Blender. ;-)