How to achieve this effect? Obviously a normal map, but how exactly? Of course I could just UV-map each mesh by hand and give it a normal map, but for my voxel-based models I use a “palette style” texture image where each pixel is one color (the texture is 256*1 pixel big). Hence, Not enough pixels to work with for a normal map. I was thinking of maybe using the detail texture normal slot of Unity’s standard shader and giving it the UV1 (instead of UV0) uv coordinate layer, but I don’t know how to actually map a second set of UV coordinates outside of scripting it by hand.
Any other ideas, maybe a shader-based solution? Each voxel would be 0.0625 Unity units big, by the way (16 voxel per 1 Unity scale).
If anyone is interested, I found the solution. You need a normal map which is later applied to each voxel face, as well as a detail albedo map which is grey at the edges and white in the center area (to get that grid-like look).
Then, in 3d Studio Max (assuming you exported an *
obj file from MagickaVoxel):
Import object
Set System Units to Meters and Unit Scale to Generic Units.
set pivot
Select all vertices and weld
Add UVW Map modifier
UVW Map: Select UV Mapping Channel 2
“” Select “Box” Mapping
“” Set xyz size of box to 0.625 (or however big one voxel is)
use gizmo / transform to align box with grid.
Convert to Editable Poly or similar (collapse layers)
Animate etc.
Export.
In Unity, give the material you want to use for the model the detail normal map and detail albedo maps you created, and everything should look like in the picture (depending on how your maps look, of course).