Did a small editor utility that takes a texture, then converts it into a Mesh. Should be good for more retro looking games, or for easier placeholder art.
I will release a version of it in the next few days, once I take care of making it more production ready.
Documentation -
After importing the package, select the wizard, it should show up at the bottom of the assets menu.
Drag a texture to the texture box in the wizard. The texture will need to have been imported with read/write enabled to true, and have a format of ARGB32. If it is a non power of 2 texture, make sure to select None under the power of two settings. For importing, your texture settings should look something like this, under the “Advanced” menu.
Set a filename for the mesh that will be created. You don’t need an extension.
Set the color you want to mask out, this color will not be converted to 3D Pixels. This defaults to 0,0,0,0 , which works with sprites that have a blank, transparent back ground. For sprites that don’t, usually just clicking on the background with the eyedropper tool works fine.
Set the dimensions of the 3D Pixels, if you want fat or deep pixels, or want a smaller mesh, this is the time to set it.
Click the Create button. This will create the mesh, and it will show up in your assets folder.
Drag the mesh into the scene. In order to see the pixel colors, drag the PixelSprite material over it in the scene. I’ve included two different shaders. The mobile one will not cast shadows.
Yes, that’s one thing I forgot to mention :). When I was originally doing it( the utility was for a game I never finished ), I wanted to have it also generate a bunch of cube attached to rigibodies, so when I shot an enemy they could explode into a big mess of cubes.
However, it really should check for faces that aren’t visible. That would eliminate a decent chunk of polys. To really eliminate most of the polys though, it would have to be done without vertex colors, and it would have to generate a texture.