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. Thanks for looking.
Thanks, you'd have to have an array of meshes, then swap out the mesh on the mesh renderer to to the frame you want in script.
License - Documentation - After importing the package, select the wizard, it should show up at the bottom of the assets menu. 1. 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. 2. Set a filename for the mesh that will be created. You don't need an extension. 3. 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. 4. 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. 5. Click the Create button. This will create the mesh, and it will show up in your assets folder. 6. 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. Have fun!
WORKS PERFECT!!! the only one problem is the large amount of polys (a 16x31 texture generates a +4000 mesh), but it´s a nice beginning. I think there is a better way for optimize this cool utility.
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.
Not working anymore, shows change to ARGB32 format but now there's no such thing and it doesn't work if its rgba32. Trying to update the scrpit.
This is my open source propject. It support texture to mesh too. https://github.com/sr4dev/Unity-SpriteAssist