Vertex color bake to texture causes wrong color margin I import a .ply file from MagicaVoxel to Blender, it looks good right now:



I want to export to .fbx but it has no color data. Then I baked vertex color to texture, but the problem is that after the bake:



What the hell are those color margin lines between the grids?

I am totally new to blender and have no idea how to fix this, I just do the steps following online toturial:


Add a material, check "Vertex Color Paint"
Select all in "Edit Mode" and click "Smart UV Project"
Add UV image, size default 1024 * 1024
Bake Mode: "Texture" and start to bake, then the result goes wrong.


Anybody has any ideas?

You can get the .ply model from MagicaVoxel, it's free and looks great.
Give some margin

If you inspect closely your uv, you should se than there are no margin and some colors that are not exactly aligned with the uv grid.



This happens because the uv grid (which depend on the number of faces) has different size from the pixel grid (which depends on the baking texture size). You can try to match these with some calculations.... or you can re-unwrap the model in the following way:



set the smart uv margin tho a proper value (for a 1024x1024 tex I set 0.05) and than bake with a minumum bake margin of 1. Setting a margin allows a certain tollerance between color, avoiding overlaps and pixel-grid issues.