Anand K Subramanian

clock-icon#3D #mesh-processing #blender #code

clock-icon 16 Oct 2025

clock-icon 2 mins

Converting Mesh Vertex Colors to UV Maps

Quick notes on converting meshes with vertex colors to UV maps. (ply -> obj)

$emsp; 3D meshes are fundamentally represented as a list of vertices, faces, and other optional attributed such as colors and normal vectors.

How are mesh colors represented? One way of representing colors of a mesh is to assign a color (with optional alpha value) to each vertex. These are obviously much more commonly used for point clouds than meshes. However, when rendering to meshes, the vertex colors are usually interpolated and blended to provide a solid color appearance.

A slightly more useful approach is to assign colors to each face. These do not require interpolation and are directly loaded onto the buffer while rendering, reducing computation.

The color details in the above representations are bounded by the resolution of the base mesh. If the base mesh is of low resolution with fewer polygons, then the resulting texture detail will also be low. Therefore, to get a highly detailed mesh, we have to increase the number of vertices and faces, incurring a huge computational overhead.

A straightforward fix is to directly map a high-resolution texture onto a low-poly mesh. UV maps are high-resolution 2D images mapped onto a 3D mesh.

While both the above color attributes are supported in common file formats like PLY (Polygon File Format), only OBJ format explicitly supports UV maps.

Code

Appendix: Common Mesh Formats

difference between PLY, GLB, OBJ, and MTL files?


© 2025 Anand K Subramanian License Design Built with Kutti